Cypress · Middle · Question 27 of 77

How do you test that a session expires after 30 minutes of inactivity?

Show the answer

Correct answer: cy.clock() then cy.tick(30 * 60 * 1000) and assert logout

Explanation

Fake timers make long waits instant. Install the clock before visiting, so the app picks it up.

Further reading

Problem with a question

Cypress · Middle · question 27

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