test(e2e): add Paddle E2E helpers, config guard, and error-path test (WST-712)#918
test(e2e): add Paddle E2E helpers, config guard, and error-path test (WST-712)#918rogersole wants to merge 6 commits into
Conversation
30bc6de to
8dd502a
Compare
|
Verified locally against the real Paddle E2E project ( |
ee270ee to
04f1e89
Compare
6ea3f7f to
5043030
Compare
…(WST-712) - navigateToPaddleLandingUrl + forcePaddleCheckoutMode: forces inline or overlay presentation by rewriting inline_checkout_enabled in the real /checkout/start response, so one E2E project covers both modes deterministically regardless of the backend per-project flag. - Mode-aware frame locators (inline container scoped; overlay via paddle.com iframe src) and completePaddleCheckoutForm parameterized by FrameLocator so it serves both modes (field locators from #820, credit: @nicfix). - config-guard test: fails loudly on CI if VITE_RC_PADDLE_E2E_API_KEY is missing instead of letting the suite silently skip. - First test: error screen when checkout/start returns missing paddle billing params (mode-agnostic, CI-safe). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…T-712) Replaces the role-based field guesses with Paddle's own test ids (cardNumberInput, authenticationEmailInput, cardPaymentFormSubmitButton) and the fill order proven in rc-billing-checkout/src/e2e (country first, Andorra to avoid the postcode field; wait for logoutLinkTextCTA before submitting). Pins the overlay frame selector to iframe.paddle-frame/iframe[name='paddle_frame']. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…n (WST-712) Verified against the real Paddle E2E project: this checkout has no logoutLinkTextCTA and renders the submit as 'Subscribe now', and the error screen shows 'An unknown error occurred' rather than the Stripe flow's 'Purchase not started' copy. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Paddle authenticates the filled email asynchronously and silently swallows submit clicks that land mid-authentication (observed against the sandbox). Blur the email field and re-click submit until the form transitions away. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ec46405 to
be9518d
Compare
|
Superseded by #925, which now targets |
Summary
Stacked on #917. Form-fill knowledge ported from #820 (credit @nicfix) and from rc-billing-checkout's proven Paddle E2E suite, then corrected against live sandbox runs.
src/tests/paddle/test-helpers.tsforcePaddleCheckoutMode(page, "inline" | "overlay"): rewritespaddle_billing_params.inline_checkout_enabledin the real/checkout/startresponse, so one E2E project deterministically covers both presentation modes regardless of the backend per-project flag (WST-700). Assertspaddle_billing_paramsis present so backend shape drift fails loudly.[data-testid='paddle-inline-checkout-container'] iframe; overlayiframe.paddle-frame, iframe[name='paddle_frame'].completePaddleCheckoutForm(frame, ...)parameterized byFrameLocatorso it serves both modes. Uses Paddle's own test ids (cardNumberInput,authenticationEmailInput), Andorra to skip the postcode field, and a submit re-click loop — Paddle authenticates the filled email asynchronously and silently swallows submits that land mid-authentication.paddle_e2e_test(real identifier from the Paddle E2E project).config-guard.test.ts: fails loudly on CI ifVITE_RC_PADDLE_E2E_API_KEYis missing, instead of the suite silently skipping.purchase-flow.test.ts: error path —checkout/startreturningpaddle_billing_params: null→ error screen ('Something went wrong' + 'An unknown error occurred', the Paddle flow's copy).Part of WST-564 (subtask WST-712).
Test plan
tsc --noEmit, eslint, prettier cleanE2E_RC_PADDLE_E2E_API_KEYconfigured in CircleCI (WST-708 done)🤖 Generated with Claude Code
Note
Low Risk
Test-only additions in the demo example; no production billing or auth logic changes.
Overview
Adds Paddle Playwright E2E scaffolding under
examples/webbilling-demo/src/tests/paddle/, reusing shared integration helpers and thepaddle_e2e_testoffering.test-helpers.tsintroduces Paddle-specific navigation (navigateToPaddleLandingUrl), timeouts, sandbox card/country constants, inline vs overlay iframe locators,forcePaddleCheckoutMode(rewritesinline_checkout_enabledon real/checkout/startresponses with an assertion ifpaddle_billing_paramsis missing),completePaddleCheckoutForm(shared frame-based fill/submit with email-auth re-click), and visibility helpers for inline checkout, processing, and sandbox banner.config-guard.test.tsfails on CI whenVITE_RC_PADDLE_E2E_API_KEYis unset so the suite cannot skip silently while CI stays green.purchase-flow.test.tsadds a Paddle flow describe (Chromium-only on CI, rate-limit sleep between tests) with one test that stubspaddle_billing_params: nullon checkout/start and asserts "Something went wrong" and "An unknown error occurred" (Paddle-specific copy vs Stripe).Reviewed by Cursor Bugbot for commit be9518d. Bugbot is set up for automated code reviews on this repo. Configure here.