unreal.AutomationLibrary

class unreal.AutomationLibrary(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: BlueprintFunctionLibrary

Automation Blueprint Function Library

C++ Source:

  • Module: FunctionalTesting

  • File: AutomationBlueprintFunctionLibrary.h

classmethod add_expected_log_error(expected_pattern_string, occurrences=1, exact_match=False) None

Mute the report of log error and warning matching a pattern during an automated test

Parameters:
  • expected_pattern_string (str) –

  • occurrences (int32) –

  • exact_match (bool) –

classmethod add_test_telemetry_data(data_point, measurement, context='') None

Add Telemetry data to currently running automated test.

Parameters:
  • data_point (str) –

  • measurement (float) –

  • context (str) –

classmethod are_automated_tests_running() bool

Lets you know if any automated tests are running, or are about to run and the automation system is spinning up tests.

Return type:

bool

classmethod automation_wait_for_loading(world_context_object, latent_info, options) None

Automation Wait for Loading

Parameters:
classmethod compare_image_against_reference(image_file_path, comparison_name='', comparison_tolerance=ComparisonTolerance.LOW, comparison_notes='', world_context_object=None) bool

request image comparison.

Parameters:
  • image_file_path (str) – Absolute path to the image location. All 8bit RGBA channels supported formats by the engine are accepted.

  • comparison_name (str) – Optional name for the comparison, by default the basename of ImageFilePath is used

  • comparison_tolerance (ComparisonTolerance) –

  • comparison_notes (str) –

  • world_context_object (Object) –

Returns:

True if comparison was successfully enqueued

Return type:

bool

classmethod disable_stat_group(world_context_object, group_name) None

Disable Stat Group

Parameters:
  • world_context_object (Object) –

  • group_name (Name) –

classmethod enable_stat_group(world_context_object, group_name) None

Enable Stat Group

Parameters:
  • world_context_object (Object) –

  • group_name (Name) –

classmethod finish_loading_before_screenshot() None

Finish Loading Before Screenshot

classmethod get_default_screenshot_options_for_gameplay(tolerance=ComparisonTolerance.LOW, delay=0.200000) AutomationScreenshotOptions

Get Default Screenshot Options for Gameplay

Parameters:
Return type:

AutomationScreenshotOptions

classmethod get_default_screenshot_options_for_rendering(tolerance=ComparisonTolerance.LOW, delay=0.200000) AutomationScreenshotOptions

Get Default Screenshot Options for Rendering

Parameters:
Return type:

AutomationScreenshotOptions

classmethod get_stat_call_count(stat_name) float

Get Stat Call Count

Parameters:

stat_name (Name) –

Return type:

float

classmethod get_stat_exc_average(stat_name) float

Get Stat Exc Average

Parameters:

stat_name (Name) –

Return type:

float

classmethod get_stat_exc_max(stat_name) float

Get Stat Exc Max

Parameters:

stat_name (Name) –

Return type:

float

classmethod get_stat_inc_average(stat_name) float

Get Stat Inc Average

Parameters:

stat_name (Name) –

Return type:

float

classmethod get_stat_inc_max(stat_name) float

Get Stat Inc Max

Parameters:

stat_name (Name) –

Return type:

float

classmethod set_editor_viewport_view_mode(index) None

Sets all viewports of the first found level editor to have the given ViewMode (Lit/Unlit/etc.) *

Parameters:

index (ViewModeIndex) –

classmethod set_editor_viewport_visualize_buffer(buffer_name) None

Sets all viewports of the first found level editor to have the VisualizeBuffer ViewMode and also display a given buffer (BaseColor/Metallic/Roughness/etc.) *

Parameters:

buffer_name (Name) –

classmethod set_scalability_quality_level_relative_to_max(world_context_object, value=1) None

Sets all other settings based on an overall value

Parameters:
  • world_context_object (Object) –

  • value (int32) – 0:Cinematic, 1:Epic…etc.

classmethod set_scalability_quality_to_epic(world_context_object) None

Set Scalability Quality to Epic

Parameters:

world_context_object (Object) –

classmethod set_scalability_quality_to_low(world_context_object) None

Set Scalability Quality to Low

Parameters:

world_context_object (Object) –

classmethod set_test_telemetry_storage(storage_name) None

Set Telemetry data storage name of currently running automated test.

Parameters:

storage_name (str) –

classmethod take_automation_screenshot(world_context_object, latent_info, name="", notes, options) None

Takes a screenshot of the game’s viewport. Does not capture any UI.

Parameters:
classmethod take_automation_screenshot_at_camera(world_context_object, latent_info, camera, name_override="", notes, options) None

Takes a screenshot of the game’s viewport, from a particular camera actors POV. Does not capture any UI.

Parameters:
classmethod take_automation_screenshot_of_ui(world_context_object, latent_info, name, options) None

Take Automation Screenshot Of UI

Parameters:
classmethod take_high_res_screenshot(res_x, res_y, filename, camera=None, mask_enabled=False, capture_hdr=False, comparison_tolerance=ComparisonTolerance.LOW, comparison_notes='', delay=0.000000) AutomationEditorTask

take high res screenshot in editor.

Parameters:
Return type:

AutomationEditorTask