umami/cypress/e2e/login.cy.ts

23 lines
828 B
TypeScript
Raw Normal View History

2024-03-01 02:40:49 +01:00
describe('Login tests', () => {
2024-02-29 00:01:13 +01:00
it(
'logs user in with correct credentials and logs user out',
{
defaultCommandTimeout: 10000,
},
() => {
cy.visit('/login');
2024-03-06 20:36:40 +01:00
cy.getDataTest('input-username').find('input').click();
cy.getDataTest('input-username').find('input').type(Cypress.env('umami_user'), { delay: 50 });
cy.getDataTest('input-password').find('input').click();
cy.getDataTest('input-password')
.find('input')
.type(Cypress.env('umami_password'), { delay: 50 });
cy.getDataTest('button-submit').click();
cy.url().should('eq', Cypress.config().baseUrl + '/dashboard');
cy.getDataTest('button-profile').click();
cy.getDataTest('item-logout').click();
2024-02-29 00:01:13 +01:00
cy.url().should('eq', Cypress.config().baseUrl + '/login');
},
);
2024-02-28 06:41:34 +01:00
});