Cypress · Middle · Question 74 of 77
How do you share setup like login across many specs?
- 1Log in once manually before the CI run starts
- 2Copy the login steps into each spec file
- 3A custom command or
cy.sessioncalled inbeforeEach
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.