Skip to content

feat: add Account Settings e2e continuum tets for Email, Password, Personal Details, Notifications Pages #20126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4eff776
feat: add Account Settings e2e continuum tets for Email, Password, Pe…
ulates-sap Mar 27, 2025
51daf07
Merge branch 'develop' into feature/CXSPA-9722
uroslates Mar 31, 2025
69f79a9
refactor: apply new continuum related test changes.
ulates-sap Apr 1, 2025
cc0577e
test: add account settings notification preferences a11y test
ulates-sap Apr 1, 2025
c80c4f4
Merge branch 'develop' into feature/CXSPA-9722
uroslates Apr 1, 2025
5ae7cea
refactor: minor test label refactoring
ulates-sap Apr 1, 2025
c011a3c
test: add a11y continuum e2e close account page test
ulates-sap Apr 2, 2025
6550502
Merge branch 'develop' into feature/CXSPA-9722
uroslates Apr 2, 2025
d6e63a6
fix: address PR comments
ulates-sap Apr 3, 2025
438268f
Merge branch 'develop' into feature/CXSPA-9722
uroslates Apr 3, 2025
ba99fd7
Merge branch 'develop' into feature/CXSPA-9722
uroslates Apr 7, 2025
38bc824
Merge branch 'develop' into feature/CXSPA-9722
uroslates Apr 28, 2025
e3ee772
Merge branch 'develop' into feature/CXSPA-9722
uroslates Apr 29, 2025
7451b5a
fix: fixing PR comments
ulates-sap Apr 29, 2025
4fbc5f5
fix: fixing PR comments
ulates-sap Apr 29, 2025
a65ea16
fix: fixing PR comments
ulates-sap Apr 29, 2025
5a6ede8
fix: fixing PR lint issues
ulates-sap Apr 29, 2025
9f795d8
Merge branch 'develop' into feature/CXSPA-9722
uroslates Apr 29, 2025
5d7716d
Merge branch 'develop' into feature/CXSPA-9722
uroslates Apr 30, 2025
1619e9b
Merge branch 'develop' into feature/CXSPA-9722
uroslates Apr 30, 2025
d928e89
Merge branch 'develop' into feature/CXSPA-9722
uroslates May 5, 2025
39158b0
fix: fixing PR comments
ulates-sap May 6, 2025
07547f9
Merge branch 'develop' into feature/CXSPA-9722
uroslates May 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
form.get('newPassword')?.touched && form.get('newPassword')?.invalid
"
[attr.aria-errormessage]="'newPasswordError'"
aria-describedby="password-input-hint"
cxPasswordVisibilitySwitch
/>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import { standardUser } from '../../sample-data/shared-users';

const CLOSE_ACCOUNT_URL = '/my-account/close-account';

