0065. Game pages e2e: a guarded seed, their own quality and visual specs
Source:
docs/decisions/0065-game-pages-e2e-and-visual-baselines.md. Generated at build time; edit the source file.
Date: 2026-11-22. Status: accepted (M5a Task 13). Builds on 0046 (read model and access) and ADR-WEB-2 (web dev stack).
Context
Section titled “Context”Task 13 adds the end-to-end checks for /app, /app/games and /app/games/<id>. Its brief assumes M4 Task 28 has landed (quality.spec.ts, visual.spec.ts, __screenshots__/), but Task 28 is not on m5a/base. The e2e stack must also never write to the owner’s games if the default compose project is up by mistake.
Decision
Section titled “Decision”-
A guarded seed.
e2e/helpers/seed-games.tsexportsseedE2eGames({ db?, email? }). Before any write it throwsRefusing to seed: this database holds real accountsif anylinked_accounts.usernamedoes not start withe2e-orfake, on top of the seed helpers’ own*_testand no-real-accounts checks. The other e2e seeds’ accounts are renamede2e-…to pass it. The default URL ischess_e2e_teston host port 55432, not the brief’schess: the e2e web service readschess_e2e_test, andassertSafeTestDatabaserefuses a name without_test. It is idempotent (fixedplatform_game_ids), because several specs seed. -
The refusal test uses a synthetic name, not the owner’s handle the brief names: the owner’s handle is never committed.
-
Own spec files. The quality loop and the baselines for the game pages live in
game-pages-quality.spec.tsandgame-pages-visual.spec.ts, so Task 28’squality.spec.tsandvisual.spec.tsmerge without an add/add conflict. Task 28 may fold them in. -
Snapshot path.
snapshotPathTemplateise2e/__screenshots__/<spec>/<name>-<project>.png, the directory the M4 plan names. Baselines are made only in the Linuxqacontainer. -
No axe yet.
@axe-core/playwrightis Task 28’s dependency and is not installed; the game-pages quality loop checks sideways overflow at 360 px, a visible focus outline on every tab stop up to the page’s content, and noNaN,Infinity,undefinedornullin the visible text. Task 28 adds axe to the loop. -
Labels as shipped. The brief’s “Show engine move” switch was renamed in Task 10’s fix round to “Show the engine’s next move”; the e2e uses the shipped label.
-
The trend’s keyboard budget is measured on a production build only. At 4× CPU throttle it measures key to paint (two animation frames after the keydown) against the same wait with no key; the key’s cost must fit in one 16 ms frame.
next devruns React’s development build, so the test skips withoutE2E_PRODUCTION=1. Enforcing it on every change needs a production-build e2e lane in CI; that lane is parked for the CI and launch work (ruling on review-t13 I2), and until then the number is measured by hand and recorded in the task report. -
Projects own their specs. The visual projects match only
visual.spec.tsandgame-pages-visual.spec.ts; thee2eproject ignores them. A plainplaywright testruns each spec where it belongs.
Consequences
Section titled “Consequences”- If the owner’s database is ever the target, the seed refuses before writing; a test pins it.
- Task 28 has two spec files to merge or keep, and adds axe to the game pages.