Skip to content

Commit 9c5c831

Browse files
Copilotrenemadsen
andcommitted
Remove spinner waits from Cypress password test and make WDIO test atomic
Co-authored-by: renemadsen <[email protected]>
1 parent a7718c7 commit 9c5c831

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

eform-client/cypress/e2e/PasswordSettings.page.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ class PasswordSettingsPage extends PageWithNavbarPage {
2828
cy.intercept('PUT', '**/api/auth/change-password').as('changePassword');
2929
this.saveBtn().should('be.visible').should('be.enabled').click();
3030
cy.wait('@changePassword', { timeout: 10000 });
31-
cy.get('#spinner-animation').should('not.exist');
32-
cy.wait(500);
3331
}
3432

3533
revertToOldPassword(oldPassword = loginConstants.newPassword, newPassword = loginConstants.password) {
@@ -42,8 +40,6 @@ class PasswordSettingsPage extends PageWithNavbarPage {
4240
cy.intercept('PUT', '**/api/auth/change-password').as('changePassword');
4341
this.saveBtn().should('be.visible').should('be.enabled').click();
4442
cy.wait('@changePassword', { timeout: 10000 });
45-
cy.get('#spinner-animation').should('not.exist');
46-
cy.wait(500);
4743
}
4844
}
4945

eform-client/e2e/Tests/password-settings/password-settings.change-password.spec.ts

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,36 @@ describe('Password settings', function () {
88
before(async () => {
99
loginPage.open('/');
1010
loginPage.login();
11-
myEformsPage.Navbar.goToPasswordSettings();
1211
});
1312

14-
it('should set password to 2Times2WillDo', async () => {
13+
it('should change password and revert it back', async () => {
14+
// Navigate to password settings
15+
myEformsPage.Navbar.goToPasswordSettings();
16+
17+
// Change password to new password
1518
passwordSettings.setNewPassword();
19+
20+
// Logout
1621
passwordSettings.Navbar.logout();
22+
23+
// Login with new password to verify change worked
1724
loginPage.open('/');
1825
loginPage.loginWithNewPassword();
26+
27+
// Navigate to password settings to revert
1928
myEformsPage.Navbar.goToPasswordSettings();
20-
// expect(myEformsPage.Navbar.verifyHeaderMenuItem('My eForms')).equal('My eForms');
21-
// expect(myEformsPage.Navbar.verifyHeaderMenuItem('Device Users')).equal('Device Users');
22-
// expect(myEformsPage.Navbar.verifyHeaderMenuItem('Advanced')).equal('Advanced');
23-
});
24-
it('should revert to old password', async () => {
29+
30+
// Revert password back to original
2531
passwordSettings.revertToOldPassword();
32+
33+
// Logout
2634
passwordSettings.Navbar.logout();
35+
36+
// Login with original password to verify revert worked
2737
loginPage.open('/');
2838
loginPage.login();
39+
40+
// Verify we can access password settings again
2941
myEformsPage.Navbar.goToPasswordSettings();
30-
// expect(myEformsPage.Navbar.verifyHeaderMenuItem('Meine eForms')).equal('Meine eForms');
31-
// expect(myEformsPage.Navbar.verifyHeaderMenuItem('Gerätebenutzer')).equal('Gerätebenutzer');
32-
// expect(myEformsPage.Navbar.verifyHeaderMenuItem('Fortgeschritten')).equal('Fortgeschritten');
3342
});
3443
});

0 commit comments

Comments
 (0)