Move the e2e suites into the repo (tests/), out of /tmp

The browser harness lived in /tmp/opencode and an overnight reboot
wiped it. It now lives in tests/ and survives reboots, is versioned
and runs with one command.

- tests/lib.mjs: shared helpers (Chromium auto-detect, seeding,
  IndexedDB fixtures, stub/extra instance spawn with process-group
  cleanup, check/finish).
- tests/run-all.mjs + npm run test:e2e [filter]: runs the ten suites
  in order with a summary; suites that need a stub Ollama or VAPID
  keys start their own next start instance on 3208/3209, verify the
  port is free and kill the group on exit. Test scratch in
  tests/.tmp/ (gitignored).
- Suites rebuilt and green against the current build: regression 38,
  mobile 94 (tab matrix, ... sheet, settings sheet, axe), wizard 83,
  native 31 (PWA/offline/share/back/undo/haptics/draft), i18n 13,
  freeze-loading 6, review 15, phase1 36 (backup/sync/usage limits),
  phase2 42 (learning engine/reminders), phase3 21 (homework check).
  379 checks, 10/10 suites in one full run.
- playwright-core + axe-core added as devDependencies; CHROME env or
  the newest ~/.cache/ms-playwright chromium is used.
- README: new decision 45 documenting the harness; decision 44's
  verification note updated.

The older suites' exact sources were lost with the wipe, so the
rebuilt versions reconstruct the same feature areas rather than
being byte-identical.
This commit is contained in:
Martin Dvořák 2026-10-11 15:11:06 +00:00
commit dbd5dfbc58
17 changed files with 2280 additions and 8 deletions

View file

@ -1060,10 +1060,20 @@ Things I chose while building, with the reasoning:
per-key 30-second cache plus in-flight sharing (`use-health.ts`): every page mounts its own
gate and each probe can sit for seconds while Ollama answers, so a session now fires **one**
probe instead of one per navigation (verified). Also fixed a Czech typo on the exam heading
(“Zkouškové režim” → “Zkouškový režim”). Verified by the review-loading suite (15 checks:
stalled-request loading screen, session arrival after release, the normal fast path, the
mistakes path, end-to-end grading, and the probe cache) and the rebuilt navigation suite
(78 checks).
(“Zkouškové režim” → “Zkouškový režim”). Verified by the review suite (15 checks:
stalled-request loading screen at 58 ms, session arrival after release, the normal fast path,
the mistakes path, end-to-end grading, and the probe cache).
45. **The browser suites live in the repo, not in `/tmp`.** The harness was built over several
sessions in a scratch directory that a reboot wiped; it now lives in `tests/` and runs with
`npm run test:e2e` against the running production build (Playwright + axe-core as dev
dependencies, Chromium auto-detected or via `CHROME`). Ten suites cover the core app
(regression), the phone tab bar and sheets (mobile), the wizards (wizard), PWA/offline/share
(native), i18n, the freeze loading screen, Smart Review, and phases 1–3 (backup/sync/usage
limits, the learning engine, homework check/follow-ups). Suites that need a stub Ollama or
VAPID keys start their own `next start` instance on a spare port, verify the port is free and
kill the process group on exit; test scratch stays in `tests/.tmp/` (gitignored). 379 checks
across the ten suites.
36. **The mobile declutter pass reshapes, it doesn't fork.** Phones (≤639px) get a 3-step deck
flow and a 2-step homework flow that share the exact state and handlers with the desktop