umami/cypress/e2e/login.cy.ts

23 lines
828 B
TypeScript
Raw Normal View History

2024-03-01 01:40:49 +00:00
describe('Login tests', () => {
2024-02-28 23:01:13 +00:00
it(
'logs user in with correct credentials and logs user out',
{
defaultCommandTimeout: 10000,
},
() => {
cy.visit('/login');
2024-03-06 19:36:40 +00: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-28 23:01:13 +00:00
cy.url().should('eq', Cypress.config().baseUrl + '/login');
},
);
2024-02-28 05:41:34 +00:00
});