From 0dcd1ab8d47a23e4f49059417937efec5f9d1b80 Mon Sep 17 00:00:00 2001 From: Ken Yasue Date: Thu, 2 Jul 2026 12:29:06 +0200 Subject: [PATCH] Add E2E Testing (Playwright) section to README Co-Authored-By: Claude Fable 5 --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 48849b0..048eed2 100644 --- a/README.md +++ b/README.md @@ -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 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 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.