Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions changelog/fix-e2e-test-subscriptions-shopper
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: dev

Fix E2E subcription shopper test failures because the core changes text from "Sign up now" to "Add to cart"
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describeif( shouldRunSubscriptionsTests )(

// Add it to the cart and verify that the cart page shows the free trial details
await shopperPage
.getByRole( 'button', { name: 'Sign up now' } )
.getByRole( 'button', { name: 'Add to cart', exact: true } )
.click();
await goToCart( shopperPage );
await expect(
Expand Down Expand Up @@ -130,7 +130,7 @@ describeif( shouldRunSubscriptionsTests )(
const card = config.cards[ '3dsOTP' ];
await fillCardDetails( shopperPage, card );
await shopperPage
.getByRole( 'button', { name: 'Sign up now' } )
.getByRole( 'button', { name: 'Add to cart', exact: true } )
Copy link
Contributor

Choose a reason for hiding this comment

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

This change probably won't be needed - the change in subscriptions is incorrect as the Checkout page should not say "Add to cart". My guess is that it would be changed back to "Sign up now"

Copy link
Member Author

Choose a reason for hiding this comment

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

@opr - thanks for the info. However, the Slack convo is about the Checkout page only, while the problem with our E2E tests is on the single product page (see the screenshot in my PR description, which is from the failed E2E test).

Copy link
Member Author

@htdat htdat Aug 22, 2025

Choose a reason for hiding this comment

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

I am going to merge this PR now. Will follow up the convo and revert the fix if needed, but I don't think that's the case, given looking at your PR too https://github.com/woocommerce/woocommerce-subscriptions/pull/5043

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for checking! I appreciate the reply and info.

Copy link
Contributor

Choose a reason for hiding this comment

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

But hold on, earlier in this test, line 115 it says:

// Proceed to the checkout page and verify that the 14-day free trial is shown in the product line item,
// and that the first renewal date is 14 days from now.
await setupCheckout( shopperPage, customerBilling );

You may want to double check this one after my PR is merged in subscriptions

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh @opr, you're totally right. We will need to update it back to Place order or Sign up now when the next version of WooCommerce Subscription is released!

.click();
await shopperPage.frames()[ 0 ].waitForLoadState( 'load' );
await confirmCardAuthentication( shopperPage, true );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describeif( shouldRunSubscriptionsTests )(
);
await goToProductPageBySlug( shopperPage, productSlug );
await shopperPage
.getByRole( 'button', { name: 'Sign up now' } )
.getByRole( 'button', { name: 'Add to cart', exact: true } )
.click();
await shopperPage.waitForLoadState( 'networkidle' );
await expect(
Expand Down