Whats the better way to wait cypress for all XHR requests to complete #16162
prashant-kajale
started this conversation in
General
Replies: 3 comments 5 replies
-
I would suggest waiting for something on the page, like a CSS class being set when all info has finished loading. Unfortunately there is no generic "wait for all network calls to finish" in Cypress. |
Beta Was this translation helpful? Give feedback.
3 replies
-
You could wait for idle of zero so it would essentially just wait for the network requests to complete without any extra timeSent from my iPhoneOn Sep 18, 2024, at 15:36, Splines ***@***.***> wrote:
However, the way I understand cypress-network-idle is that it's adding timeouts which will slow down your tests.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Well that too - do you want to wait for the current network requests only or any that might be kicked off right after? In any case, feel free to open a new issue in the plugins repository and we can discuss it there Sent from my iPhoneOn Sep 18, 2024, at 15:41, Splines ***@***.***> wrote:
Ah, that's nice. Then I understood this sentence wrong in your documentation:
Wait for two seconds to pass without any network calls (Ajax, static resources)
I thought this meant that you'd have to set the threshold time high enough to be sure you didn't miss any network call that might happen later.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While navigating between pages, and also after login to app, there is various XHR request that happens.
SO what the better way to wait till all the requests are complete.
The wait requires to pass the request in it but is impossible to define for each navigation.
Beta Was this translation helpful? Give feedback.
All reactions