Skip to content

test(e2e): add Paddle cancel/close coverage for inline and overlay (WST-713)#919

Closed
rogersole wants to merge 2 commits into
roger/wst-712-paddle-e2e-helpersfrom
roger/wst-713-paddle-e2e-cancel-flows
Closed

test(e2e): add Paddle cancel/close coverage for inline and overlay (WST-713)#919
rogersole wants to merge 2 commits into
roger/wst-712-paddle-e2e-helpersfrom
roger/wst-713-paddle-e2e-cancel-flows

Conversation

@rogersole

@rogersole rogersole commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #918. The WST-564 failure/edge-path requirement — fully CI-safe since no payment is ever completed.

  • Inline cancel: forced-inline checkout → click the RC return button (data-testid=paddle-return-button) → checkout unmounts, demo stays on the paywall, no /success navigation. Covers handleInlineClosePaddle.Checkout.close().
  • Overlay cancel: forced-overlay checkout → click Paddle's own close control — a 'Return to {seller}' button inside the overlay frame (selector verified against the sandbox) → user-initiated checkout.closed → SDK maps it to a user-cancelled error, paywall interactive again. Covers the user-initiated-close branch in paddle-service.ts.

Part of WST-564 (subtask WST-713).

Test plan

  • tsc --noEmit, eslint, prettier clean
  • Verified locally against the sandbox: both cancel flows green on 3 consecutive runs (~3–5s each)
  • CI green (these tests always run on CI)

🤖 Generated with Claude Code


Note

Low Risk
Test-only changes in the demo app; no production billing or SDK behavior is modified.

Overview
Adds CI-safe Paddle E2E coverage for checkout cancel/close paths (no completed payments), extending the webbilling-demo Paddle suite.

A new cancel-flow.test.ts suite exercises inline mode (forced via forcePaddleCheckoutMode) by opening checkout, clicking the demo paddle-return-button, and asserting the inline container unmounts, package cards remain, and the URL never hits /success/. It also covers overlay mode by opening checkout in the Paddle iframe, clicking Paddle’s “Return to …” close control via a new helper, and asserting the overlay iframe disappears with the same paywall expectations. Shared setup matches other Paddle tests (Chromium-only on CI, API key gate, post-test rate-limit sleep).

test-helpers.ts adds getPaddleOverlayCloseButton (getByRole("button", { name: /^return to/i }) inside the overlay frame) for the overlay cancel scenario.

Reviewed by Cursor Bugbot for commit 441db18. Bugbot is set up for automated code reviews on this repo. Configure here.

@rogersole rogersole force-pushed the roger/wst-712-paddle-e2e-helpers branch from 30bc6de to 8dd502a Compare June 10, 2026 14:28
@rogersole rogersole force-pushed the roger/wst-713-paddle-e2e-cancel-flows branch 4 times, most recently from f6a20cd to 9e25cc2 Compare June 10, 2026 16:06
@rogersole rogersole marked this pull request as ready for review June 10, 2026 16:10
@rogersole

Copy link
Copy Markdown
Contributor Author

Verified locally against the sandbox: both cancel flows green on 3 consecutive runs (~3-5s each). Selectors pinned from live runs: overlay frame iframe.paddle-frame, iframe[name='paddle_frame'] (matches rc-billing-checkout's proven selector) and Paddle's overlay close control is a 'Return to {seller}' button inside the frame.

@rogersole rogersole force-pushed the roger/wst-712-paddle-e2e-helpers branch from 6ea3f7f to 5043030 Compare June 11, 2026 06:04
@rogersole rogersole force-pushed the roger/wst-713-paddle-e2e-cancel-flows branch 2 times, most recently from 28e8661 to 80f0169 Compare June 11, 2026 07:55
@rogersole rogersole force-pushed the roger/wst-712-paddle-e2e-helpers branch from ec46405 to be9518d Compare June 12, 2026 13:01
@rogersole rogersole force-pushed the roger/wst-713-paddle-e2e-cancel-flows branch from 80f0169 to 6738fa0 Compare June 12, 2026 13:01
rogersole and others added 2 commits June 12, 2026 15:02
…ST-713)

- Inline: open forced-inline checkout, click the RC return button
  (data-testid=paddle-return-button), assert the checkout unmounts and
  the demo stays on the paywall (no /success navigation).
- Overlay: open forced-overlay checkout, close via Paddle's own control
  (fires a user-initiated checkout.closed), assert the overlay iframe
  is gone and the paywall is interactive again.

Neither test completes a payment, so both always run on CI regardless
of the datacenter-IP completion spike (WST-709).

Overlay iframe/close-control selectors carry TODO(WST-713) markers to
be pinned during headed verification against the sandbox.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…T-713)

Paddle's overlay close affordance is a 'Return to {seller}' button
inside the overlay frame, not an X/close control.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rogersole rogersole force-pushed the roger/wst-713-paddle-e2e-cancel-flows branch from 6738fa0 to 441db18 Compare June 12, 2026 13:03
@rogersole rogersole deleted the branch roger/wst-712-paddle-e2e-helpers June 12, 2026 13:23
@rogersole rogersole closed this Jun 12, 2026
@rogersole rogersole deleted the roger/wst-713-paddle-e2e-cancel-flows branch June 12, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant