2020-05-22 18:34:48 +02:00
|
|
|
describe('Auth', () => {
|
|
|
|
it('Logout', () => {
|
|
|
|
cy.get('[data-attr=user-options-dropdown]').trigger('mouseover')
|
|
|
|
cy.get('[data-attr=user-options-logout]').click()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Logout and login', () => {
|
|
|
|
cy.get('[data-attr=user-options-dropdown]').trigger('mouseover')
|
|
|
|
cy.get('[data-attr=user-options-logout]').click()
|
|
|
|
|
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('password').should('have.value', 'password')
|
2020-05-22 18:34:48 +02:00
|
|
|
|
|
|
|
cy.get('.btn').click()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Try logging in improperly', () => {
|
|
|
|
cy.get('[data-attr=user-options-dropdown]').trigger('mouseover')
|
|
|
|
cy.get('[data-attr=user-options-logout]').click()
|
|
|
|
|
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')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Sign up using team link', () => {
|
2020-07-22 12:25:54 +02:00
|
|
|
cy.get('[data-attr=menu-item-settings]').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
cy.get('[data-attr=copy-invite-to-clipboard-input]')
|
|
|
|
.invoke('val')
|
2020-07-03 14:37:07 +02:00
|
|
|
.then((link) => {
|
2020-05-22 18:34:48 +02:00
|
|
|
cy.get('[data-attr=user-options-dropdown]').trigger('mouseover')
|
|
|
|
cy.get('[data-attr=user-options-logout]').click()
|
|
|
|
cy.visit(link)
|
|
|
|
|
|
|
|
cy.get('#inputName').type(Cypress._.random(0, 1e6))
|
|
|
|
|
|
|
|
cy.get('#inputEmail').type(Cypress._.random(0, 1e6) + '@posthog.com')
|
|
|
|
|
2020-07-08 09:44:29 +02:00
|
|
|
cy.get('#inputPassword').type('Test1234').should('have.value', 'Test1234')
|
2020-05-22 18:34:48 +02:00
|
|
|
|
|
|
|
cy.get('.btn').click()
|
|
|
|
|
|
|
|
cy.get('[data-attr=trend-line-graph]').should('exist') //on trends page
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Sign up using team link with updates', () => {
|
2020-07-22 12:25:54 +02:00
|
|
|
cy.get('[data-attr=menu-item-settings]').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
cy.get('[data-attr=copy-invite-to-clipboard-input]')
|
|
|
|
.invoke('val')
|
2020-07-03 14:37:07 +02:00
|
|
|
.then((link) => {
|
2020-05-22 18:34:48 +02:00
|
|
|
cy.get('[data-attr=user-options-dropdown]').trigger('mouseover')
|
|
|
|
cy.get('[data-attr=user-options-logout]').click()
|
|
|
|
cy.visit(link)
|
|
|
|
|
|
|
|
cy.get('#inputName').type(Cypress._.random(0, 1e6))
|
|
|
|
|
|
|
|
cy.get('#inputEmail').type(Cypress._.random(0, 1e6) + '@posthog.com')
|
|
|
|
|
2020-07-08 09:44:29 +02:00
|
|
|
cy.get('#inputPassword').type('Test1234').should('have.value', 'Test1234')
|
2020-05-22 18:34:48 +02:00
|
|
|
|
|
|
|
cy.get('[data-attr=updates-checkbox').check()
|
|
|
|
|
|
|
|
cy.get('.btn').click()
|
|
|
|
|
|
|
|
cy.get('[data-attr=trend-line-graph]').should('exist') //on trends page
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|