Visual and scenario testing guide for BlastSimulator2026: taking screenshots, running Puppeteer scenario tests, inspecting state dumps, UI diagnostics, and before/after verification. Use when working on rendering, UI, or any visual feature.
Use the one-command wrapper to start the server and capture a screenshot:
bash scripts/visual-test.sh --name "terrain" --commands "new_game mine_type:desert seed:42"
Or, if the dev server is already running:
npx tsx scripts/screenshot.ts --name "after-blast" --commands "new_game seed:1; blast 3,5"
Multiple commands separated by ;. Screenshots saved to screenshots/.
# Using inline commands
npx tsx scripts/scenario-test.ts --name blast-test \
--commands "new_game seed:42; drill_plan grid rows:2 cols:3 spacing:4 depth:6 start:15,15; charge hole:* explosive:boomite amount:5 stemming:2; sequence auto; blast"
# Using a scenario definition file
npx tsx scripts/scenario-test.ts --scenario blast-basic
Output per step:
step-NN-command.png — screenshot after the commandstep-NN-command.json — game state + UI state + command outputreport.json — summary of all stepsScenario definitions live in scripts/scenario-defs/*.json.
| Scenario | Description |
|---|---|
blast-basic | Full blast pipeline |
level1-win-efficient | Complete level 1 winning run |
level1-win-conservative | Conservative strategy win |
level1-lose-bankruptcy | Game over via bankruptcy |
level1-lose-arrest | Game over via criminal charges |
level1-lose-ecology | Game over via environmental collapse |
level1-lose-revolt | Game over via worker revolt |
The browser entry point exposes:
window.__gameState() — serialized game statewindow.__uiState() — panel visibility, button states, pointer-eventsnpx tsx scripts/ui-diagnostic.ts
Opens blast panel via Puppeteer click, tests all buttons, reports computed styles.
PUPPETEER_EXECUTABLE_PATH may vary. For agent sandbox: /usr/bin/chromiumnpm run dev &PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium npx tsx scripts/scenario-test.ts --scenario blast-basic
For each rendering task, check:
Headless Chrome has no GPU. Expect:
When fixing a visual issue:
--name "before-fix-ISSUE" before your change--name "after-fix-ISSUE" after your changeNever mark a rendering task complete unless:
npm run validate passes