/test — Test Planning + E2E
Usage
/test # full test phase
/test --plan-only # just generate test plan + cases
/test --e2e-only # just generate Playwright tests
Prerequisites
specs/stories/must exist- Source code in
backend/andfrontend/must exist (run/implementfirst) - Docker Compose stack must be deployable (run
/deployfirst for E2E)
Steps
- Read
.claude/skills/testing/SKILL.mdfor test patterns. - Read
.claude/skills/testing/references/playwright.mdfor Playwright patterns. - Spawn
test-engineeragent. - Agent generates to
specs/test_artefacts/:test-plan.md— strategy, scope, environmentstest-cases.md— all cases mapped to acceptance criteriatest-data/— realistic fixtures (JSON/PDF)e2e/flows/— Playwright test files
- Copy Playwright config template:
cp .claude/skills/testing/templates/playwright.config.ts playwright.config.ts - Install Playwright browsers:
npx playwright install --with-deps chromium - Verify Docker stack is healthy before E2E:
docker compose up -d --build curl --retry 5 --retry-delay 3 http://localhost:8000/health curl --retry 5 --retry-delay 3 http://localhost:3000 - Run Playwright:
npx playwright test - Generate report:
npx playwright show-report
Verification
uv run pytest -x -q # unit tests still pass
npm test # vitest still passes
npx playwright test # E2E tests pass
npx playwright show-report # visual report
Gotchas
- Test cases not mapped to acceptance criteria. Every test case must reference a story ID and criterion. Unmapped tests are either missing coverage or testing nothing useful.
- Playwright selectors using CSS classes. Use
getByRole(),getByLabel(),getByText()— never CSS selectors or XPath. Class names change; roles don't. - Flaky waits. Never
page.waitForTimeout(5000). Useexpect(locator).toBeVisible()orpage.waitForResponse()for deterministic waits. - E2E tests without Docker. Playwright config must use
webServerto start Docker Compose. Tests that assume services are already running will fail in CI. - Missing test data fixtures. Use realistic data (real names, valid amounts) — not "test", "foo", "123".