0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 00:46:45 +01:00
posthog/cypress/integration/auth.js
Paolo D'Amico 167a79fa2f
Release navigation-1775 (#3167)
Co-authored-by: yakkomajuri <yakko.majuri@gmail.com>
2021-02-04 10:53:00 +01:00

33 lines
980 B
JavaScript

describe('Auth', () => {
beforeEach(() => {
cy.get('[data-attr=top-navigation-whoami]').click()
})
it('Logout', () => {
cy.get('[data-attr=top-menu-item-logout]').click()
cy.location('pathname').should('include', '/login')
})
it('Logout and login', () => {
cy.get('[data-attr=top-menu-item-logout]').click()
cy.get('#inputEmail').type('fake@posthog.com').should('have.value', 'fake@posthog.com')
cy.get('#inputPassword').type('12345678').should('have.value', '12345678')
cy.get('.btn').click()
})
it('Try logging in improperly', () => {
cy.get('[data-attr=top-menu-item-logout]').click()
cy.get('#inputEmail').type('fake@posthog.com').should('have.value', 'fake@posthog.com')
cy.get('#inputPassword').type('wrong password').should('have.value', 'wrong password')
cy.get('.btn').click()
cy.get('[data-attr=login-error]').should('exist')
})
})