Cypress · Middle · Question 11 of 77

Why must cy.intercept be defined before the action that triggers the request?

Show the answer

Correct answer: Requests sent before it was registered won't be caught

Explanation

Register intercepts first, then visit or click. Otherwise a fast request slips through and cy.wait times out.

Further reading

Problem with a question

Cypress · Middle · question 11

Test yourself

Take the Cypress · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz