-
Notifications
You must be signed in to change notification settings - Fork 210
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
Add ACH E2E tests #3931
Add ACH E2E tests #3931
Conversation
This reverts commit 71c6c49.
if [ "$CI" = "true" ]; then | ||
CWD="$CWD" E2E_ROOT="$E2E_ROOT" redirect_output docker compose -p wcstripe-e2e -f "$E2E_ROOT"/env/docker-compose.yml up --build --force-recreate -d | ||
else | ||
CWD="$CWD" E2E_ROOT="$E2E_ROOT" redirect_output docker compose -p wcstripe-e2e --env-file "$E2E_ROOT"/config/local.env -f "$E2E_ROOT"/env/docker-compose.yml up --build --force-recreate -d | ||
fi |
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.
Locally, the environment variables are defined in "$E2E_ROOT"/config/local.env
, but in CI they’re set in the workflow configuration. We need these variables to start the Stripe listener container.
await admin.togglePaymentMethod( | ||
browser, | ||
'ACH Direct Debit', | ||
true | ||
); |
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.
I decided not to disable ACH after the tests because another file (the shortcode tests) uses it. If one test disables the payment method in the middle of another test execution, it could cause issues. Since test environments aren’t intended to be reusable, this is acceptable.
@@ -20,6 +20,8 @@ setup( 'Disable legacy checkout experience', async ( { browser } ) => { | |||
await expect( | |||
page.getByTestId( 'legacy-checkout-experience-checkbox' ) | |||
).not.toBeChecked(); | |||
|
|||
await adminContext.close(); |
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.
If you run the tests in headed mode, these pages never closed. This fixes that issue.
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.
Overall LGTM. New tests passed. ✅
@rafaelzaleski All tests passed for me, except for customer can renew a subscription @smoke @subscriptions
. Did you experience the same?
Apparently something changed in the Link flow and it now requires a "First and last name" input.
I know this isn't part of the scope of this PR, but I just wanted to check given the opportunity.
Co-authored-by: Ricardo Metring <ricardometring@gmail.com>
@ricardo, I noticed this test failing a few times while working on the ACH tests, but it's working for me now: ![]() |
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.
LGTM and tested well. All tests passed in my last run:
✓ 1 [default-setup] › default.setup.js:7:6 › Disable legacy checkout experience (4.5s)
✓ 2 [default-setup] › default.setup.js:27:6 › enable Link (4.5s)
✓ 3 …rd-failures.spec.js:55:6 › customer cannot checkout with invalid cards @blocks › a card with insufficient funds shows the correct error message (15.2s)
✓ 4 …locks/card-failures.spec.js:51:6 › customer cannot checkout with invalid cards @blocks › a declined card shows the correct error message @smoke (16.6s)
✓ 5 …-failures.spec.js:67:6 › customer cannot checkout with invalid cards @blocks › a card with incorrect CVC shows the correct error message @smoke (17.4s)
✓ 6 …ks/card-failures.spec.js:59:6 › customer cannot checkout with invalid cards @blocks › a card with invalid number shows the correct error message (5.2s)
✓ 7 …ckout/blocks/card-failures.spec.js:63:6 › customer cannot checkout with invalid cards @blocks › an expired card shows the correct error message (16.1s)
✓ 8 …card-failures.spec.js:71:6 › customer cannot checkout with invalid cards @blocks › an error processing the card shows the correct error message (13.2s)
✓ 9 [default] › checkout/blocks/lpms/ach.spec.js:44:6 › ACH payment tests @blocks › customer can pay with ACH using valid bank details @smoke (25.3s)
✓ 10 [default] › checkout/blocks/lpms/ach.spec.js:56:6 › ACH payment tests @blocks › customer can save and reuse ACH payment method @smoke (36.8s)
✓ 11 [default] › checkout/blocks/normal-card.spec.js:12:5 › customer can checkout with a normal credit card @smoke @blocks (13.4s)
✓ 12 [default] › checkout/blocks/saved-card.spec.js:30:5 › customer can checkout with a saved card @smoke @blocks (30.6s)
✓ 13 [default] › checkout/blocks/sca-card.spec.js:12:5 › customer can checkout with a SCA card @smoke @blocks (21.6s)
✓ 14 [default] › checkout/blocks/subscription-product.spec.js:32:5 › customer can purchase a subscription product @smoke @blocks @subscriptions (17.6s)
✓ 15 …ut/shortcode/card-failures.spec.js:34:6 › customer cannot checkout with invalid cards › a declined card shows the correct error message @smoke (10.5s)
✓ 16 …code/card-failures.spec.js:38:6 › customer cannot checkout with invalid cards › a card with insufficient funds shows the correct error message (10.4s)
✓ 17 …shortcode/card-failures.spec.js:42:6 › customer cannot checkout with invalid cards › a card with invalid number shows the correct error message (4.9s)
✓ 18 … checkout/shortcode/card-failures.spec.js:46:6 › customer cannot checkout with invalid cards › an expired card shows the correct error message (10.6s)
✓ 19 …de/card-failures.spec.js:50:6 › customer cannot checkout with invalid cards › a card with incorrect CVC shows the correct error message @smoke (10.8s)
✓ 20 …rtcode/card-failures.spec.js:54:6 › customer cannot checkout with invalid cards › an error processing the card shows the correct error message (10.7s)
✓ 21 [default] › checkout/shortcode/lpms/ach.spec.js:44:6 › ACH payment tests @shortcode › customer can pay with ACH using valid bank details @smoke (23.7s)
✓ 22 [default] › checkout/shortcode/lpms/ach.spec.js:56:6 › ACH payment tests @shortcode › customer can save and reuse ACH payment method @smoke (37.9s)
✓ 23 [default] › checkout/shortcode/normal-card.spec.js:12:5 › customer can checkout with a normal credit card @smoke (12.2s)
✓ 24 [default] › checkout/shortcode/saved-card.spec.js:30:5 › customer can checkout with a saved card @smoke (28.2s)
✓ 25 [default] › checkout/shortcode/sca-card.spec.js:12:5 › customer can checkout with a SCA card @smoke (20.1s)
✓ 26 [default] › checkout/shortcode/subscription-product.spec.js:32:5 › customer can purchase a subscription product @smoke @subscriptions (16.9s)
✓ 27 [default] › express-checkout/express-checkout.spec.js:54:2 › customer can use Link express checkout › inside the product page (3.4s)
✓ 28 [default] › orders/full-refund.spec.js:13:5 › merchant can issue a full refund @smoke (31.9s)
✓ 29 [default] › express-checkout/express-checkout.spec.js:57:2 › customer can use Link express checkout › inside the cart page (classic) (4.1s)
✓ 30 [default] › subscriptions/subscription-renewal.spec.js:47:5 › customer can renew a subscription @smoke @subscriptions (29.7s)
✓ 31 [default] › express-checkout/express-checkout.spec.js:62:2 › customer can use Link express checkout › inside the checkout page (classic) (7.2s)
✓ 32 [default] › express-checkout/express-checkout.spec.js:67:2 › customer can use Link express checkout › inside the cart page (block) (4.3s)
✓ 33 [default] › express-checkout/express-checkout.spec.js:72:2 › customer can use Link express checkout › inside the checkout page (block) (5.9s)
======
- Trying to clear consumer token... Try:1
✔ Cleared up consumer token successfully.
======
Slow test file: [default] › orders/full-refund.spec.js (31.9s)
Slow test file: [default] › checkout/blocks/saved-card.spec.js (30.6s)
Slow test file: [default] › subscriptions/subscription-renewal.spec.js (29.7s)
Slow test file: [default] › checkout/shortcode/saved-card.spec.js (28.2s)
Slow test file: [default] › express-checkout/express-checkout.spec.js (24.8s)
Consider splitting slow test files to speed up parallel execution
33 passed (2.7m)
Closes #3749
Changes proposed in this Pull Request:
This PR introduces E2E tests for ACH payments, covering the following scenarios:
The tests are organized into two suites: one for Shortcode and another for Blocks checkout.
This PR also includes improvements to the E2E testing environment:
Testing instructions
npm run test:e2e
Changelog entry
Changelog Entry Comment
Comment
Post merge