Why is the response callback not always ran during cy.wait(@)? #25306
Unanswered
TjeuKayim
asked this question in
Questions and Help
Replies: 1 comment 6 replies
-
After some more testing, I found that other unrelated HTTP requests (for example loading images) are influencing whether the response callback is executed before or after the Does Cypress have a feature like |
Beta Was this translation helpful? Give feedback.
6 replies
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.
-
This is about an app that runs
setTimeout
while processing the HTTP response. Even though the test usescy.intercept().as(..
andcy.wait("@..
, it still does not reliably call thecy.tick()
after thefetch().then()
callback. Both in Firefox and Edge, this test is flaky (fails 30% of the time), and it gets worse when enabling network throttling in dev tools. After I added logging, I noticed that the callback sometimes executed aftercy.wait("@
, while I expected Cypress to wait until the HTTP response was processed before executing the next commands afterwait()
.What am I doing wrong?
The app code:
And the test:
Console logs:
See this repository to reproduce TjeuKayim/cypress-example-kitchensink@9c6a4ae
Beta Was this translation helpful? Give feedback.
All reactions