0

I'm trying to use TestCafe running BDD test against the Angular app.

And we got an account page like:

http://localhost:8080/main#/account

In the testing steps, we have

  • When User go to the account page
  • Then User waited for 20 seconds in the page
  • Then User go to the account page

in the 1st and 3rd step, we implemented using TestCafe

await t.navigateTo(http://localhost:8080/main#/account);

As the hashtag is not triggering a page reload, so no server call/api call would happen, as I'm testing session related feature, expecting some reload/hard refresh happening here.

Anyone come across similar requirements?

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
Shawn
  • 184
  • 2
  • 14
  • location.reload(true) to make the hard refresh. – Sudhakar Sep 04 '19 at 07:16
  • 1
    Tried with await t.eval(() => location.reload(true)), but it just hanging on that step – Shawn Sep 04 '19 at 07:40
  • Found this sample: https://stackoverflow.com/questions/56157048/testcafe-how-to-reload-actual-page, question here is do I have to use fixture to make it work? – Shawn Sep 04 '19 at 07:53
  • The `await t.eval(() => location.reload(true))` command should not hang test execution. Could you please provide an example with which it's possible to reproduce the problem? – mlosev Sep 04 '19 at 08:56
  • we are using "cucumber": "^5.1.0", "gherkin-testcafe": "^2.4.0", "testcafe": "^1.3.3" so in the steps I got `When('User go to account page', async (t) => { await t.eval(() => location.reload(true)); //await t.navigateTo(http://localhost:8080/main#/account); });` – Shawn Sep 04 '19 at 09:19
  • 1
    This description is not sufficient to reproduce the problem. Please create a sample project that will demonstrate the issue on our machines. Use the following template to create the issue: https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md Besides I want to mention that the `gherkin-testcafe` is not supported by TestCafe team, so probably it's better to ask them for help in the `gherkin-testcafe` github repository. – Alex Kamaev Sep 05 '19 at 08:41
  • I raised a ticket in "gherkin-testcafe", but they mentioned it could be some issue in TestCafe. But I fixed the issue by increase timeout after the client function e.g. t.wait(10000); It would be really good if TestCafe can have a proper support or api for page reload. – Shawn Sep 10 '19 at 00:43
  • We are considering this functionality as a potential enhancement for future TestCafe updates. You can subscribe to [this issue](https://github.com/DevExpress/testcafe/issues/4049) to be informed of our progress. – Alexey Lindberg Sep 10 '19 at 09:39

0 Answers0