2020-05-22 18:34:48 +02:00
|
|
|
describe('Auth', () => {
|
2021-02-04 10:53:00 +01:00
|
|
|
beforeEach(() => {
|
|
|
|
cy.get('[data-attr=top-navigation-whoami]').click()
|
|
|
|
})
|
|
|
|
|
2020-05-22 18:34:48 +02:00
|
|
|
it('Logout', () => {
|
2021-02-04 10:53:00 +01:00
|
|
|
cy.get('[data-attr=top-menu-item-logout]').click()
|
|
|
|
cy.location('pathname').should('include', '/login')
|
2020-05-22 18:34:48 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Logout and login', () => {
|
2021-02-04 10:53:00 +01:00
|
|
|
cy.get('[data-attr=top-menu-item-logout]').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
|
2020-07-03 14:37:07 +02:00
|
|
|
cy.get('#inputEmail').type('fake@posthog.com').should('have.value', 'fake@posthog.com')
|
2020-05-22 18:34:48 +02:00
|
|
|
|
2021-02-04 10:53:00 +01:00
|
|
|
cy.get('#inputPassword').type('12345678').should('have.value', '12345678')
|
2020-05-22 18:34:48 +02:00
|
|
|
|
|
|
|
cy.get('.btn').click()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Try logging in improperly', () => {
|
2021-02-04 10:53:00 +01:00
|
|
|
cy.get('[data-attr=top-menu-item-logout]').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
|
2020-07-03 14:37:07 +02:00
|
|
|
cy.get('#inputEmail').type('fake@posthog.com').should('have.value', 'fake@posthog.com')
|
2020-05-22 18:34:48 +02:00
|
|
|
|
2020-07-03 14:37:07 +02:00
|
|
|
cy.get('#inputPassword').type('wrong password').should('have.value', 'wrong password')
|
2020-05-22 18:34:48 +02:00
|
|
|
|
|
|
|
cy.get('.btn').click()
|
|
|
|
|
|
|
|
cy.get('[data-attr=login-error]').should('exist')
|
|
|
|
})
|
|
|
|
})
|