Replacing while loop with reload in it. #15152
Unanswered
GabRog
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone.
I have got a problem with transforming my code to proper form for Cypress execution.
Description
For testing my application I used Cypress 6.5.0 with Typescript and Chrome 88.
Testing the application, I need to wait until status of activation changes. In fact I am waiting for the color of element to change. Unfortunately I need to refresh page to see if color changed (element does not change color automatically). For activation I am waiting 5-15 minutes.
To deal with it, I used while loop placed in external method. It looked like this:
I was expecting that loop will end after activation end. When I tried to execute the test suite (description), only clause "before" was executed, the only test (it) in suite looked as if it was started but nothing happened and it hanged with "pending arrows" next to test title.


At the very end I finally got "Aw, snap!" error in chrome.
I spent nearly two weeks trying to figure out what has happened. I was sure, that there can't be anything wrong with the test, because I would get an information from cypress. I was trying to reconfigure project, change versions of: cypress, browsers, node + npm, but nothing helped. I thought that maybe I have something wrong with my configuration on my computer.
When I found out that previous version of test (without loop) was passing happily I started to run test lines one by one and in such way I get to know that the problem is in while loop.
Asking for help
I need to transform somehow above loop to form that will be acceptable for Cypress and test will be able to finish. I also would like transformed code to check the color in some intervals. When color is changed, next test commands/lines should be executed.
Beta Was this translation helpful? Give feedback.
All reactions