Run a PIE test
Have an agent start Play-In-Editor, find and press a button on screen, wait for a property in the running game to change, take a screenshot and stop Play. The same tools work for any scripted check of your game's behaviour.
Before you start
- Hayba is installed and your agent is connected. See Getting started.
- Your level has something to test. The prompt below assumes a start button and a door Blueprint with a boolean
bIsOpen; change the names to yours. -
This guide reads and drives Play, so it works with Review each external edit
on. One exception:
editor_pie_click_actoris held for approval, which the exact review cannot give on this version. Clicking widgets and pressing keys is not held. - Compile your Blueprints first. Hayba will not start Play while a loaded Blueprint would open a compile-error dialog.
Prompt
Run a PIE test. Check the editor is idle, start Play-In-Editor, read what is on screen and click the button labelled "Start". Then check the actor BP_Door until its property bIsOpen is true, trying up to 10 times. Take a screenshot, stop Play, and tell me whether the test passed and what you observed.
What the agent does
editor_get_stateconfirms nothing is playing or building.editor_start_piestarts Play. If a Blueprint needs fixing first, it answerspie_blockedand names it.editor_pie_widget_treelists the visible widgets with their text and screen rectangles.editor_pie_click_widgetclicks the control whose text matches "Start", and reports how many matched.editor_pie_wait_forreadsbIsOpenonce per call. The agent repeats it until it matches or gives up.editor_pie_screenshotrequests a screenshot. The file appears a frame or two later, so the agent checks again withcheck_only.editor_stop_pieends the session.
Things worth knowing:
-
A command cannot wait inside the game: it runs on the game thread, and the world does not
advance while it runs. So
editor_pie_wait_forandeditor_pie_asserteach take one observation. A result ofpolling: truemeans "not yet", and the agent asks again. -
editor_pie_press_keysends keyboard and gamepad buttons,editor_pie_type_texttypes into a focused field, andeditor_pie_actor_listfinds runtime actors with their exact paths. - While Play runs, edits are refused with
pie_active. Stop Play before asking for changes. - Only the agent that started a session can drive it. Agents never drive a session you started.
Automation tests
To run Unreal automation tests instead of a scripted Play session:
test_listwithfilter_patternfinds tests by name.test_runstarts them as a background job and returns ajob_id. Most tests run in a separate editor process, so the open editor stays responsive.build_statusreports progress and the final pass, fail and skip counts.test_get_logreturns the full errors and warnings of the last run.
A filter that matches no tests fails, rather than reporting an empty pass.
Check the result
- Ask the agent for each observation it made, not only a verdict.
- Screenshots land in
Saved/unless the agent gave an absolute path.Screenshots/ <Platform> editor_get_stateshould show Play asnonewhen the test ends.