Prune the unit and e2e suites to what protects security, user data, public contracts and past regressions. Drop what slowed development without catching bugs: markup and label assertions, wrappers that only proved Base UI works, copied inventories and snapshots, mock call-shape checks, permutation matrices across templates, fonts and locales, and env-gated suites that never ran in CI. - Unit: 4749 tests in 421 files become 1212 in 227. PDF tests that rendered or rasterized every template, font and locale combination go; one render per template stays and now checks that every visible section reaches a page, which a blank page used to pass. - E2E: 55 tests in 35 specs become 11 in 9, one journey per severe area: sign-up and sign-in, autosave, a failed save during navigation, JSON export and import, public and password-protected sharing, slug redirects, OAuth consent for MCP clients, and the assistant. - Tests a coverage review found to be the only guard of a contract were kept or restored, each checked by breaking the code it guards. - Remove exports, tooling and dev dependencies that only the pruned tests used. - The Semantic CSS guide check now reads indented code fences, so the guide example it skipped is compiled too.
2.0 KiB
E2E Tests
Reactive Resume uses Playwright for PR-gated browser coverage of deterministic core flows.
Local setup
Start PostgreSQL:
sudo docker compose -f compose.dev.yml up -d postgres
Generate local test secrets:
export AUTH_SECRET=$(openssl rand -hex 32)
export ENCRYPTION_SECRET=$(openssl rand -hex 32)
Run database migrations:
APP_URL=http://localhost:3000 PORT=3000 DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres FLAG_DISABLE_SIGNUPS=false FLAG_DISABLE_EMAIL_AUTH=false FLAG_DISABLE_API_RATE_LIMIT=true LOCAL_STORAGE_PATH=/workspace/data/e2e pnpm db:migrate
Build the production app:
APP_URL=http://localhost:3000 PORT=3000 DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres FLAG_DISABLE_SIGNUPS=false FLAG_DISABLE_EMAIL_AUTH=false FLAG_DISABLE_API_RATE_LIMIT=true LOCAL_STORAGE_PATH=/workspace/data/e2e pnpm build
Run tests:
APP_URL=http://localhost:3000 PORT=3000 DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres FLAG_DISABLE_SIGNUPS=false FLAG_DISABLE_EMAIL_AUTH=false FLAG_DISABLE_API_RATE_LIMIT=true FLAG_ALLOW_UNSAFE_AI_BASE_URL=true LOCAL_STORAGE_PATH=/workspace/data/e2e pnpm test:e2e
Coverage
- Email/password sign-up, sign-out and sign-in through the UI.
- Builder section editing, with autosave across reloads and a draft kept when saving during navigation fails.
- JSON export/import through the New dialog, including an older file whose resume still carries a cover letter.
- Public sharing: an anonymous visitor's PDF download and statistics, a renamed address that keeps redirecting, and a password-protected link.
- OAuth consent for MCP clients: deny, allow with PKCE, and the access token's audience at
/mcp. - The assistant, against a scripted OpenAI-compatible provider (
fixtures/ai-stub.ts). It needsFLAG_ALLOW_UNSAFE_AI_BASE_URL=trueso the server may call the stub on 127.0.0.1, and skips without it.
Visual regression, PDF/DOCX rasterization parity, thumbnail resolution, and import-fixture reproduction are intentionally outside the PR gate to keep it fast.