Add E2E Testing (Playwright) section to README
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
39
README.md
39
README.md
@ -95,6 +95,7 @@ in sync with the code.
|
|||||||
- [Configuration Overview](#configuration-overview)
|
- [Configuration Overview](#configuration-overview)
|
||||||
- [Usage Workflow](#usage-workflow)
|
- [Usage Workflow](#usage-workflow)
|
||||||
- [Design & App Generation](#design--app-generation)
|
- [Design & App Generation](#design--app-generation)
|
||||||
|
- [E2E Testing (Playwright)](#e2e-testing-playwright)
|
||||||
- [Commands Reference](#commands-reference)
|
- [Commands Reference](#commands-reference)
|
||||||
- [Skills Reference](#skills-reference)
|
- [Skills Reference](#skills-reference)
|
||||||
- [Agents Reference](#agents-reference)
|
- [Agents Reference](#agents-reference)
|
||||||
@ -440,6 +441,44 @@ See [`docs/design/README.md`](docs/design/README.md) for the full structure.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Commands Reference
|
## Commands Reference
|
||||||
|
|
||||||
| Command | Description | Example |
|
| Command | Description | Example |
|
||||||
|
|||||||
Reference in New Issue
Block a user