Skip to content

Commit

Permalink
fix login cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
jpelay committed Jul 17, 2024
1 parent 7767051 commit 4db9ccd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/cypress/e2e/tools/login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,24 @@ export function loginForAdmin() {
}

export function login(username, password) {
cy.intercept('/auth/login').as('login')
cy.clearCookies();
cy.clearAllLocalStorage()
cy.clearAllSessionStorage();
goToLogin();
cy.getDataCy('username').type(username);
cy.getDataCy('password').type(password);
cy.getDataCy('login_button').click();
cy.wait(500);
cy.wait('@login');
}

export function logout()
{
goToHome();
cy.intercept('/auth/logout').as('logout')
goToHome();
cy.getDataCy('user_dropdown').click()
cy.getDataCy('logout_button').click()
cy.wait('@logout')
}

export default {loginForUser};

0 comments on commit 4db9ccd

Please sign in to comment.