skillhub/web/e2e/auto-generated/README.md
huishi3 5206ffa4e0 docs(cli): add e2e test placement decision tree and output conventions
Three docs that answer "where should my new test go?" for CLI-related e2e:

- cli/test/e2e/README.md: decision tree across 5 test tracks, Track B
  boundary, env var setup (SKILLHUB_E2E_*), new-test checklist, CI status
- web/e2e/auto-generated/README.md: marks directory as pipeline output,
  naming convention, boundary with hand-written specs
- e2e-automation/README.md: output location convention, module subdirectory
  layout, boundary clarification (pipeline only produces browser-subject specs)
2026-05-08 03:54:24 -07:00

49 lines
1.5 KiB
Markdown

# Auto-Generated E2E Tests
This directory contains Playwright specs **generated by the `e2e-automation/` pipeline**.
Do not hand-edit files here -- they will be overwritten on the next pipeline run.
## Naming Convention
```
auto-generated/
<module>/
TC-<MODULE>-NNN.spec.ts
pages/
<module>/
<name>.page.ts
```
Example: `cli-auth/TC-CLIAUTH-001.spec.ts` tests the browser-side CLI OAuth
token flow. Its Page Object lives at `pages/cli-auth/cli-auth.page.ts`.
## What belongs here vs elsewhere
- **Here**: specs whose primary subject is a **browser page** (DOM interactions,
navigation, URL assertions). The pipeline generates these from PRD or
code-archaeology input.
- **`cli/test/e2e/`**: specs that spawn the CLI as a **subprocess** and assert
against stdout/stderr/exitCode with a real backend. See the decision tree in
`cli/test/e2e/README.md`.
- **`web/e2e/cross-stack-*.spec.ts`**: specs that combine CLI subprocess calls
with Playwright browser assertions (both sides in one test).
- **`web/e2e/*.spec.ts`** (top-level, hand-written): business-critical paths
maintained by hand. Auto-generated specs supplement coverage, they don't
replace hand-written ones.
## Regenerating
```bash
cd e2e-automation
bun run pipeline -- --requirement <prd-or-code-path>
# Output lands here automatically (configured in config/default.yaml)
```
See `e2e-automation/README.md` for full pipeline docs and output conventions.
## Running
```bash
cd web
pnpm exec playwright test e2e/auto-generated/
```