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

Conversation

@github-actions github-actions bot marked this pull request as draft March 27, 2025 11:27
@uroslates uroslates changed the title feat: add Account Settings e2e continuum tets for Email, Password, Personal Details Pages feat: add Account Settings e2e continuum tets for Email, Password, Personal Details, Notifications Pages Apr 1, 2025
Copy link
Contributor

@Pio-Bar Pio-Bar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far only two files run AccessContinuum tests. Let's circle back once the rest is completed and existing comments have been resolved with changes applied throughout.

You may also want to check out /storefrontapp-e2e-cypress/docs/a11y-testing.md for some reasoning behind the comments here. There should also be examples on how to specifically target modals and such.

* This test checks accessibility concerns on the Account Settings Close Account page using Access Continuum
*/
describe('Account Settings / Close Account Page Accessibility', () => {
isolateTests();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test isolation is on on by default, I think this may be unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

it('initial page load', () => {
updateEmail.registerAndLogin();
cy.visit(CLOSE_ACCOUNT_URL);
cy.get('cx-breadcrumb h1').should('contain', 'Close Account');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cy.get('cx-breadcrumb h1').should('contain', 'Close Account');
cy.get('cx-breadcrumb h1').contains('Close Account');

We should not use assertions. Ideally we want failures to happen only if Access Continuum finds issues. Otherwise we are risking false negatives. This goes for all the tests in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

Comment on lines 30 to 44
it('Close Account update success', () => {
updateEmail.registerAndLogin();
cy.visit(CLOSE_ACCOUNT_URL);
cy.get('cx-breadcrumb h1').should('contain', 'Close Account');
cy.get('cx-close-account button.btn-primary').click();
cy.get('cx-close-account-modal .cx-close-account-modal-title').should(
'contain',
'Confirm Account Closure'
);
cy.get(
'cx-close-account-modal .cx-close-account-modal-footer button.btn-secondary'
).click();

cy.get('main').a11yRunContinuumTest();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why the modal is opened and then closed? Access Continuum can only see what's part of the DOM while the test is run.
The main has already been tested in the previous test we should only target the modal here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

});

it('initial page load', () => {
updateEmail.registerAndLogin();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no point of having Cypress manually go through the forms. We can login with a request using cy.requireLoggedIn(standardUser); command. This should make our test run a lot faster.

If we are not making any changes to the account we should be able to just reuse one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

Comment on lines 18 to 22
const checkbox = cy
.get('cx-notification-preference')
.find('input.form-check-input');
// TODO: Why is check causing error!?
return isEmailNotificationChannel ? checkbox.check() : checkbox.uncheck();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not use variables with cypress. Trying to access sth outside of it's queue will usually cause problems. Use aliases instead. You can read more here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

Comment on lines 48 to 61
it('notification preference update success', () => {
updateEmail.registerAndLogin();
cy.visit(NOTIFICATION_PREFERENCE_URL);
cy.get('cx-breadcrumb h1').should('contain', 'Notification Preference');
cy.get('cx-notification-preference input[type="checkbox"]').should(
'not.be.checked'
);
updateNotificationPreferencesForm({ isEmailNotificationChannel: true });
cy.get('cx-notification-preference input[type="checkbox"]').should(
'be.checked'
);

cy.get('main').a11yRunContinuumTest();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there unique elements here compared to the previous test? Looks like we are just scanning the same thing twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

@uroslates uroslates marked this pull request as ready for review April 3, 2025 21:08
@uroslates uroslates requested review from a team as code owners April 3, 2025 21:08
Copy link

cypress bot commented Apr 3, 2025

spartacus    Run #48039

Run Properties:  status check passed Passed #48039  •  git commit 12063b7188 ℹ️: Merge 07547f9a08ad9fbbf44fd2f6a29ebd1572baa79d into c4fc7f81ef89914d3f1ce4814c0f...
Project spartacus
Branch Review feature/CXSPA-9722
Run status status check passed Passed #48039
Run duration 04m 55s
Commit git commit 12063b7188 ℹ️: Merge 07547f9a08ad9fbbf44fd2f6a29ebd1572baa79d into c4fc7f81ef89914d3f1ce4814c0f...
Committer Uros Lates
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 152
View all changes introduced in this branch ↗︎

@uroslates uroslates requested a review from Pio-Bar April 7, 2025 12:26
@github-actions github-actions bot marked this pull request as draft April 7, 2025 12:26
@uroslates uroslates marked this pull request as ready for review April 7, 2025 12:27
@github-actions github-actions bot marked this pull request as draft April 29, 2025 08:03
@uroslates uroslates marked this pull request as ready for review April 29, 2025 08:06
@github-actions github-actions bot marked this pull request as draft April 29, 2025 10:36
@uroslates uroslates marked this pull request as ready for review April 29, 2025 11:20
@github-actions github-actions bot marked this pull request as draft April 29, 2025 11:42
@uroslates uroslates marked this pull request as ready for review April 29, 2025 12:00
@uroslates uroslates requested a review from Zeyber April 29, 2025 13:55
@github-actions github-actions bot marked this pull request as draft April 29, 2025 13:56
@uroslates uroslates marked this pull request as ready for review April 30, 2025 09:41
@github-actions github-actions bot marked this pull request as draft April 30, 2025 09:41
@uroslates uroslates marked this pull request as ready for review May 5, 2025 13:58
@github-actions github-actions bot marked this pull request as draft May 6, 2025 08:42
@uroslates uroslates requested a review from Zeyber May 6, 2025 08:45
@uroslates uroslates marked this pull request as ready for review May 6, 2025 08:45
@uroslates uroslates requested a review from Zeyber May 6, 2025 09:12
@uroslates uroslates merged commit b344de7 into develop May 6, 2025
34 checks passed
@uroslates uroslates deleted the feature/CXSPA-9722 branch May 6, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants