Skip to content

Packs / game-dev-web-public

headless-game-qa

Smoke-test every level of a browser game headless (Chromium on SwiftShader): loads, no errors, non-blank frame, FPS sample and a screenshot per level, as a report

Install

logicpacks pack use game-dev-web-public/headless-game-qa
get_pack game-dev-web-public/headless-game-qa

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: local-chromiumhomelab-headless
  • Checks: 2 in outcome/checks.yaml
  • Code: level_sweep.py
  • Tools: python3, playwright-python, chromium

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Goal

One command that tells whether each level still loads and draws after a change, with screenshots to eyeball, runnable on a server without a GPU.

Steps

  1. Expose a ready flag in the game (window.__ready = true after the level is drawn) and a level selector in the URL (?level=N).
  2. Run python3 code/level_sweep.py <url-or-dir> --levels 1-14 --out out/qa: one Chromium page per level via tools/webgl_check.py, then out/qa/report.md.
  3. Run it on a headless server (we used a Linux box with Chromium + SwiftShader); expect a few fps there, so FPS is only a smoke signal.
  4. Fail the run (exit 1) if any level fails; attach the report to the change.

Edge cases

  • SwiftShader is slow: a big 3D level can take minutes; raise --timeout-ms.
  • Audio autoplay is blocked headless: don't wait on audio events.

Don'ts

  • Don't run Playwright WebKit on the Mac for this (it opened windows on the desktop for us). Chromium/Firefox headless only.
  • Don't treat 0 errors as gameplay-correct: playthroughs still need a human or scripted inputs.