Skip to content

Conversation

@mgascam
Copy link
Contributor

@mgascam mgascam commented Dec 3, 2025

Part 3 of 3: Remaining Shopper Specs

Fixes WOOPMNT-5503 WOOPMNT-5504 WOOPMNT-5505

Completes the shopper specs migration to QIT by adding the remaining 8 test specs.

Continues from:

Test Coverage

My Account

  • ✅ My account payment methods add failures
  • ✅ My account saved cards management

Multicurrency & Pay for Order

  • ✅ Multi-currency checkout
  • ✅ Multi-currency widget
  • ✅ Pay for order flow

Alternative Payment Methods

  • ⏭️ Alipay checkout purchase (skipped - see Known Limitations)
  • ✅ Klarna checkout purchase
  • ✅ BNPLs (Buy Now Pay Later) checkout

Known Limitations & TODOs

Alipay Test Skipped

The Alipay checkout test is skipped because Alipay payments require specific Stripe account configuration that is not available in the QIT test environment. The payment method can be enabled in settings but checkout fails with "Invalid or missing payment details".

UPDATE: the tests are also failing in the legacy E2E tests, will take a closer look: https://github.com/Automattic/woocommerce-payments/actions/runs/19897781148/job/57032712443?pr=11177

Card Testing Protection (Pay for Order)

The cardTestingPreventionEnabled: true test case is skipped in shopper-pay-for-order.spec.ts.

Root cause: The QIT devtools implementation uses WP-CLI to set options directly, but the card testing protection feature relies on filters/hooks from the Dev Tools plugin (option_wcpay_account_data, woocommerce_payments_account_refreshed) that aren't available in the QIT environment.

TODO: Update QIT devtools implementation to properly simulate the Dev Tools plugin behavior for card testing protection.

Note: I'm deferring the resolution of these TODOs until the migration to QIT Testing Packages is complete.

Changes

8 new spec files (~1,270 additions):

  • shopper-myaccount-payment-methods-add-fail.spec.ts
  • shopper-myaccount-saved-cards.spec.ts
  • multi-currency-checkout.spec.ts
  • shopper-multi-currency-widget.spec.ts
  • shopper-pay-for-order.spec.ts
  • alipay-checkout-purchase.spec.ts
  • klarna-checkout-purchase.spec.ts
  • shopper-bnpls-checkout.spec.ts

Testing

The site that QIT spins needs an onboarded account. Follow this steps to get the JetPack tokens:

  1. Create a fresh JN with defaults plus:
    • WooCommerce
    • JetPack Debug helper
  2. Log in as admin
  3. Navigate to Admin > Payments
  4. Click Install next to Accept payments with Woo
  5. Choose your payment methods > Enable all > Continue
  6. Connect to Wordpress.com > Connect
  7. You're almost there — time to activate payments! > Test payments first, activate later > Test Payments
  8. You should be onboarded in test mode by this point
  9. Admin > Jetpack Debug > Jetpack Debug Tools > Enable Broken token Utilities and Save
  10. Admin > Jetpack Debug > Broken Token > Current token options being used by Jetpack:
  11. Note
    • Blog ID
    • Blog Token
    • User Tokens (note: it shows an array, but you need the value of the first element)
  12. You can now populate the vars in tests/qit/config/local.env with those values. You can use tests/qit/config/default.env as a template
    • E2E_JP_SITE_ID
    • E2E_JP_BLOG_TOKEN
    • E2E_JP_USER_TOKEN
  13. Note: some times tests due to an authentication issue. Please try to reconnect Jetpack in the JN site and try again with the new tokens

Run the tests

npm run test:qit-e2e // run all tests
npm run test:qit-e2e -- --tag=shopper // run all shopper tests
npm run test:qit-e2e multi-currency-checkout.spec.ts // run single spec
npm run test:qit-e2e shopper-myaccount-saved-cards.spec.ts // run single spec

All tests should pass ✅

Note

This completes the shopper specs migration. The next step is to start using the QIT Testing Packages feature, currently in progress. Merchant and subscription specs will follow in separate PRs.

🤖 Generated with Claude Code

Migrates 8 shopper test specs to QIT:

My Account:
- My account payment methods add failures
- My account saved cards management

Multicurrency & Pay for Order:
- Multi-currency checkout
- Multi-currency widget
- Pay for order flow

Alternative Payment Methods:
- Alipay checkout purchase
- Klarna checkout purchase
- BNPLs (Buy Now Pay Later) checkout

Tests cover shopper flows for account management, currency
switching, and alternative payment methods.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Test the build

Option 1. Jetpack Beta

  • Install and activate Jetpack Beta.
  • Use this build by searching for PR number 11177 or branch name dev/qit-e2e-shopper-remaining-specs in your-test.site/wp-admin/admin.php?page=jetpack-beta&plugin=woocommerce-payments

Option 2. Jurassic Ninja - available for logged-in A12s

🚀 Launch a JN site with this branch 🚀

ℹ️ Install this Tampermonkey script to get more options.


