mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
add prelim website tests
This commit is contained in:
parent
14c0c5060a
commit
7ded5fc6c9
7 changed files with 73 additions and 11 deletions
|
|
@ -1,5 +1,24 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
Cypress.Commands.add('dataCy', value => {
|
||||
Cypress.Commands.add('dataCy', (value: string) => {
|
||||
return cy.get(`[data-cy=${value}]`);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('login', (username: string, password: string) => {
|
||||
cy.session(
|
||||
[username, password],
|
||||
() => {
|
||||
cy.visit('/login');
|
||||
cy.dataCy('input-username').type(username);
|
||||
cy.dataCy('input-password').type(password);
|
||||
cy.dataCy('button-submit').click();
|
||||
cy.url().should('eq', Cypress.config().baseUrl + '/dashboard');
|
||||
},
|
||||
{
|
||||
validate: () => {
|
||||
cy.visit('/profile');
|
||||
},
|
||||
},
|
||||
);
|
||||
cy.visit('/dashboard');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue