TestSuite_Main.py 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. """
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. """
  6. import os
  7. import pytest
  8. import ly_test_tools.environment.file_system as file_system
  9. from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorBatchedTest, EditorTestSuite
  10. @pytest.mark.SUITE_main
  11. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  12. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  13. class TestAutomationNoAutoTestMode(EditorTestSuite):
  14. # Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests
  15. # interact with modal dialogs
  16. global_extra_cmdline_args = []
  17. # Helper for test level cleanup
  18. def cleanup_test_level(self, workspace):
  19. file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")],
  20. True, True)
  21. @pytest.mark.skip(reason="Skipped for intermittently failing.")
  22. class test_AssetPicker_UI_UX(EditorBatchedTest):
  23. from .EditorScripts import AssetPicker_UI_UX as test_module
  24. class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorBatchedTest):
  25. from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module
  26. class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest):
  27. # Custom setup and teardown to remove level created during test
  28. def setup(self, request, workspace):
  29. TestAutomationNoAutoTestMode.cleanup_test_level(self, workspace)
  30. def teardown(self, request, workspace, editor_test_results):
  31. TestAutomationNoAutoTestMode.cleanup_test_level(self, workspace)
  32. from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
  33. @pytest.mark.REQUIRES_gpu
  34. class test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(EditorSingleTest):
  35. # Disable null renderer
  36. use_null_renderer = False
  37. # Custom teardown to remove level created during test
  38. def setup(self, request, workspace):
  39. TestAutomationNoAutoTestMode.cleanup_test_level(self, workspace)
  40. def teardown(self, request, workspace, editor_test_results):
  41. TestAutomationNoAutoTestMode.cleanup_test_level(self, workspace)
  42. from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
  43. @pytest.mark.skip(reason="Skipped for intermittently failing.")
  44. class test_InputBindings_Add_Remove_Input_Events(EditorBatchedTest):
  45. from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
  46. @pytest.mark.SUITE_main
  47. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  48. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  49. class TestAutomationAutoTestMode(EditorTestSuite):
  50. # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
  51. global_extra_cmdline_args = ["-autotest_mode"]
  52. class test_AssetBrowser_SearchFiltering(EditorBatchedTest):
  53. from .EditorScripts import AssetBrowser_SearchFiltering as test_module
  54. class test_AssetBrowser_TreeNavigation(EditorSingleTest):
  55. from .EditorScripts import AssetBrowser_TreeNavigation as test_module
  56. class test_ComponentCRUD_Add_Delete_Components(EditorSingleTest):
  57. from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module
  58. @pytest.mark.REQUIRES_gpu
  59. class test_Docking_BasicDockedTools(EditorSingleTest):
  60. from .EditorScripts import Docking_BasicDockedTools as test_module
  61. class test_EntityOutliner_EntityOrdering(EditorSingleTest):
  62. from .EditorScripts import EntityOutliner_EntityOrdering as test_module
  63. # https://github.com/o3de/o3de/issues/10799
  64. extra_cmdline_args = ["-rhi=Null", "-NullRenderer"]
  65. class test_Menus_EditMenuOptions_Work(EditorBatchedTest):
  66. from .EditorScripts import Menus_EditMenuOptions as test_module
  67. class test_Menus_FileMenuOptions_Work(EditorBatchedTest):
  68. from .EditorScripts import Menus_FileMenuOptions as test_module
  69. class test_Menus_ViewMenuOptions_Work(EditorBatchedTest):
  70. from .EditorScripts import Menus_ViewMenuOptions as test_module
  71. @pytest.mark.SUITE_main
  72. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  73. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  74. class TestAutomation(EditorTestSuite):
  75. # These tests require no UI interaction or modal dialog interactions
  76. def cleanup_temp_levels(self, workspace):
  77. file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level_1")],
  78. True, True)
  79. file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level_2")],
  80. True, True)
  81. class test_EditorWorkflow_ParentEntityTransform_Affects_ChildEntityTransform(EditorBatchedTest):
  82. from .EditorScripts import EditorWorkflow_ParentEntityTransform_Affects_ChildEntityTransform as test_module
  83. class test_EditorWorkflow_ChildEntityTransform_Persists_After_ParentEntityTransform(EditorBatchedTest):
  84. from .EditorScripts import EditorWorkflow_ChildEntityTransform_Persists_After_ParentEntityTransform as test_module
  85. class test_EditorWorkflow_EditorCameraMovesToEntityTransformWithBeThisCamera(EditorSingleTest):
  86. from .EditorScripts import EditorWorkflow_EditorCameraMovesToEntityTransformWithBeThisCamera as test_module
  87. class test_EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenTogglingBeThisCamera(EditorSingleTest):
  88. from .EditorScripts import EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenTogglingBeThisCamera as test_module
  89. class test_EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenLeavingGameMode(EditorSingleTest):
  90. from .EditorScripts import EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenLeavingGameMode as test_module
  91. class test_EditorWorkflow_EditorCameraInBeThisCameraReturnsToOriginalPositionWhenLeavingGameMode(EditorSingleTest):
  92. from .EditorScripts import EditorWorkflow_EditorCameraInBeThisCameraReturnsToOriginalPositionWhenLeavingGameMode as test_module
  93. class test_EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenLeavingFullscreenGameMode(EditorSingleTest):
  94. from .EditorScripts import EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenLeavingFullscreenGameMode as test_module
  95. class test_EditorWorkflow_EditorCameraTransformCanBeModifiedWhileInBeThisCamera(EditorSingleTest):
  96. from .EditorScripts import EditorWorkflow_EditorCameraTransformCanBeModifiedWhileInBeThisCamera as test_module
  97. class test_EditorWorkflow_EditorCameraGameModeTransitionWithMultipleCamerasReportsNoErrors(EditorSingleTest):
  98. from .EditorScripts import EditorWorkflow_EditorCameraGameModeTransitionWithMultipleCamerasReportsNoErrors as test_module
  99. class test_EditorWorkflow_EditorCameraBeThisCameraIsClearedWhenChangingLevel(EditorSingleTest):
  100. # Custom teardown to remove level created during test
  101. def setup(self, request, workspace):
  102. self.cleanup_temp_levels(workspace)
  103. def teardown(self, request, workspace, editor_test_results):
  104. self.cleanup_temp_levels(workspace)
  105. from .EditorScripts import EditorWorkflow_EditorCameraBeThisCameraIsClearedWhenChangingLevel as test_module