UI test for change password

Help docs
This commit is contained in:
Jamie Curnow
2023-03-01 16:34:52 +10:00
parent cfbd7f05d0
commit 91fe448782
7 changed files with 61 additions and 17 deletions

View File

@ -22,14 +22,20 @@ describe('UI Setup and Login', () => {
cy.clearLocalStorage();
});
it('Should be able to login', function() {
it('Should be able to login and change password', function() {
cy.visit('/');
cy.get('input[name="email"]').type('cypress@example.com');
cy.get('input[name="password"]').type('changeme');
cy.get('form button:last').click();
// To fix after chakra change:
// cy.get('.navbar-nav .avatar').should('be.visible');
// change password
cy.get('button[data-testid="profile-menu"]').should('be.visible').click();
cy.get('button[data-testid="profile-menu-change-password"]').should('be.visible').click();
cy.get('input[name="current"]').type('changeme');
cy.get('input[name="password"]').type('ihavebeenchanged');
cy.get('input[name="password2"]').type('ihavebeenchanged');
cy.get('form button[data-testid="save"]').click();
cy.get('form[data-testid="change-password"]').should('not.exist');
// logout:
cy.clearLocalStorage();