Convert automated tests related to content and unused levels (#7416)

* Convert automated tests related to content/WaterSample level/Physics's Base level

Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com>

* Fix nits

Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com>

* Add missing .prefab level file

Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com>

* Fix nits

Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com>

* Convert Blast tests

Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com>

* Convert scripting tests

Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com>

* Remove useless comments

Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com>

* Revert Collider_AddColliderComponent change until prefab error message bug fixed

Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com>
This commit is contained in:
chiyenteng
2022-02-07 12:11:01 -08:00
committed by GitHub
parent 38a34d811d
commit 7c6c01d5a1
45 changed files with 2204 additions and 150 deletions
@@ -20,7 +20,7 @@ from editor_python_test_tools.utils import TestHelper as helper
def open_base_level():
helper.init_idle()
helper.open_level("Prefab", "Base")
helper.open_level("", "Base")
def find_entity_by_name(entity_name):
@@ -61,7 +61,7 @@ def launch_and_validate_results(request, test_directory, editor, editor_script,
from os import path
editor.args.extend([
"--regset=/Amazon/Preferences/EnablePrefabSystem=true",
f"--regset-file={os.path.join(workspace.paths.engine_root(), 'Registry', 'prefab.test.setreg')}"])
f"--regset-file={os.path.join(editor.workspace.paths.engine_root(), 'Registry', 'prefab.test.setreg')}"])
else:
editor.args.extend(["--regset=/Amazon/Preferences/EnablePrefabSystem=false"])
@@ -7,8 +7,7 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
import PySide2
import editor_python_test_tools.pyside_utils
import editor_python_test_tools.pyside_utils as pyside_utils
def get_component_combobox_values(component_name, property_name, log_fn=None):
"""
@@ -67,7 +67,7 @@ class TestHelper:
return result == 0
@staticmethod
def open_level(directory : str, level : str):
def open_level(directory : str, level : str, no_prompt: bool = True):
# type: (str, str) -> None
"""
:param level: the name of the level folder in AutomatedTesting\\Physics\\
@@ -75,7 +75,11 @@ class TestHelper:
:return: None
"""
Report.info("Open level {}/{}".format(directory, level))
success = general.open_level_no_prompt(os.path.join(directory, level))
if no_prompt:
success = general.open_level_no_prompt(os.path.join(directory, level))
else:
success = general.open_level(os.path.join(directory, level))
if not success:
open_level_name = general.get_current_level_name()
if open_level_name == level: