Comments (9)
You're right, I hadn't realized it until now... well, how waitUntil
works:
- it runs the
checkFunction
- if the result is falsy, it waits (through
cy.wait
) - return to step nĀ°1 25 times (by default, it's the result of 5000/200, the default timeout, and the default interval)
Then, what happens when two waitUntil
calls are nested
- parent: it runs the
checkFunction
1.1. child: it runs thecheckFunction
1.2. child: if the result is falsy, it waits (throughcy.wait
)
1.3. child: return to step nĀ°1.1 25 times - parent: if the result is falsy, it waits (through
cy.wait
) - return to step nĀ°1 25 times
so the parent waitUntil
call will retry 25 times (by default) but every time the child waitUntil
call runs 25 retries, completely breaking the concept of "time" of the parent call.
I'm going to add this note to the README, thanks a lot for the dedication @JonahKK!!!!!! ā¤ļø
from cypress-wait-until.
Hi @JonahKK
Thanks for asking, could you share a minimal repository to play with, please?
Thanks
Stefano
from cypress-wait-until.
Nested cy.waitUntil
calls should work as expected š
from cypress-wait-until.
@JonahKK, up š
from cypress-wait-until.
@NoriSte Sorry about the delay, had a lot on my mind recently. I will try to prepare the example this week.
from cypress-wait-until.
Perfect, thanks!!! I appreciate it š
from cypress-wait-until.
I have been experimenting with the different setups, trying to reproduce the exact error I've been describing, yet without luck. Obviously I cannot share code from work.
All I have observed was that waitUntil
nested inside of another wait can take a lot of time, before the timeout happens. It might work as expected, yet with default timeouts (5 seconds) it takes over 60 seconds to fail!
Maybe I was experiencing this extended wait time, that made me think there is an error - I use bigger timeouts in my production code.
from cypress-wait-until.
Thanks for the feedback @JonahKK!! š
All I have observed was that waitUntil nested inside of another wait can take a lot of time, before the timeout happens. It might work as expected, yet with default timeouts (5 seconds) it takes over 60 seconds to fail!
Could you share a repo with this example, please? I didn't notice it in my tests š¤
from cypress-wait-until.
Please check the https://github.com/JonahKK/cypress-test-tiny/tree/wait-until. Just open the Cypress runner and launch the spec. The test should timeout after 70 seconds (unless you will be lucky and have a match in the wait š)
from cypress-wait-until.
Related Issues (20)
- Timed out retrying after 4000ms: Expected to find element HOT 2
- Global timeout HOT 3
- Overwrite WaitUntil command HOT 3
- Cypress throw an error when returning `true` inside the cy.waitUntil callback HOT 4
- Example/Document Request: How to catch 'errorMsg' if cy.waitUntil() exceeds 'timeout'? HOT 1
- How to write test code about progess bar by waituntil HOT 3
- Wait for DOM change in order to assert completion of a job HOT 3
- Element is never found when timeout options are overrided HOT 5
- Update plugin to be compatible with Cypress 10 HOT 4
- feature request: use config file to set default timeout HOT 2
- Question: can I waitUntil multiple elements appear? HOT 2
- Cypress configuration error HOT 3
- Using cy.reload() - Failed because you are mixing up async and sync code. HOT 5
- Not working on the latest cypress version HOT 5
- Timeout can take longer than defined HOT 6
- allow node 16 HOT 5
- Is version 2.0.1 compatible with cypress 10? HOT 3
- Problem with TypeScript signature HOT 7
- wrong casing on reference types causes typscript build issues HOT 4
- How do I log using waitUntil() to troubleshoot issues? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-wait-until.