Add E2E Testing (Playwright) section to README

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 12:29:06 +02:00
parent 1b67d1f15e
commit 0dcd1ab8d4

View File

@ -81,6 +81,42 @@ A fully autonomous loop, one feature per run. Each run:
test/lint/typecheck and the Playwright E2E suite succeed, and the persistent documents are back test/lint/typecheck and the Playwright E2E suite succeed, and the persistent documents are back
in sync with the code. in sync with the code.
## E2E Testing (Playwright)
Every verification step in this boilerplate includes end-to-end tests. The standard verification
sequence — used by `/add-feature`, `/execute-milestones`, and `/generate-app` — is:
```bash
npm test # unit tests
npm run lint
npm run typecheck
npm run test:e2e # Playwright E2E
```
How it works (defined in the `e2e-testing` skill):
- **Setup is automatic**: on the first verification, if Playwright is missing, the agent installs
`@playwright/test`, creates `playwright.config.ts` (dev-server integration, trace/screenshot on
failure), and adds the `test:e2e` script.
- **Tests are derived from acceptance criteria**: each feature gets `e2e/[feature].spec.ts` with
one test per acceptance criterion, written before verification runs.
- **The app shell has a smoke spec**: `/generate-app` creates `e2e/app-shell.spec.ts`, which
checks that the shell renders and every route in `ui-blueprint.json` navigates.
- **Blueprint-driven locators**: tests navigate by the blueprint's routes and use semantic
locators (`getByRole`, `getByLabel`) — no CSS/XPath tied to implementation details, no fixed waits.
- **No green-washing**: a failing E2E test is fixed, never skipped or deleted; milestone gates in
`/execute-milestones` do not pass without a green E2E suite.
```
e2e/
├── app-shell.spec.ts # smoke: shell renders, all blueprint routes navigate
├── [feature-name].spec.ts # one spec per feature (acceptance criteria)
└── helpers/ # shared fixtures (only when duplicated 3+ times)
```
Playwright covers the `web` target; for `flutter` the equivalent is `integration_test`, and for
`winui3` the platform's UI automation — with the same acceptance-criteria mapping.
## Notes ## Notes
The content of this repository may be changed to improve prompt performance based on feedback from readers. Differences will be reflected in the book as needed, but please be aware that there may be discrepancies with the edition you have on hand. The content of this repository may be changed to improve prompt performance based on feedback from readers. Differences will be reflected in the book as needed, but please be aware that there may be discrepancies with the edition you have on hand.