Add Stripe Connect (Payment Elements) E2E suite#3271
Conversation
Playwright E2E coverage for the Stripe Connect gateway revamp (Payment Elements + PaymentIntents/SetupIntents, separate charges & transfers, Block checkout, refunds, 3DS). - tests/e2e/stripe-connect/: admin pre-setup, vendor onboarding (+ DB-seeded connection), classic & block checkout, multi-vendor split with real Stripe transfer assertions, webhook-replay idempotency, refunds (full/partial/multi-vendor) + transfer reversals, 3DS/SCA. - utils/stripeApi.ts: Stripe test-API client for money-truth assertions (transfers/refunds/reversals). - utils/dbUtils.ts: seed/remove a Stripe-connected vendor, cart cleanup. - mu-plugins/dokan-stripe-connect-test-helpers.php: test-only REST route for Dokan API refunds. - utils/shard-durations.json: fold the new spec into the CI shard baseline. Stripe test keys are read from env (gitignored locally / GitHub Actions secrets in CI); none are committed.
|
Superseded by #3272. Branch renamed |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds a full Playwright E2E test suite for Dokan Stripe Connect. Introduces a PHP mu-plugin REST endpoint for test-triggered refunds, a Stripe REST API client utility, DB seed/teardown helpers, a ChangesStripe Connect E2E suite
Sequence Diagram(s)sequenceDiagram
rect rgba(100, 149, 237, 0.5)
Note over Spec,Stripe: Checkout + Transfer Verification
end
participant Spec as stripeConnect.spec.ts
participant StripeConnectPage as StripeConnectPage
participant WooCommerce as WooCommerce / Dokan
participant StripeAPI as stripeApi (api.stripe.com)
Spec->>StripeConnectPage: placeOrderClassic(card, product)
StripeConnectPage->>WooCommerce: POST /checkout, complete order
WooCommerce-->>StripeConnectPage: order received URL
StripeConnectPage-->>Spec: orderId
Spec->>WooCommerce: GET order meta (_stripe_intent_id, _stripe_charge_id)
WooCommerce-->>Spec: intentId, chargeId
Spec->>StripeAPI: transfersForChargeToVendor(chargeId, vendorAccount)
StripeAPI-->>Spec: transfers[] (assert count == 1)
rect rgba(144, 238, 144, 0.5)
Note over Spec,MuPlugin: Refund + Transfer Reversal
end
participant MuPlugin as PHP mu-plugin REST
Spec->>MuPlugin: POST /dokan-test/v1/refund (order_id, amount?)
MuPlugin-->>Spec: {ok, refund_amount}
Spec->>StripeAPI: getCharge(chargeId)
StripeAPI-->>Spec: charge.amount_refunded (assert match)
Spec->>StripeAPI: getTransfer(transferId)
StripeAPI-->>Spec: transfer.reversals.total_amount (assert match)
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Playwright E2E coverage for the Stripe Connect gateway revamp (Payment Elements + PaymentIntents/SetupIntents, separate charges & transfers, Block checkout, refunds, 3DS).
Stripe test keys are read from env (gitignored locally / GitHub Actions secrets in CI); none are committed.
All Submissions:
Changes proposed in this Pull Request:
Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
Changelog entry
Title
Detailed Description of the pull request. What was previous behaviour
and what will be changed in this PR.
Before Changes
Describe the issue before changes with screenshots(s).
After Changes
Describe the issue after changes with screenshot(s).
Feature Video (optional)
Link of detailed video if this PR is for a feature.
PR Self Review Checklist:
FOR PR REVIEWER ONLY:
Summary by CodeRabbit