/**
* This test checks accessibility concerns on the Account Settings Close Account page using Access Continuum
*/
describe(
'Account Settings / Close Account Page Accessibility',
{ testIsolation: false },
() => {
before(() => {
cy.a11yContinuumSetup();
});

it('initial page load', () => {
cy.requireLoggedIn(standardUser);
cy.visit(CLOSE_ACCOUNT_URL);
cy.get('cx-close-account button.btn-primary');
cy.get('main').a11yRunContinuumTest();
});

it('confirm Account Closure Modal', () => {
cy.requireLoggedIn(standardUser);
cy.visit(CLOSE_ACCOUNT_URL);
cy.get('cx-close-account button.btn-primary').click();
cy.get('cx-close-account-modal').a11yRunContinuumTest();
});
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import * as updateEmail from '../../helpers/update-email';
import { generateMail, randomString } from '../../helpers/user';
import { standardUser } from '../../sample-data/shared-users';

export function fillUpdateEmailForm({
email,
password,
confirmEmail,
}: {
email: string;
password: string;
confirmEmail: string;
}) {
cy.log(
`🛒 Updating password ${JSON.stringify({ email, password, confirmEmail })}!`
);
cy.get('cx-update-email form').within(() => {
(email ?? '').length > 0
? cy.get('[formcontrolname="email"]').clear().type(email)
: cy.get('[formcontrolname="email"]').clear();
(confirmEmail ?? '').length > 0
? cy.get('[formcontrolname="confirmEmail"]').clear().type(confirmEmail)
: cy.get('[formcontrolname="confirmEmail"]').clear();
(password ?? '').length > 0
? cy.get('[formcontrolname="password"]').clear().type(password)
: cy.get('[formcontrolname="password"]').clear();

cy.get('button.btn-primary').click();
});
}

const UPDATE_EMAIL_URL = updateEmail.UPDATE_EMAIL_URL;

/**
* This test checks accessibility concerns on the Account Settings Email page using Access Continuum
*/
describe(
'Account Settings / Email Page Accessibility',
{ testIsolation: false },
() => {
before(() => {
cy.a11yContinuumSetup();
});

it('initial page load', () => {
cy.requireLoggedIn(standardUser);
cy.visit(UPDATE_EMAIL_URL);
cy.get('cx-update-email form button.btn-primary');
cy.get('main').a11yRunContinuumTest();
});

it('saving enpty fields', () => {
cy.requireLoggedIn(standardUser);
cy.visit(UPDATE_EMAIL_URL);

fillUpdateEmailForm({ email: '', confirmEmail: '', password: '' });
cy.get('main').a11yRunContinuumTest();
});

it('email update success', () => {
const newEmail = generateMail(randomString(), true);
cy.requireLoggedIn(standardUser);
cy.visit(UPDATE_EMAIL_URL);

fillUpdateEmailForm({
email: newEmail,
confirmEmail: newEmail,
password: standardUser.registrationData.password,
});
cy.get('main').a11yRunContinuumTest();
});
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import { standardUser } from '../../sample-data/shared-users';

const NOTIFICATION_PREFERENCE_URL = '/my-account/notification-preference';

/**
* This test checks accessibility concerns on the Account Settings Notification Preference page using Access Continuum
*/
describe(
'Account Settings / Notification Preference Page Accessibility',
{ testIsolation: false },
() => {
before(() => {
cy.a11yContinuumSetup();
cy.requireLoggedIn(standardUser);
cy.visit(NOTIFICATION_PREFERENCE_URL);
cy.get('cx-notification-preference input.form-check-input').as(
'notificationPrefCheckbox'
);
});

it('initial page load', () => {
cy.get('main').a11yRunContinuumTest();
});
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import * as updateEmail from '../../helpers/update-email';
import * as updatePassword from '../../helpers/update-password';
import { standardUser } from '../../sample-data/shared-users';

export function fillUpdatePasswordForm({
oldPassword,
newPassword,
newPasswordConfirm,
}: {
oldPassword: string;
newPassword: string;
newPasswordConfirm: string;
}) {
cy.log(
`🛒 Updating password ${JSON.stringify({ oldPassword, newPassword, newPasswordConfirm })}!`
);
cy.get('cx-update-password form').within(() => {
(oldPassword ?? '').length > 0
? cy.get('[formcontrolname="oldPassword"]').clear().type(oldPassword)
: cy.get('[formcontrolname="oldPassword"]').clear();
(newPassword ?? '').length > 0
? cy.get('[formcontrolname="newPassword"]').clear().type(newPassword)
: cy.get('[formcontrolname="newPassword"]').clear();
(newPasswordConfirm ?? '').length > 0
? cy
.get('[formcontrolname="newPasswordConfirm"]')
.clear()
.type(newPasswordConfirm)
: cy.get('[formcontrolname="newPasswordConfirm"]').clear();
cy.get('button.btn-primary').click();
});
}

const PAGE_URL_UPDATE_PASSWORD = updatePassword.PAGE_URL_UPDATE_PASSWORD;

/**
* This test checks accessibility concerns on the Account Settings Password page using Access Continuum
*/
context(
'Account Settings / Password Page Accessibility',
{ testIsolation: false },
() => {
before(() => {
cy.a11yContinuumSetup();
});

it('initial page load', () => {
cy.requireLoggedIn(standardUser);
cy.visit(PAGE_URL_UPDATE_PASSWORD);
cy.get('cx-update-password form button.btn-primary');
cy.get('main').a11yRunContinuumTest();
});

it('saving enpty fields', () => {
cy.requireLoggedIn(standardUser);
cy.visit(PAGE_URL_UPDATE_PASSWORD);

fillUpdatePasswordForm({
oldPassword: '',
newPassword: '',
newPasswordConfirm: '',
});
cy.get('main').a11yRunContinuumTest();
});

it('password update success', () => {
const newPassword = 'Pas!sword123.a';
// Register new user (changing standardUser password causes other tests to fail)
updateEmail.registerAndLogin();
cy.visit(PAGE_URL_UPDATE_PASSWORD);

fillUpdatePasswordForm({
oldPassword: standardUser.registrationData.password,
newPassword,
newPasswordConfirm: newPassword,
});
cy.get('main').a11yRunContinuumTest();
});
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* SPDX-FileCopyrightText: 2025 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import { standardUser } from '../../sample-data/shared-users';
import * as updateProfile from '../../helpers/update-profile';

export function fillUpdatePersonalDetailsForm({
firstName,
lastName,
}: {
firstName: string;
lastName: string;
}) {
cy.log(`🛒 Updating profile ${JSON.stringify({ firstName, lastName })}!`);
cy.get('cx-update-profile form').within(() => {
(firstName ?? '').length > 0
? cy.get('[formcontrolname="firstName"]').clear().type(firstName)
: cy.get('[formcontrolname="firstName"]').clear();
(lastName ?? '').length > 0
? cy.get('[formcontrolname="lastName"]').clear().type(lastName)
: cy.get('[formcontrolname="lastName"]').clear();
cy.get('button.btn-primary').click();
});
}

const UPDATE_PROFILE_URL = updateProfile.UPDATE_PROFILE_URL;

/**
* This test checks accessibility concerns on the Account Settings Personal Details page using Access Continuum
*/
describe(
'Account Settings / Personal Details Page Accessibility',
{ testIsolation: false },
() => {
before(() => {
cy.a11yContinuumSetup();
});

it('initial page load', () => {
cy.requireLoggedIn(standardUser);
cy.visit(UPDATE_PROFILE_URL);
cy.get('cx-update-profile form button.btn-primary');
cy.get('main').a11yRunContinuumTest();
});

it('saving enpty fields', () => {
cy.requireLoggedIn(standardUser);
cy.visit(UPDATE_PROFILE_URL);

fillUpdatePersonalDetailsForm({ firstName: '', lastName: '' });
cy.get('main').a11yRunContinuumTest();
});

it('password update success', () => {
cy.requireLoggedIn(standardUser);
cy.visit(UPDATE_PROFILE_URL);

fillUpdatePersonalDetailsForm({ firstName: 'John', lastName: 'Doe' });
cy.get('main').a11yRunContinuumTest();
});
}
);
Loading