# E2E setup instructions

> Sets up automated tests that catch bugs before you ship.

- **What it does:** Sets up a full automated testing checklist for your app that checks real user flows with video proof, so bugs get caught before every release instead of after.
- **Agents:** Claude Code and Codex (through orbit-connect), Claude and ChatGPT (through the Orbit connector)
- **Install:** `npx -y --loglevel=error orbit-connect@0.3.33 install skl_15fe2fb2cb2b8d4d115a59a1`
- **Creator:** Mariah Brunner (@itsmariahbrunner) on Instagram
- **Reach:** Creators' posts about it have 49,778 views
- **Safety:** Checked by Orbit: nothing risky found in what it runs or reads
- **Last updated:** 2026-11-14
- **Page:** https://orbitinbox.app/s/e2e-setup

## Skill

---
name: e2e-setup
description: Use when a repo has no or weak end-to-end tests: sets up a reliable e2e suite with real flows, auth helper, layered assertions and video/trace evidence.
---

# E2E Setup

## What this does
Sets up an end-to-end test suite that verifies the whole running system through the app (browser or API) and serves as the per-PR gate.

## When to use
Use when asked to "set up e2e", "add end-to-end tests" or "scaffold a test gate", or when a repo's e2e is missing or weak. It pairs with `dev-local-setup` (reproducible stack) and `verifier-setup` (the verify-then-ship loop).

## How to run it

### Where it lives
- Unit/integration tests stay inside each app or package.
- System e2e is a dedicated top-level package (e.g. `e2e/`), added to the workspace if a monorepo.

### The recipe
1. Stand the app up reproducibly (see `dev-local-setup`). The e2e suite never boots the app itself; it runs against an already-running stack, either local or an isolated cloud box (`crabbox-setup`). Use the cloud box for parallel agents.
2. Pick the framework (Playwright for browser; your HTTP client for API). Turn on video and trace. The recording is the proof and is gitignored output.
3. Explore the flow live first (don't guess selectors), then crystallize it into a committed spec.
4. Keep the gate small: a handful of deterministic critical journeys. Each new feature PR adds its spec, so the suite compounds.

### Practices that make e2e trustworthy
- **Real flow, not bypass.** For email codes/OTP, read the real code from a local mail server (Mailpit, Inbucket, MailHog). Never hardcode a fixed test code.
- **Verify auth itself once; bypass it elsewhere.** One signup/login spec proves auth. Every other spec loads a session from a helper that mints authed state once (real flow saved as storage state, or a service-role/token mint).
- **Layered assertions: client -> server -> product.** Confirm the UI changed, the server agrees (token validates, row/state is right), and the user-visible outcome (e.g. plan upgraded and credits granted).
- **Stable selectors.** Prefer role/label/text; add a small `data-testid` when there's no good handle. Never a brittle CSS path.
- **Fresh data per run.** Unique emails/ids; mind rate limits.
- **Commit specs and helpers, never `test-results/`.**

### When a test fails: triage before "fixing"
- Real bug: the product broke. Fix the code.
- Stale test: the flow intentionally changed. Update the test to the new contract.
- Flaky/env: stack down, timing, rate limit, stale data. Fix robustness or the environment.

Never weaken or delete an assertion just to go green. Loosen only when the intended contract changed, confirmed from the diff.

### External services (payments, email, third-party)
Use the vendor's test/sandbox mode, never live keys. Guard hard: the test must refuse to run if it detects a live key. If a webhook completes the flow, forward it locally (e.g. the vendor's CLI listener) so the real fulfilment path is exercised.

## Output
A top-level `e2e/` package with config (video + trace on), a session helper, a dedicated auth spec, a few critical-journey specs with layered assertions, and notes on running it against the local or cloud stack.

Credit: Based on public content by AI-Builder-Club, packaged by Orbit.

Shared by Mariah Brunner, credited on Orbit.