Skip to content
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

test: add PDP/PLP add to cart dialog e2e test #20102

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

uroslates
Copy link
Contributor

@uroslates uroslates requested a review from a team as a code owner March 20, 2025 10:58
@github-actions github-actions bot marked this pull request as draft March 20, 2025 10:58
@uroslates uroslates marked this pull request as ready for review March 20, 2025 11:04
Copy link

cypress bot commented Mar 20, 2025

spartacus    Run #47640

Run Properties:  status check passed Passed #47640  •  git commit 4139e8daf7 ℹ️: Merge a83301e43a04cb3d68e0612e078e7ad7373b8ae3 into c6cae26398c3e15e5abc9ed703d7...
Project spartacus
Branch Review feature/CXSPA-9645
Run status status check passed Passed #47640
Run duration 05m 13s
Commit git commit 4139e8daf7 ℹ️: Merge a83301e43a04cb3d68e0612e078e7ad7373b8ae3 into c6cae26398c3e15e5abc9ed703d7...
Committer Uros Lates
View all properties for this run ↗︎

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

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.

Let's pull the latest develop changes and use the new a11yRunContinuumTest command.

@github-actions github-actions bot marked this pull request as draft April 7, 2025 07:44
@uroslates uroslates changed the title test: add PDP add to cart dialog e2e test test: add PDP/PLP add to cart dialog e2e test Apr 7, 2025
@uroslates uroslates requested a review from Pio-Bar April 7, 2025 09:36
@uroslates uroslates marked this pull request as ready for review April 7, 2025 09:36
});
});

context('Add to Cart (PLP)', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the modal triggered from a PLP any different to the one from elsewhere? If not, would one test be enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

Comment on lines 21 to 23
cy.get('cx-added-to-cart-dialog')
.get('.cx-modal-content')
.a11yRunContinuumTest();
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to get some content from the modal to make sure Cypress waits long enough. Currently the test runs on a mostly empty dialog.

Screenshot 2025-04-07 at 16 37 53

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied.

@github-actions github-actions bot marked this pull request as draft April 7, 2025 17:18
@uroslates uroslates marked this pull request as ready for review April 7, 2025 17:29
@uroslates uroslates requested a review from Pio-Bar April 7, 2025 17:29
Pio-Bar
Pio-Bar previously approved these changes Apr 8, 2025
it('Item Added to Cart Dialog', () => {
cy.visit(siteContextSelector.PRODUCT_PATH_2);
cy.get('cx-add-to-cart button[type=submit]').click();
cy.get('cx-added-to-cart-dialog .cx-modal-content cx-cart-item')
Copy link
Contributor

Choose a reason for hiding this comment

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

cy.get('cx-added-to-cart-dialog .cx-modal-content cx-cart-item') is fine for making sure that the dialog has loaded first. But then we should run the scope of this test on the entire dialog DOM.
cy.get('cx-added-to-cart-dialog').a11yRunContinuumTest();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied!

@github-actions github-actions bot marked this pull request as draft April 9, 2025 09:12
@uroslates uroslates marked this pull request as ready for review April 9, 2025 09:17
@uroslates uroslates requested a review from Zeyber April 9, 2025 09:17
@github-actions github-actions bot marked this pull request as draft April 12, 2025 12:04
@uroslates uroslates marked this pull request as ready for review April 12, 2025 12:05
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