Skip to content

Instantly share code, notes, and snippets.

@adambouchard
Created September 8, 2020 16:23
Show Gist options
  • Save adambouchard/553fe198c3700095d7422504bbc5270f to your computer and use it in GitHub Desktop.
Save adambouchard/553fe198c3700095d7422504bbc5270f to your computer and use it in GitHub Desktop.
describe('Authentication', () => {
it('Login - fail w/ incorrect credentials', () => {
cy.visit('/login')
cy.get('[data-cy=email]').type('sysadmin+e2e@easelearning.com')
cy.get('[data-cy=password]').type('wrongpwd123')
cy.get('[data-cy=submit]').click().then(() => {
cy.url().should('include', '/login')
cy.get('[data-cy=error]').should('be.visible')
})
})
it('Login - success', () => {
cy.visit('/login')
cy.get('[data-cy=email]').type('sysadmin+e2e@easelearning.com')
cy.get('[data-cy=password]').type('password')
cy.get('[data-cy=submit]').click().then(() => {
cy.url().should('include', '/a/8')
})
})
it('Logout - success', () => {
cy.get('[data-cy=dropdownUserClick]').click()
cy.get('[data-cy=logout]').click().then(() => {
// how to check the store was cleared?
cy.url().should('include', '/login')
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment