Cypress · Middle · Question 74 of 77

How do you share setup like login across many specs?

Show the answer

Correct answer: A custom command or cy.session called in beforeEach

Explanation

Central setup keeps specs short and changes to login need editing in one place.

Further reading

Problem with a question

Cypress · Middle · question 74

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