overleaf/server-ce/test/helpers/login.ts
Mathias Jakobsen 732cbf0c26 Merge pull request #15547 from overleaf/mj-community-edition-tests
[server-ce] Add e2e test for CE

GitOrigin-RevId: f76ee4d19680c57a3a0854bc89175b3fb352ca41
2023-11-24 09:04:18 +00:00

9 lines
350 B
TypeScript

export function login(username: string, password = 'Passw0rd!') {
cy.session([username, password, new Date()], () => {
cy.visit('/login')
cy.get('input[name="email"]').type(username)
cy.get('input[name="password"]').type(password)
cy.findByRole('button', { name: 'Login' }).click()
cy.url().should('contain', '/project')
})
}