Skip to content

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

Prompt

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

  1. editor_get_state confirms nothing is playing or building.
  2. editor_start_pie starts Play. If a Blueprint needs fixing first, it answers pie_blocked and names it.
  3. editor_pie_widget_tree lists the visible widgets with their text and screen rectangles.
  4. editor_pie_click_widget clicks the control whose text matches "Start", and reports how many matched.
  5. editor_pie_wait_for reads bIsOpen once per call. The agent repeats it until it matches or gives up.
  6. editor_pie_screenshot requests a screenshot. The file appears a frame or two later, so the agent checks again with check_only.
  7. editor_stop_pie ends the session.

Things worth knowing:

Automation tests

To run Unreal automation tests instead of a scripted Play session:

  1. test_list with filter_pattern finds tests by name.
  2. test_run starts them as a background job and returns a job_id. Most tests run in a separate editor process, so the open editor stays responsive.
  3. build_status reports progress and the final pass, fail and skip counts.
  4. test_get_log returns 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