Cypress · Senior · Question 16 of 76
What is a pitfall of cy.session without a validate function?
- 1The session is shared with real users of the app
- 2Expired sessions get restored and tests fail later, confusingly
- 3Sessions are never cached, so every test logs in again
Show the answer
Correct answer: Expired sessions get restored and tests fail later, confusingly
Explanation
Validation (e.g. checking a protected API returns 200) makes Cypress rebuild stale sessions automatically.