Convert several physics automated tests with Base test level file converted to prefab file (#5138)
* Convert some physics automated tests to use prefab system Signed-off-by: chiyteng <chiyteng@amazon.com> * revert changes Signed-off-by: chiyteng <chiyteng@amazon.com> * Fix file names Signed-off-by: chiyteng <chiyteng@amazon.com>
This commit is contained in:
@@ -53,6 +53,27 @@ class EditorSingleTest_WithFileOverrides(EditorSingleTest):
|
||||
for f in original_file_list:
|
||||
fm._restore_file(f, file_list[f])
|
||||
|
||||
@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.")
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomationWithPrefabSystemEnabled(EditorTestSuite):
|
||||
|
||||
global_extra_cmdline_args = ['-BatchMode', '-autotest_mode',
|
||||
'extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"]']
|
||||
|
||||
@staticmethod
|
||||
def get_number_parallel_editors():
|
||||
return 16
|
||||
|
||||
class C4982801_PhysXColliderShape_CanBeSelected(EditorSharedTest):
|
||||
from .tests.collider import Collider_BoxShapeEditing as test_module
|
||||
|
||||
class C4982800_PhysXColliderShape_CanBeSelected(EditorSharedTest):
|
||||
from .tests.collider import Collider_SphereShapeEditing as test_module
|
||||
|
||||
class C4982802_PhysXColliderShape_CanBeSelected(EditorSharedTest):
|
||||
from .tests.collider import Collider_CapsuleShapeEditing as test_module
|
||||
|
||||
@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.")
|
||||
@pytest.mark.SUITE_main
|
||||
@@ -286,15 +307,6 @@ class TestAutomation(EditorTestSuite):
|
||||
class C19723164_ShapeCollider_WontCrashEditor(EditorSharedTest):
|
||||
from .tests.shape_collider import ShapeCollider_LargeNumberOfShapeCollidersWontCrashEditor as test_module
|
||||
|
||||
class C4982800_PhysXColliderShape_CanBeSelected(EditorSharedTest):
|
||||
from .tests.collider import Collider_SphereShapeEditting as test_module
|
||||
|
||||
class C4982801_PhysXColliderShape_CanBeSelected(EditorSharedTest):
|
||||
from .tests.collider import Collider_BoxShapeEditting as test_module
|
||||
|
||||
class C4982802_PhysXColliderShape_CanBeSelected(EditorSharedTest):
|
||||
from .tests.collider import Collider_CapsuleShapeEditting as test_module
|
||||
|
||||
class C12905528_ForceRegion_WithNonTriggerCollider(EditorSharedTest):
|
||||
from .tests.force_region import ForceRegion_WithNonTriggerColliderWarning as test_module
|
||||
# Fixme: expected_lines = ["[Warning] (PhysX Force Region) - Please ensure collider component marked as trigger exists in entity"]
|
||||
|
||||
@@ -401,19 +401,22 @@ class TestAutomation(TestAutomationBase):
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_SphereShapeEditting(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_SphereShapeEditting as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
def test_Collider_SphereShapeEditing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_SphereShapeEditing as test_module
|
||||
self._run_test(request, workspace, editor, test_module,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_BoxShapeEditting(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_BoxShapeEditting as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
def test_Collider_BoxShapeEditing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_BoxShapeEditing as test_module
|
||||
self._run_test(request, workspace, editor, test_module,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
|
||||
|
||||
@revert_physics_config
|
||||
def test_Collider_CapsuleShapeEditting(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_CapsuleShapeEditting as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
def test_Collider_CapsuleShapeEditing(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.collider import Collider_CapsuleShapeEditing as test_module
|
||||
self._run_test(request, workspace, editor, test_module,
|
||||
extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"])
|
||||
|
||||
def test_ForceRegion_WithNonTriggerColliderWarning(self, request, workspace, editor, launcher_platform):
|
||||
from .tests.force_region import ForceRegion_WithNonTriggerColliderWarning as test_module
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ class Tests():
|
||||
# fmt: on
|
||||
|
||||
|
||||
def Collider_BoxShapeEditting():
|
||||
def Collider_BoxShapeEditing():
|
||||
"""
|
||||
Summary:
|
||||
Adding PhysX Collider and Shape components to test entity, then attempting to modify the shape's dimensions
|
||||
@@ -73,7 +73,7 @@ def Collider_BoxShapeEditting():
|
||||
|
||||
helper.init_idle()
|
||||
# 1) Load the empty level
|
||||
helper.open_level("Physics", "Base")
|
||||
helper.open_level("", "Base")
|
||||
|
||||
# 2) Create the test entity
|
||||
test_entity = Entity.create_editor_entity("Test Entity")
|
||||
@@ -102,4 +102,4 @@ def Collider_BoxShapeEditting():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Collider_BoxShapeEditting)
|
||||
Report.start_test(Collider_BoxShapeEditing)
|
||||
+3
-3
@@ -19,7 +19,7 @@ class Tests():
|
||||
# fmt: on
|
||||
|
||||
|
||||
def Collider_CapsuleShapeEditting():
|
||||
def Collider_CapsuleShapeEditing():
|
||||
"""
|
||||
Summary:
|
||||
Adding PhysX Collider and Shape components to test entity, then attempting to modify the shape's dimensions
|
||||
@@ -74,7 +74,7 @@ def Collider_CapsuleShapeEditting():
|
||||
|
||||
helper.init_idle()
|
||||
# 1) Load the empty level
|
||||
helper.open_level("Physics", "Base")
|
||||
helper.open_level("", "Base")
|
||||
|
||||
# 2) Create the test entity
|
||||
test_entity = Entity.create_editor_entity("Test Entity")
|
||||
@@ -102,4 +102,4 @@ def Collider_CapsuleShapeEditting():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Collider_CapsuleShapeEditting)
|
||||
Report.start_test(Collider_CapsuleShapeEditing)
|
||||
+3
-3
@@ -19,7 +19,7 @@ class Tests():
|
||||
# fmt: on
|
||||
|
||||
|
||||
def Collider_SphereShapeEditting():
|
||||
def Collider_SphereShapeEditing():
|
||||
"""
|
||||
Summary:
|
||||
Adding PhysX Collider and Shape components to test entity, then attempting to modify the shape's dimensions
|
||||
@@ -57,7 +57,7 @@ def Collider_SphereShapeEditting():
|
||||
|
||||
helper.init_idle()
|
||||
# 1) Load the empty level
|
||||
helper.open_level("Physics", "Base")
|
||||
helper.open_level("", "Base")
|
||||
|
||||
# 2) Create the test entity
|
||||
test_entity = Entity.create_editor_entity("Test Entity")
|
||||
@@ -90,4 +90,4 @@ def Collider_SphereShapeEditting():
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Collider_SphereShapeEditting)
|
||||
Report.start_test(Collider_SphereShapeEditing)
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"ContainerEntity": {
|
||||
"Id": "ContainerEntity",
|
||||
"Name": "Base",
|
||||
"Components": {
|
||||
"Component_[10182366347512475253]": {
|
||||
"$type": "EditorPrefabComponent",
|
||||
"Id": 10182366347512475253
|
||||
},
|
||||
"Component_[12917798267488243668]": {
|
||||
"$type": "EditorPendingCompositionComponent",
|
||||
"Id": 12917798267488243668
|
||||
},
|
||||
"Component_[3261249813163778338]": {
|
||||
"$type": "EditorOnlyEntityComponent",
|
||||
"Id": 3261249813163778338
|
||||
},
|
||||
"Component_[3837204912784440039]": {
|
||||
"$type": "EditorDisabledCompositionComponent",
|
||||
"Id": 3837204912784440039
|
||||
},
|
||||
"Component_[4272963378099646759]": {
|
||||
"$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent",
|
||||
"Id": 4272963378099646759,
|
||||
"Parent Entity": ""
|
||||
},
|
||||
"Component_[4848458548047175816]": {
|
||||
"$type": "EditorVisibilityComponent",
|
||||
"Id": 4848458548047175816
|
||||
},
|
||||
"Component_[5787060997243919943]": {
|
||||
"$type": "EditorInspectorComponent",
|
||||
"Id": 5787060997243919943
|
||||
},
|
||||
"Component_[7804170251266531779]": {
|
||||
"$type": "EditorLockComponent",
|
||||
"Id": 7804170251266531779
|
||||
},
|
||||
"Component_[7874177159288365422]": {
|
||||
"$type": "EditorEntitySortComponent",
|
||||
"Id": 7874177159288365422
|
||||
},
|
||||
"Component_[8018146290632383969]": {
|
||||
"$type": "EditorEntityIconComponent",
|
||||
"Id": 8018146290632383969
|
||||
},
|
||||
"Component_[8452360690590857075]": {
|
||||
"$type": "SelectionComponent",
|
||||
"Id": 8452360690590857075
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user