feat(e2e): add Playwright browser test suite for web routes
Build and Deploy / build-and-push (push) Successful in 1m6s
Web E2E / web-e2e (push) Successful in 4m40s

solitaire_server/e2e/:
- smoke.spec.js: verifies /play-classic loads, exposes window.__FERROUS_DEBUG__
  bridge, keyboard parity (Space=draw, U=undo), debug failure report, and
  replay payload builder exports schema-v2 moves.
- gameplay_review.spec.js: HUD/controls render check, stock-click + undo
  player flow, draw-mode toggle, autonomous play invariant batch, and
  cycle-detection regression guard.
- cycle_metrics.js: headless cycle-rate analysis tool; run via
  `npm run review:cycles` with configurable policy, game count, and
  thresholds. Regression gate baked into package.json scripts.
- playwright.config.js: targets the local server at http://localhost:8080.
- package.json / package-lock.json: @playwright/test 1.60.0.

.gitea/workflows/web-e2e.yml:
- Runs on pushes to solitaire_server/, solitaire_wasm/, solitaire_core/,
  or Cargo changes. Starts the server binary, waits for /health, runs
  the full Playwright suite, uploads test-results/ on failure.

docs/testing-architecture.md: documents the three-tier test strategy
  (unit → Playwright smoke → cycle regression) and the __FERROUS_DEBUG__
  bridge contract.

scripts/update_quaternions_deps.sh: helper to bump the Quaternions
  registry deps (klondike, card_game) by version and run the full
  safety gate including deterministic replay checks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-02 12:40:30 -07:00
parent 763fdb486f
commit d45b7cb82b
9 changed files with 887 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
{
"name": "ferrous-solitaire-web-e2e",
"private": true,
"version": "0.1.0",
"description": "Playwright browser e2e harness for Ferrous Solitaire web routes",
"scripts": {
"test": "playwright test",
"test:headed": "playwright test --headed",
"test:debug": "playwright test --debug",
"review:cycles": "node scripts/cycle_metrics.js",
"review:cycles:regression": "node scripts/cycle_metrics.js --games 240 --steps 350 --policy baseline --max-visits 1 --max-cycle-rate-all 86 --max-cycle-rate-draw1 76 --max-cycle-rate-draw3 95 --min-win-rate-all 14 --require-zero-issues --out test-results/cycle-regression.json",
"review:cycles:candidate": "node scripts/cycle_metrics.js --games 240 --steps 350 --policy loop_aware --max-visits 2 --max-cycle-rate-all 45 --max-cycle-rate-draw1 25 --max-cycle-rate-draw3 60 --max-step-budget-rate-all 60 --min-win-rate-all 18 --require-zero-issues --out test-results/cycle-candidate.json"
},
"devDependencies": {
"@playwright/test": "^1.54.2"
}
}