Test & verify
testRun scripted gameplay scenarios, lint projects, execute GUT/gdUnit4 suites, and compare screenshot baselines to verify Godot games and catch regressions.
Instructions
Verify the game works. Scenarios are scripted playtests (play → input → wait → assert → screenshot) that you can save under res://tests/scenarios and re-run as regression tests. Also project lint (broken references, missing shapes/textures, script errors), GUT/gdUnit4 unit tests, and screenshot baselines.
Actions:
scenario: {scenario: {name?, scene?, steps: [...], keep_running?, stop_on_failure?=true, mute?=true}, save_as?: 'name'} run a playtest (audio muted unless mute=false). Steps: {wait_for: expr} {wait_node: path} {wait_signal: {path, signal}} {wait: s} {input: [input steps]} {assert: expr, message?} {expect_node: path} {expect_no_node: path} {eval: expr} {call: {path, method, args}} {set: {path, props}} {sample: {...}} {screenshot: label} {compare_baseline: 'res://tests/baselines/x.png'} {assert_no_errors: true} {time_scale: n}. Expressions run with the scene root as self.
run_all: {} run every saved scenario in res://tests/scenarios.
list: {} saved scenarios and detected unit test frameworks.
lint: {path?} check all scenes (missing dependencies, broken refs, missing collision shapes/textures) and all scripts (compile errors). Run before playing.
unit: {framework?: 'gut'|'gdunit4', dir?='res://test', filter?} run unit tests headless.
compare_image: {image_path | image_b64, baseline, threshold?=0.01, update?} compare against a baseline PNG (records it if missing).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | Test directory. | |
| name | No | Saved scenario name (res://tests/scenarios/<name>.json). | |
| action | Yes | What to do. See the tool description for each action's parameters. | |
| save_as | No | Also save the scenario under this name. | |
| baseline | No | Baseline PNG path. | |
| scenario | No | Scenario object {name?, scene?, steps: [...]}. | |
| framework | No | 'gut' or 'gdunit4'. |