Skip to content
RED SAG Skills
medium10 pts · first answer countsui-automationcypressauthentication

Logging in once in Cypress

Every Cypress spec logs in through the UI, adding 8 seconds per test. Which feature caches the login between tests?

cy.session(['admin'], () => {
  cy.visit('/login')
  cy.get('[data-cy=email]').type('admin@test.ae')
  cy.get('[data-cy=password]').type(Cypress.env('ADMIN_PW'), { log: false })
  cy.get('[data-cy=submit]').click()
  cy.url().should('include', '/dashboard')
})
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions