-
Notifications
You must be signed in to change notification settings - Fork 72
[E2E][QIT] Migrate remaining shopper specs #11177
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
Conversation
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.
Test the buildOption 1. Jetpack Beta
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:
Note: the build is updated when a new commit is pushed to this PR. |
|
Size Change: 0 B Total Size: 877 kB ℹ️ View Unchanged
|
- 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
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]>
There was a problem hiding this 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.
tests/qit/e2e/specs/woopayments/shopper/shopper-myaccount-payment-methods-add-fail.spec.ts
Outdated
Show resolved
Hide resolved
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
dmvrtx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 🚀 |

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
Multicurrency & Pay for Order
Alternative Payment Methods
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: truetest case is skipped inshopper-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.tsshopper-myaccount-saved-cards.spec.tsmulti-currency-checkout.spec.tsshopper-multi-currency-widget.spec.tsshopper-pay-for-order.spec.tsalipay-checkout-purchase.spec.tsklarna-checkout-purchase.spec.tsshopper-bnpls-checkout.spec.tsTesting
The site that QIT spins needs an onboarded account. Follow this steps to get the JetPack tokens:
tests/qit/config/local.envwith those values. You can usetests/qit/config/default.envas a templateE2E_JP_SITE_IDE2E_JP_BLOG_TOKENE2E_JP_USER_TOKENRun the tests
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