Build info:

  • Latest commit: 4a125b6
  • Build time: 2025-12-04 12:56:49 UTC

Note: the build is updated when a new commit is pushed to this PR.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Size Change: 0 B

Total Size: 877 kB

ℹ️ View Unchanged
Filename Size
release/woocommerce-payments/assets/css/admin.css 1.45 kB
release/woocommerce-payments/assets/css/admin.rtl.css 1.45 kB
release/woocommerce-payments/assets/css/success.css 1.06 kB
release/woocommerce-payments/assets/css/success.rtl.css 1.06 kB
release/woocommerce-payments/dist/blocks-checkout-rtl.css 3.05 kB
release/woocommerce-payments/dist/blocks-checkout.css 3.05 kB
release/woocommerce-payments/dist/blocks-checkout.js 54.6 kB
release/woocommerce-payments/dist/cart-block-rtl.css 113 B
release/woocommerce-payments/dist/cart-block.css 112 B
release/woocommerce-payments/dist/cart-block.js 16.7 kB
release/woocommerce-payments/dist/cart.js 5.27 kB
release/woocommerce-payments/dist/checkout-rtl.css 1.13 kB
release/woocommerce-payments/dist/checkout.css 1.13 kB
release/woocommerce-payments/dist/checkout.js 34.6 kB
release/woocommerce-payments/dist/express-checkout-rtl.css 367 B
release/woocommerce-payments/dist/express-checkout.css 367 B
release/woocommerce-payments/dist/express-checkout.js 16.8 kB
release/woocommerce-payments/dist/frontend-tracks.js 833 B
release/woocommerce-payments/dist/index-rtl.css 21.2 kB
release/woocommerce-payments/dist/index.css 21.3 kB
release/woocommerce-payments/dist/index.js 155 kB
release/woocommerce-payments/dist/multi-currency-analytics.js 1.08 kB
release/woocommerce-payments/dist/multi-currency-rtl.css 3.82 kB
release/woocommerce-payments/dist/multi-currency-switcher-block.js 18.2 kB
release/woocommerce-payments/dist/multi-currency.css 3.83 kB
release/woocommerce-payments/dist/multi-currency.js 24.7 kB
release/woocommerce-payments/dist/order-rtl.css 740 B
release/woocommerce-payments/dist/order.css 740 B
release/woocommerce-payments/dist/order.js 21.3 kB
release/woocommerce-payments/dist/plugins-page-rtl.css 484 B
release/woocommerce-payments/dist/plugins-page.css 484 B
release/woocommerce-payments/dist/plugins-page.js 2.64 kB
release/woocommerce-payments/dist/product-details-rtl.css 433 B
release/woocommerce-payments/dist/product-details.css 436 B
release/woocommerce-payments/dist/product-details.js 12.3 kB
release/woocommerce-payments/dist/settings-rtl.css 11.8 kB
release/woocommerce-payments/dist/settings.css 11.7 kB
release/woocommerce-payments/dist/settings.js 141 kB
release/woocommerce-payments/dist/subscription-edit-page.js 703 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal-rtl.css 527 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.css 527 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.js 1.98 kB
release/woocommerce-payments/dist/subscription-product-onboarding-toast.js 730 B
release/woocommerce-payments/dist/subscriptions-empty-state-rtl.css 120 B
release/woocommerce-payments/dist/subscriptions-empty-state.css 120 B
release/woocommerce-payments/dist/subscriptions-empty-state.js 1.9 kB
release/woocommerce-payments/dist/success.js 6.03 kB
release/woocommerce-payments/dist/tos-rtl.css 235 B
release/woocommerce-payments/dist/tos.css 235 B
release/woocommerce-payments/dist/tos.js 3 kB
release/woocommerce-payments/dist/woopay-direct-checkout.js 5.68 kB
release/woocommerce-payments/dist/woopay-express-button.js 22.8 kB
release/woocommerce-payments/dist/woopay-rtl.css 4.27 kB
release/woocommerce-payments/dist/woopay.css 4.25 kB
release/woocommerce-payments/dist/woopay.js 70.8 kB
release/woocommerce-payments/includes/subscriptions/assets/css/plugin-page.css 625 B
release/woocommerce-payments/includes/subscriptions/assets/js/plugin-page.js 814 B
release/woocommerce-payments/vendor/automattic/jetpack-assets/build/i18n-loader.js 2.46 kB
release/woocommerce-payments/vendor/automattic/jetpack-assets/build/jetpack-script-data.js 957 B
release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/i18n-loader.js 1.02 kB
release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/script-data.js 69 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/babel.config.js 163 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.css 2.47 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.js 14.3 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.rtl.css 2.47 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-connection.css 10.1 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-connection.js 29.7 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-connection.rtl.css 10.1 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.css 198 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.js 280 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.rtl.css 198 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.css 625 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.js 333 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.rtl.css 626 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-users.js 417 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-users-connection.js 161 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-ajax.js 521 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-callables.js 585 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-admin-create-user.css 215 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-admin-create-user.js 521 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.css 721 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.js 412 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-users.js 625 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/about.css 1.04 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-empty-state.css 294 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-order-statuses.css 408 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin.css 3.59 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/checkout.css 301 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/modal.css 746 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css 574 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/wcs-upgrade.css 414 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin-pointers.js 543 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin.js 9.4 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.js 6.78 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.min.js 3.84 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-coupon.js 545 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-subscription.js 2.52 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.js 22.2 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.min.js 11.7 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/payment-method-restrictions.js 1.29 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/wcs-meta-boxes-order.js 507 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/payment-methods.js 358 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/single-product.js 428 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/view-subscription.js 1.38 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/wcs-cart.js 782 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/modal.js 1.09 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/wcs-upgrade.js 1.26 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.css 391 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.js 3.04 kB

