Last active
July 11, 2019 06:22
-
-
Save iconnor/cddd19e3f86affede867ab6fa5f28671 to your computer and use it in GitHub Desktop.
Cypress io signin test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context('Actions', () => { | |
beforeEach(() => { | |
cy.visit('/login'); | |
}); | |
it('Bad sign in should fail', () => { | |
cy.get('#username') | |
.type('[email protected]'); | |
cy.get('#password') | |
.type('Bad pass'); | |
cy.get('#LoginButton').click(); | |
cy.get('.alert') | |
.should('contain', 'Bad credentials'); | |
}); | |
it('User sign in should work', () => { | |
cy.get('#username') | |
.type('[email protected]'); | |
cy.get('#password') | |
.type('goodpassword'); | |
cy.get('#LoginButton').click(); | |
cy.get('#logout') | |
.should('contain', 'Admin Console'); | |
}); | |
it('User sign in should work - case insensitive user', () => { | |
cy.get('#username') | |
.type('[email protected]'); | |
cy.get('#password') | |
.type('goodpassword'); | |
cy.get('#LoginButton').click(); | |
cy.get('#logout') | |
.should('contain', 'Admin Console'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment