Skip to content

Instantly share code, notes, and snippets.

@iconnor
Last active July 11, 2019 06:22
Show Gist options
  • Save iconnor/cddd19e3f86affede867ab6fa5f28671 to your computer and use it in GitHub Desktop.
Save iconnor/cddd19e3f86affede867ab6fa5f28671 to your computer and use it in GitHub Desktop.
Cypress io signin test
context('Actions', () => {
beforeEach(() => {
cy.visit('/login');
});
it('Bad sign in should fail', () => {
cy.get('#username')
.type('user@projectlounge.com');
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('user@projectlounge.com');
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('User@projectlounge.com');
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