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
@@ -45,14 +45,15 @@ def Collider_CheckDefaultShapeSettingIsPxMesh():
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
import editor_python_test_tools.hydra_editor_utils as hydra
# Open 3D Engine Imports
import azlmbr.legacy.general as general
PHYSICS_ASSET_INDEX = 7 # Hardcoded enum index value for Shape property
helper.init_idle()
# 1) Load empty level
helper.open_level("Physics", "Base")
hydra.open_base_level()
# 2) Create an entity to hold the PhysX Shape Collider component
collider_entity = Entity.create_editor_entity("Collider")
@@ -54,6 +54,8 @@ def Collider_MultipleSurfaceSlots():
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.asset_utils import Asset
import editor_python_test_tools.hydra_editor_utils as hydra
# Constants
PHYSICS_ASSET_INDEX = 7 # Hardcoded enum index value for Shape property
SURFACE_TAG_COUNT = 4 # Number of surface tags included in used asset
@@ -62,9 +64,8 @@ def Collider_MultipleSurfaceSlots():
STATIC_MESH = os.path.join("assets", "Physics", "Collider_MultipleSurfaceSlots", "test.azmodel")
PHYSX_MESH = os.path.join("assets", "Physics","Collider_MultipleSurfaceSlots", "test.pxmesh")
helper.init_idle()
# 1) Load the empty level
helper.open_level("Physics", "Base")
hydra.open_base_level()
# 2) Create an entity
test_entity = Entity.create_editor_entity("test_entity")
@@ -54,15 +54,16 @@ def Collider_PxMeshAutoAssignedWhenAddingRenderMeshComponent():
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.asset_utils import Asset
import editor_python_test_tools.hydra_editor_utils as hydra
# Asset paths
STATIC_MESH = os.path.join("assets", "Physics", "Collider_PxMeshAutoAssigned", "spherebot", "r0-b_body.azmodel")
PHYSX_MESH = os.path.join(
"assets", "Physics", "Collider_PxMeshAutoAssigned", "spherebot", "r0-b_body.pxmesh"
)
helper.init_idle()
# 1) Load the empty level
helper.open_level("Physics", "Base")
hydra.open_base_level()
# 2) Create an entity
test_entity = Entity.create_editor_entity("test_entity")
@@ -53,6 +53,8 @@ def Collider_PxMeshAutoAssignedWhenModifyingRenderMeshComponent():
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.asset_utils import Asset
import editor_python_test_tools.hydra_editor_utils as hydra
# Open 3D Engine Imports
import azlmbr.legacy.general as general
@@ -60,9 +62,8 @@ def Collider_PxMeshAutoAssignedWhenModifyingRenderMeshComponent():
MESH_PROPERTY_PATH = "Controller|Configuration|Mesh Asset"
TESTED_PROPERTY_PATH = "Shape Configuration|Asset|PhysX Mesh"
helper.init_idle()
# 1) Load the empty level
helper.open_level("Physics", "Base")
hydra.open_base_level()
# 2) Create an entity
test_entity = Entity.create_editor_entity("test_entity")
@@ -62,7 +62,9 @@ def Collider_PxMeshConvexMeshCollides():
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.asset_utils import Asset
import azlmbr.math as math
import editor_python_test_tools.hydra_editor_utils as hydra
# Open 3D Engine Imports
import azlmbr
@@ -73,9 +75,8 @@ def Collider_PxMeshConvexMeshCollides():
MESH_ASSET_PATH = os.path.join("assets", "Physics", "Collider_PxMeshConvexMeshCollides", "spherebot", "r0-b_body.pxmesh")
TIMEOUT = 2.0
helper.init_idle()
# 1) Load the level
helper.open_level("Physics", "Base")
hydra.open_base_level()
# 2) Create test entity
collider = EditorEntity.create_editor_entity_at([512.0, 512.0, 33.0], "Collider")
@@ -59,15 +59,16 @@ def Collider_PxMeshNotAutoAssignedWhenNoPhysicsFbx():
from editor_python_test_tools.utils import Tracer
from editor_python_test_tools.asset_utils import Asset
import editor_python_test_tools.hydra_editor_utils as hydra
# Open 3D Engine Imports
import azlmbr.asset as azasset
# Asset paths
STATIC_MESH = os.path.join("assets", "Physics", "Collider_PxMeshNotAutoAssignedWhenNoPhysicsFbx", "test_asset.azmodel")
helper.init_idle()
# 1) Load the empty level
helper.open_level("Physics", "Base")
hydra.open_base_level()
# 2) Create an entity
test_entity = Entity.create_editor_entity("test_entity")