Playwright E2E Tests: Signup, Stripe Checkout, Auth Flows

    by Nate Freed

    1

    Most Playwright suites test the easy pages and skip the flows that cost money when they break.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Playwright E2E Tests: Signup, Stripe Checkout, Auth Flows

    Example session with this skill installed

    We're launching paid plans next week (Next.js App Router, Stripe hosted Checkout, Prisma). Our Playwright suite only checks the pricing page and login. Add E2E tests for the flows that matter and tell me what's untested.

    • Read your context and instructions
    • Compiled the playwright e2e tests

    Critical-flow E2E: invoicely (Next.js, Stripe hosted Checkout)
    Before: 31 routes, 2 specs / 3 tests
    #1 Payment webhooks GAP: POST /api/webhooks/stripe. Checkout specs abort the redirect, so nothing checks the state a webhook sets
    #2 Signup GAP | #3 Account deletion GAP | #4 Password reset GAP | #5 Admin (page + API) GAP | #6 Email verification GAP | #7 Subscription mgmt GAP | #8 Onboarding GAP
    Checkout, Login: COVERED (page visits only)

    Lint before: 11 findings (high 2, medium 7, low 2)
    HIGH E2E011 app/api/dev/seed/route.ts: guarded only by NODE_ENV !== 'production' (open when NODE_ENV is unset), and it mints session tokens
    HIGH E2E013 app/api/dev/seed/route.ts:8: JWT signed with a fallback secret
    MED waitForTimeout(3000), nth-child selector, shared let token, a test email on a real domain, retries 3

    Done with your OK: replaced the seed route with a guarded test API (flag + not production + per-run token, 404 otherwise; test-domain accounts only; it mints no tokens). Added config, per-role storageState setup, makeUser/freshUser fixtures and 6 flow specs (26 tests; 4 hosted-Stripe tests are opt-in).
    Lint after: 0 findings. Flow map after: 9 of 10 flows COVERED.

    Not covered yet: subscription management (portal, cancel), proposed next. 30 ADAPT markers still need checking against your components.
    Next: npx playwright test e2e/specs/checkout.spec.ts (I'll start the dev server only once you say yes).

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Most Playwright suites test the easy pages and skip the flows that cost money when they break. This skill starts from the repo you already have. A static scan maps your routes (Next.js, React Router, Express, Hono, Fastify, Cloudflare Pages Functions) to your existing specs and prints a coverage table ranked by risk, so the untested checkout webhook or account deletion shows up first. Skipped or fixme tests, specs outside your testDir and visits to a remote staging URL do not count as coverage. A linter with 23 checks flags what makes critical tests blind or dangerous, with file:line and a fix for each: sleeps, committed .only, missing awaits, brittle selectors, shared state, tests with no assertions, live Stripe keys, real email domains, and seed routes that production can reach (including token-minting test routes and test flags left on in wrangler.toml). Then it builds the hard part, which is test data. You get a test-only seed and reset API that refuses to run unless an explicit flag, a non-production environment and a per-run token are all present, with no fallback secrets, plus Express, Next.js and Hono (Workers) adapters and a ready Prisma store. On top of that come per-role storageState sessions, a unique user per test with automatic cleanup, email links captured from an outbox, and state polling instead of sleeps. Six spec templates cover the flows. Stripe runs in test mode only: signed webhook tests run offline, and an optional hosted tier uses the published test cards, including 3-D Secure.

    Static heuristics: flow_map classifies routes by keywords and counts a flow as covered when a running spec hits one of its routes, which says nothing about assertion quality. It reads testDir but not testIgnore or testMatch, and only unconditional skips. Routers outside Next.js, React Router, Express, Hono, Fastify and Pages Functions (SvelteKit, Remix flat routes, Rails) are not mapped. lint_e2e reads source text, not types, so missing-await and shared-state findings must be confirmed at the line. Templates need adapting to each app's labels and data model (marked ADAPT). The Hono adapter was type-checked against Hono's API shape, not run. Hosted Stripe Checkout locators target markup Stripe controls and may need a one-file update. Offline webhook tests cannot satisfy handlers that re-fetch objects from the Stripe API.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 6 days ago

    Accounts
    Stripe0Microsoft
    Software
    Python 3.8+ (standard library only)A JS/TS web app repository@playwright/test to run the specsPlaywrightNode.jsprismaWrangler
    Optional
    Stripe test-mode keys (hosted tier)Stripe CLI, run by you (hosted tier)Chromium installed by Playwright

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Environment Variables
    Network Access

    Allowed Hosts

    localhost
    127.0.0.1
    checkout.stripe.com
    registry.npmjs.org
    cdn.playwright.dev
    playwright.download.prss.microsoft.com

    File Scopes

    The
    user's
    repo:
    read
    for
    mapping
    and
    linting;
    writes
    only
    test
    files
    config
    test-API
    the
    user
    approves
    A
    report
    folder
    outside
    repo
    (optional
    --output)

    Both scripts are offline and read-only, mask any key-like value they print, and do not open .env or key files. The one exception is lint_e2e --env-key-check, used only after the user agrees: it reports the variable name of a live Stripe key in .env files, never the value. Environment access is limited to checking STRIPE* values for live-key prefixes. Network: localhost and 127.0.0.1 for the app under test; checkout.stripe.com only in the opt-in hosted tier, in test mode; registry.npmjs.org and the Playwright browser CDN only if the user approves adding @playwright/test or downloading Chromium. The agent never runs Stripe CLI commands, pushes, enables CI or installs packages without an explicit yes.

    Listed6 days ago

    What's inside

    Creator

    N

    Nate Freed

    24 skills on Agensi

    Frequently Asked Questions

    The template fails closed. It mounts nothing unless E2E_TEST_API=1, NODE_ENV is not production (and no platform variable says production), and a 24+ character per-run token is set. Every request must present that token, otherwise it gets a 404. It only touches accounts on a reserved test domain, never mints session tokens and has no fallback secrets. lint_e2e checks the guard.

    No, not for the default tier. Specs sign Stripe-shaped webhook events with a per-run secret and post them to your own webhook route, then check stored state and the UI, all offline. The optional hosted tier uses your test-mode keys, Stripe's published test cards (4242, decline, 3-D Secure) and stripe listen, which you run yourself. Live keys stop the run.

    It doesn't triage flakes. It decides what must be tested: the signup, billing and account flows ranked by risk. Then it builds the test data layer those flows need (seeded users per role, unique users per test, email outbox, webhook signing) and writes the specs. The lint focuses on what makes those tests unsafe or unable to fail.

    Next.js app/ and pages/ routes (including the Auth.js catch-all), React Router (JSX and object routes, nested children), Express, Hono and Fastify routers with their mount prefixes, and Cloudflare Pages Functions file routes. Playwright specs are found from playwright.config testDir or their @playwright/test import. You can add your own flow keywords with --flows.

    Not by default. The agent never opens them, and both scripts skip them. If you agree, lint_e2e --env-key-check looks only for a live Stripe key prefix and reports the variable name, never the value. When you run the suite, the config template refuses to start if an env file next to it holds a live key.

    New in Security

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.