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

Fix e2e tests #2050

Merged
merged 1 commit into from
Aug 8, 2023
Merged

Fix e2e tests #2050

merged 1 commit into from
Aug 8, 2023

Conversation

jorgemd24
Copy link
Contributor

@jorgemd24 jorgemd24 commented Aug 8, 2023

Changes proposed in this Pull Request:

Closes # .

E2E tests are failing due to the fact that the shop page and product items are blockified when utilizing the twenty twenty three template. See here: https://github.com/woocommerce/google-listings-and-ads/actions/runs/5794717342/job/15705036856?pr=2049

For instance, when using the twenty twenty three template, the "add to cart" option appears as a button:

<button href="?add-to-cart=34" class="wp-block-button__link wp-element-button wc-block-components-product-button__button add_to_cart_button ajax_add_to_cart product_type_simple has-font-size has-small-font-size has-text-align-center added" style="margin-bottom:1rem;" data-product_id="34" data-product_sku="" aria-label="Add “Simple product” to your cart" rel="nofollow">Add to cart</button><a href="http://localhost:8889/cart/" class="added_to_cart wc-forward" title="View cart">View cart</a>

In contrast, when it is not blockified is rendered as a link:

<a href="?add-to-cart=12" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="12" data-product_sku="" aria-label="Add “Simple product” to your cart" aria-describedby="" rel="nofollow">Add to cart</a>

And the shopper utility from the e2e utils package is expecting a link: https://github.com/woocommerce/woocommerce/blob/trunk/packages/js/e2e-utils/src/flows/shopper.js#L45C23-L45C23

As a result, causing the tests to not pass.

This PR sets the theme to twentytwentyone which does not use blocks.

Screenshots:

Detailed test instructions:

  1. Check that e2e tests are OK.

Additional details:

  • In our new tests with PlayWright we should consider the case when the template uses blocks.

Changelog entry

Dev - Fix E2E tests

@jorgemd24 jorgemd24 self-assigned this Aug 8, 2023
@github-actions github-actions bot added changelog: fix Took care of something that wasn't working. type: bug The issue is a confirmed bug. labels Aug 8, 2023
@jorgemd24 jorgemd24 added changelog: dev Developer-facing only change. and removed changelog: fix Took care of something that wasn't working. labels Aug 8, 2023
@jorgemd24 jorgemd24 requested a review from a team August 8, 2023 11:35
Copy link
Contributor

@puntope puntope left a comment

Choose a reason for hiding this comment

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

✅ Thanks for the fix, I see the tests passing now

@jorgemd24 jorgemd24 merged commit 43545e8 into release/2.5.2 Aug 8, 2023
5 checks passed
@jorgemd24 jorgemd24 deleted the fix/e2e-tests-blocks branch August 8, 2023 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: dev Developer-facing only change. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants