Keep and run scenario tests
godot_scenarioSave, list, and run deterministic headless regression scenarios that replay a scene with an input timeline and verify claims about the game state, so fixes stay protected from future breakage.
Instructions
Scenarios are regression tests kept in the project (.godotwright/scenarios/.json) that godotwright ci runs: a scene, an input timeline and claims about what the game did, run headless in Godot 4.7 and deterministic. op save takes the arguments of a godot_play run (scene, input, watch, frames, until, signals, expect: at least one claim), runs it once more and writes it only when every claim holds (undo with godot_undo); overwrite replaces one. op list shows each scenario and its claims; op run runs all, or the one called name (else those whose name contains it), and returns PASS per scenario and every failing claim with the value the game had and the frame. An error result when a run fails or Godot is missing. After godot_play with expect proves a fix, save it so the next change cannot break it unnoticed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"op": "<op>"
},
"name": "godot_scenario"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | list, run or save | |
| name | No | save: the new scenario's name (letters, digits, _ or -); run and list: which ones (default all) | |
| path | No | project folder, or a file or folder inside it (relative to the server's folder; default: the current project) | |
| input | No | save: timeline, "10 tap jump; 40 hold right 20" | |
| scene | No | save: the res:// scene (default: the main scene) | |
| until | No | save: stop when this holds; the scenario fails when it never does | |
| watch | No | save: extra values to sample | |
| expect | No | save: claims, "Hero.velocity.y == -400 @ 10", "Hero.landed >= 1" | |
| frames | No | save: physics frames to run | |
| signals | No | save: signals to record, "Hero.landed" | |
| overwrite | No | save: replace a scenario with that name | |
| timeout_seconds | No | timeout of each run (default 300) |