Run Playtest
run_playtestExecute Playtest DSL scripts to automate Unity Play Mode testing, including move, wait, assert, snapshot, and invoke commands, returning a structured report.
Instructions
[Play Mode] Execute a playtest DSL script. Returns structured report (for NUnit tests, use run_tests).
Commands: MOVE TO x,y,z | WAIT n | WAIT_UNTIL query op value | ASSERT query op value |
ASSERT_CONSOLE_CLEAN [IGNORE "pat"] | SNAPSHOT queries | INVOKE path comp method args |
SET path comp field value | LOG msg | TIMESCALE n | ASSERT_CONSERVED SUM a+b OVER t |
ASSERT_CTA VISIBLE|CLICKABLE | VAL name query | TELEPORT path x,y,z |
ASSERT_BATCH...END | ASSERT_NEAR pathA pathB dist | INVARIANT query op value |
SIMULATE name [DURATION n] [TIMESCALE n] | MONITOR name | TRACE_FLOW FROM a TO b FIELD f |
CAPTURE label query | ASSERT_CAPTURED label INCREASED|DECREASED.
defs: inline VAL definitions prepended to script.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| defs | No | Inline VAL definitions prepended to script (alias block) | |
| path | No | Path to .playtest DSL file on disk (mutually exclusive with script) | |
| fresh | No | Stop and restart Play Mode before running the script | |
| script | No | Inline DSL script (mutually exclusive with path) | |
| timeout | No | Max seconds to wait for the playtest to finish (default 120) | |
| after_hook | No | DSL commands to run after Play Mode exits | |
| before_hook | No | DSL commands to run before entering Play Mode | |
| abort_on_fail | No | Stop script execution on first ASSERT failure | |
| snapshot_on_failure | No | Auto-capture screenshot on first ASSERT failure |