compressed-size-action

- Alipay: Disable multi-currency before tests (like Klarna does)
- Alipay: Use URL check for redirect instead of page text
- Pay for order: Handle both 'card was declined' and 'payment was not processed' errors
@mgascam mgascam marked this pull request as draft December 3, 2025 10:39
mgascam and others added 3 commits December 3, 2025 12:20
Alipay payments require specific Stripe account configuration that
is not available in the QIT test environment. The payment method can
be enabled in settings but checkout fails with 'Invalid or missing
payment details'.
The QIT devtools implementation uses WP-CLI to set options directly,
but the card testing protection feature relies on filters/hooks from
the Dev Tools plugin (option_wcpay_account_data, woocommerce_payments_account_refreshed)
that aren't available in the QIT environment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@mgascam mgascam requested a review from Copilot December 3, 2025 13:27
Copilot finished reviewing on behalf of mgascam December 3, 2025 13:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR completes the migration of shopper E2E specs to QIT by adding 8 test spec files covering My Account payment methods, multi-currency features, pay for order flows, and alternative payment methods (BNPLs, Klarna, Alipay).

  • Adds comprehensive test coverage for saved card management with rate limiting handling
  • Implements multi-currency checkout and widget tests with proper state restoration
  • Includes BNPL and alternative payment method tests with card testing protection variants
  • Documents known QIT environment limitations with skipped tests

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/qit/e2e/specs/woopayments/shopper/shopper-pay-for-order.spec.ts Tests pay for order flow with card testing protection variants (one skipped due to QIT limitations)
tests/qit/e2e/specs/woopayments/shopper/shopper-myaccount-saved-cards.spec.ts Comprehensive saved card tests including add/delete/default setting with 20s rate limiting
tests/qit/e2e/specs/woopayments/shopper/shopper-myaccount-payment-methods-add-fail.spec.ts Tests various card decline scenarios and payment method addition failures
tests/qit/e2e/specs/woopayments/shopper/shopper-multi-currency-widget.spec.ts Multi-currency widget display and currency switching across shop pages
tests/qit/e2e/specs/woopayments/shopper/multi-currency-checkout.spec.ts Multi-currency checkout with currency-specific payment methods (Bancontact)
tests/qit/e2e/specs/woopayments/shopper/shopper-bnpls-checkout.spec.ts BNPL checkout tests for Affirm and Afterpay with card testing protection variants
tests/qit/e2e/specs/woopayments/shopper/klarna-checkout-purchase.spec.ts Klarna payment method tests including product page messaging
tests/qit/e2e/specs/woopayments/shopper/alipay-checkout-purchase.spec.ts Alipay checkout tests (skipped - requires Stripe account configuration unavailable in QIT)
changelog/dev-qit-e2e-shopper-remaining-specs Standard changelog entry for development changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@mgascam mgascam marked this pull request as ready for review December 3, 2025 14:46
@mgascam mgascam requested a review from a team December 3, 2025 14:46
@mgascam
Copy link
Contributor Author

mgascam commented Dec 3, 2025

@rtio @dmvrtx pinging you because you reviewed previous PRs related to the QIT migration. As you can see, this one only includes the migration of the test files. This is the last step to have all the shopper specs migrated and move to the Testing Packages infrastructure (draft). 🙏

Copy link
Contributor

@dmvrtx dmvrtx left a comment

Choose a reason for hiding this comment

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

It's impressive to see the number of tests in the suite! I only noticed an interesting bit: some tests are marked with "X" while the suite still passes. Are those re-tried after failure?

Image

@mgascam
Copy link
Contributor Author

mgascam commented Dec 4, 2025

Are those re-tried after failure?

@dmvrtx Yes, that's the retry mechanism kicking in to avoid flakiness. I'd love to get to a state where the tests are not flaky but we are not there yet. Thanks for your review, this was a helpful change to facilitate moving to the testing packages infrastructure 🚀

@mgascam mgascam enabled auto-merge December 4, 2025 12:55
@mgascam mgascam added this pull request to the merge queue Dec 4, 2025
Merged via the queue into develop with commit 9356cd9 Dec 4, 2025
33 of 36 checks passed
@mgascam mgascam deleted the dev/qit-e2e-shopper-remaining-specs branch December 4, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants