I know that it is possible to wait for multiple XHR requests on the same url as shown here. However, I would like to wait for two requests running in parallel.
cy.wait('@users')
cy.wait('@users')
When I add two waits as shown above, the second one sometimes timeouts when they finish very closely together, as it basically misses the XHR.
CypressError: Timed out retrying: cy.wait() timed out waiting 30000ms for the 1st response to the route: 'users'. No response ever occurred.
I do not like the introduction of flakiness. Is there a better way to write this that I am missing?
You can wait for an array of aliases, I haven't tried it with multiple calls to the same route, but I think it should do the trick.
cy.wait(['@users', '@users'])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With