describe('login', () => { beforeEach(() => { cy .visit('/api/auth/logout') }) it('should log the current user in', () => { cy .visit('/api/auth/login') cy .get('input[name="email"]') .type(Cypress.env('USERNAME')) cy .get('input[name="password"]') .type(Cypress.env('PASSWORD')) cy .get('form') .submit() .wait(3000) .location('href') .should('equal', 'http://localhost:3000') }) })