From response A (/list.json
) my app receives a list of items. Based on the output of A, my app makes another set of requests B for individual items (/one.txt
, /two.txt
, ...).
Now in my test I want to make sure that all responses B return HTTP 200.
Waiting (cy.wait
) for response A is fine. However, waiting for responses B is more difficult, because I have to start waiting just upon receiving response A where I learn about responses B.
I tried 2 options:
- start waiting inside of cy.wait of response A - code,
- start waiting outside of cy.wait of response A - code
Neither of those work. With option 1 I get
`cy.wait()` timed out waiting `5000ms` for the 1st request to the route: `one.txt`. No request ever occurred
And with option 2 I get a pass, even though /two.txt
doesn't exist. Looks like cy.wait
for responses B is added after the responses were received