webeyes
Headless Playwright visual runner and GPU smoke tester for WebGL game builds.
Playwright-based visual QA runner that serves Unity WebGL or HTML5 builds locally, executes scripted input plans on real GPU rendering, and outputs screenshots, contact sheets, and frame heuristics.
git clone https://github.com/BestRoiMedia/game-senses.gitWhy we built it
Editor play mode does not catch compressed WebGL asset failures, shader compile errors, or pointer-lock freezes in shipped browser builds. We built webeyes so AI agents and CI can boot the actual shipped WebGL player, run deterministic input steps, and inspect real rendered frames.
Architecture & how it works
webeyes.mjs starts an embedded HTTP server with proper Brotli, gzip, and .unityweb Content-Encoding headers and hooks window.unityInstance on index.html. It launches Chromium via Playwright with ANGLE/Metal GPU flags, executes a JSON plan of wait, shot, send (SendMessage), click, key, mouse, and eval steps, and computes per-shot luminance, clipping, black-frame, and flat-tile heuristics alongside a contact sheet and JSON report.
Key capabilities
- Zero-config local static server supporting .br, .gz, and .unityweb compression headers
- Automatic window.unityInstance hooking for Unity SendMessage automation
- Scripted input plans with timed key holds, relative mouse moves, JS eval, and loops
- Per-screenshot image heuristics detecting ALL_BLACK, BLOWN_OUT, and FLAT_TILES
- Captures console logs, WebGL errors, and structured [eyes] telemetry lines
Usage example
node webeyes/webeyes.mjs --build ./Builds/WebGL --plan ./tools/eyes_plan.json --out ./Builds/eyes