# 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

- **Space:** game-dev-web-public (https://github.com/Tech-Realm/space-game-dev-web-public/tree/main/headless-game-qa)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3, playwright-python, chromium
- **Routes:** local-chromium, homelab-headless; checks: 2
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use game-dev-web-public/headless-game-qa` or MCP `get_pack game-dev-web-public/headless-game-qa`
- **Files:** CHANGELOG.md, code/level_sweep.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/game/index.html, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (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.



---

Canonical URL: https://logicpacks.io/packs/game-dev-web-public/headless-game-qa

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
