Cypress · Middle · Question 6 of 77
How do you assert on the response of an intercepted request?
cy.wait("@saveOrder").its("response.statusCode").should("eq", 201);- 1Call
cy.requestagain and compare the two responses - 2Wait on the alias and check properties of the interception
- 3Read the response from the server logs after the test
Show the answer
Correct answer: Wait on the alias and check properties of the interception
Explanation
cy.wait('@alias') yields an object with request and response, so body, headers and status can all be asserted.