Skip to content

Commit 87e7a59

Browse files
committed
e2e test fix
1 parent 7256bd4 commit 87e7a59

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

cypress/e2e/changepassword.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('Change Password Screen', () => {
4444
cy.get('input[id="currentPassword"]').type(currentPassword);
4545
cy.get('input[id="newPassword"]').type(newPassword);
4646
cy.get('input[id="confirmNewPassword"]').type(newPassword);
47-
cy.get('button[type="submit"]').click();
47+
cy.get('[data-cy="changePasswordButton"]').click();
4848

4949
cy.contains('Change Password Succeeded').should('exist');
5050
cy.get('[cy-data="goToAccount"]').click();

cypress/e2e/resetpassword.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ describe('Reset Password Screen', () => {
99

1010
it('should show error when email no email is provided', () => {
1111
cy.get('input[id="email"]').type('not an email', { force: true });
12-
cy.get('[type="submit"]').click();
12+
cy.get('[data-cy="submitResetPasswordButton"]').click();
1313
cy.get('[data-testid=emailError]').should('exist');
1414
});
1515

1616
it('should show the captcha error when is not accepted', () => {
1717
cy.get('iframe[title="reCAPTCHA"]').should('exist');
1818
cy.get('input[id="email"]').type('notvalid@e.c', { force: true });
19-
cy.get('[type="submit"]').click();
19+
cy.get('[data-cy="submitResetPasswordButton"]').click();
2020
cy.get('[data-testid=reCaptchaError]')
2121
.should('exist')
2222
.contains('You must verify you are not a robot.');

src/app/screens/ChangePassword.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ export default function ChangePassword(): React.ReactElement {
222222
<Alert severity='error'>{passwordValidationError}</Alert>
223223
) : null}
224224
<Button
225+
data-cy='changePasswordButton'
225226
type='submit'
226227
variant='contained'
227228
color='primary'

src/app/screens/ForgotPassword.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export default function ForgotPassword(): React.ReactElement {
130130
</Alert>
131131
) : null}
132132
<Button
133+
data-cy='submitResetPasswordButton'
133134
type='submit'
134135
variant='contained'
135136
sx={{ mt: 3, mb: 2 }}

0 commit comments

Comments
 (0)