I have a simple Cypress test:
describe('My First Test', () => {
it('Go to login page', () => {
cy.visit('http://localhost:3000')
cy.contains('Log in').click()
})
it('Login with local account', () => {
cy.get('input[type=email]').type('[email protected]')
cy.get('input[type=password]').type('asd123')
cy.contains('Log in').type('{enter}')
})
})
The first assertion checks if there's a element with the text Log in, then clicks it. Second assertion tries to log in.
I've changed the text in the Log in button to Assertion Failed. So now the first assertion fails, but it still runs the second assertion even though I'm not redirected to the login page.
Is there a way to cancel a running spec when a assertion fails?