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:
+1
-1
@@ -14,7 +14,7 @@ import azlmbr.math as math
|
||||
import azlmbr.asset as asset
|
||||
|
||||
# Open a level (any level should work)
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'WaterSample')
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'Base')
|
||||
|
||||
def GetSetCompareTest(component, path, assetId):
|
||||
# Test Get/Set (get old value, set new value, check that new value was set correctly)
|
||||
|
||||
@@ -24,6 +24,7 @@ from hydra_utils import launch_test_case
|
||||
@pytest.mark.parametrize('level', ['Simple'])
|
||||
class TestComponentCommands(object):
|
||||
|
||||
# It needs a new test level in prefab format to make it testable again.
|
||||
def test_MeshComponentBasics(self, request, editor, level, launcher_platform):
|
||||
|
||||
unexpected_lines=[]
|
||||
|
||||
+3
-1
@@ -5,6 +5,8 @@ For complete copyright and license terms please see the LICENSE at the root of t
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# It needs a new test level in prefab format to make it testable again.
|
||||
|
||||
# Tests a portion of the Component CRUD Python API while the Editor is running
|
||||
|
||||
import azlmbr.bus as bus
|
||||
@@ -18,7 +20,7 @@ def CompareComponentEntityIdPairs(component1, component2):
|
||||
return component1.Equal(component2)
|
||||
|
||||
# Open a level (any level should work)
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'WaterSample')
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'Base')
|
||||
|
||||
# Get Component Types for Mesh and Comment
|
||||
typeIdsList = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeIdsByEntityType', ["Mesh", "Comment", "Mesh Collider"], entity.EntityType().Game)
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import azlmbr.entity as entity
|
||||
import azlmbr.math as math
|
||||
|
||||
# Open a level (any level should work)
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'WaterSample')
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'Base')
|
||||
|
||||
def GetSetCompareTest(component, path, value):
|
||||
oldObj = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentProperty', component, path)
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import azlmbr.editor as editor
|
||||
from azlmbr.entity import EntityId
|
||||
|
||||
# Open a level (any level should work)
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'WaterSample')
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'Base')
|
||||
|
||||
parentEntityId = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', EntityId())
|
||||
childEntityId = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', EntityId())
|
||||
|
||||
@@ -32,7 +32,7 @@ def onEditorEntityDeleted(parameters):
|
||||
|
||||
|
||||
# Open a level (any level should work)
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'WaterSample')
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'Base')
|
||||
|
||||
# Listen for notifications when entities are created/deleted
|
||||
handler = bus.NotificationHandler('EditorEntityContextNotificationBus')
|
||||
|
||||
@@ -16,13 +16,13 @@ import os
|
||||
sys.path.append(os.path.dirname(__file__))
|
||||
from hydra_utils import launch_test_case
|
||||
|
||||
|
||||
@pytest.mark.SUITE_sandbox
|
||||
@pytest.mark.parametrize('launcher_platform', ['windows_editor'])
|
||||
@pytest.mark.parametrize('project', ['AutomatedTesting'])
|
||||
@pytest.mark.parametrize('level', ['Simple'])
|
||||
class TestObjectManagerAutomation(object):
|
||||
|
||||
# It needs a new test level in prefab format to make it testable again.
|
||||
def test_ViewPane(self, request, editor, level, launcher_platform):
|
||||
|
||||
unexpected_lines=[]
|
||||
|
||||
+3
-5
@@ -20,12 +20,10 @@ def fetch_vector3_parts(vec3):
|
||||
|
||||
general.idle_enable(True)
|
||||
|
||||
# Try to open the WaterSample level. If not, fail the test.
|
||||
# We need to rely on an existing level since the API does not provide
|
||||
# a way to create entities, but only lets us manipulate them.
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'WaterSample')
|
||||
# It needs a new test level in prefab format to make it testable again.
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'Base')
|
||||
|
||||
if (editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'GetCurrentLevelName') == 'WaterSample'):
|
||||
if (editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'GetCurrentLevelName') == 'Base'):
|
||||
|
||||
objs_list = general.get_all_objects()
|
||||
|
||||
|
||||
@@ -21,8 +21,7 @@ import azlmbr.bus as bus
|
||||
import azlmbr.entity as entity
|
||||
import azlmbr.editor as editor
|
||||
import azlmbr.legacy.general as general
|
||||
import editor_python_test_tools.pyside_component_utils as pysde_component_utils
|
||||
|
||||
import editor_python_test_tools.pyside_component_utils as pyside_component_utils
|
||||
|
||||
def PySide_Example_test_case():
|
||||
# Open level, any level should work
|
||||
|
||||
@@ -13,7 +13,7 @@ import azlmbr.math
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
# Open a level (any level should work)
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'WaterSample')
|
||||
editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'OpenLevelNoPrompt', 'Base')
|
||||
|
||||
general.idle_wait(0.5)
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import azlmbr.math
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
# Open a level (any level should work)
|
||||
general.open_level_no_prompt('WaterSample')
|
||||
general.open_level_no_prompt('Base')
|
||||
general.idle_wait(0.5)
|
||||
|
||||
test_success = True
|
||||
|
||||
Reference in New Issue
Block a user