Cypress: Having to log in within every test - is this normal?

Created on 9 Jan 2018  路  1Comment  路  Source: cypress-io/cypress

I noticed that I need to log in within every single test. Is this expected, or am I doing something wrong?

So I've made my own Cypress command called login which fills out the login form with a test user account and signs in. And that command is executed in beforeEach before a series of tests.

Most helpful comment

This is our recommended way to test. This ensures isolation of state between tests. https://on.cypress.io/best-practices#Having-tests-rely-on-the-state-of-previous-tests

>All comments

This is our recommended way to test. This ensures isolation of state between tests. https://on.cypress.io/best-practices#Having-tests-rely-on-the-state-of-previous-tests

Was this page helpful?
0 / 5 - 0 ratings