3
0

TestSuite_Main.py 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. class test_InputBindings_Add_Remove_Input_Events(EditorBatchedTest):
  44. from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
  45. @pytest.mark.SUITE_main
  46. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  47. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  48. class TestAutomationAutoTestMode(EditorTestSuite):
  49. # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
  50. global_extra_cmdline_args = ["-autotest_mode"]
  51. class test_AssetBrowser_SearchFiltering(EditorBatchedTest):
  52. from .EditorScripts import AssetBrowser_SearchFiltering as test_module
  53. class test_AssetBrowser_TreeNavigation(EditorSingleTest):
  54. from .EditorScripts import AssetBrowser_TreeNavigation as test_module
  55. class test_ComponentCRUD_Add_Delete_Components(EditorSingleTest):
  56. from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module
  57. @pytest.mark.REQUIRES_gpu
  58. class test_Docking_BasicDockedTools(EditorSingleTest):
  59. from .EditorScripts import Docking_BasicDockedTools as test_module
  60. class test_EntityOutliner_EntityOrdering(EditorSingleTest):
  61. from .EditorScripts import EntityOutliner_EntityOrdering as test_module
  62. # https://github.com/o3de/o3de/issues/10799
  63. extra_cmdline_args = ["-rhi=Null", "-NullRenderer"]
  64. class test_Menus_EditMenuOptions_Work(EditorBatchedTest):
  65. from .EditorScripts import Menus_EditMenuOptions as test_module
  66. class test_Menus_FileMenuOptions_Work(EditorBatchedTest):
  67. from .EditorScripts import Menus_FileMenuOptions as test_module
  68. class test_Menus_ViewMenuOptions_Work(EditorBatchedTest):
  69. from .EditorScripts import Menus_ViewMenuOptions as test_module
  70. @pytest.mark.SUITE_main
  71. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  72. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  73. class TestAutomation(EditorTestSuite):
  74. # These tests require no UI interaction or modal dialog interactions
  75. def cleanup_temp_levels(self, workspace):
  76. file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level_1")],
  77. True, True)
  78. file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level_2")],
  79. True, True)
  80. class test_EditorWorkflow_ParentEntityTransform_Affects_ChildEntityTransform(EditorBatchedTest):
  81. from .EditorScripts import EditorWorkflow_ParentEntityTransform_Affects_ChildEntityTransform as test_module
  82. class test_EditorWorkflow_ChildEntityTransform_Persists_After_ParentEntityTransform(EditorBatchedTest):
  83. from .EditorScripts import EditorWorkflow_ChildEntityTransform_Persists_After_ParentEntityTransform as test_module
  84. class test_EditorWorkflow_EditorCameraMovesToEntityTransformWithBeThisCamera(EditorSingleTest):
  85. from .EditorScripts import EditorWorkflow_EditorCameraMovesToEntityTransformWithBeThisCamera as test_module
  86. class test_EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenTogglingBeThisCamera(EditorSingleTest):
  87. from .EditorScripts import EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenTogglingBeThisCamera as test_module
  88. class test_EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenLeavingGameMode(EditorSingleTest):
  89. from .EditorScripts import EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenLeavingGameMode as test_module
  90. class test_EditorWorkflow_EditorCameraInBeThisCameraReturnsToOriginalPositionWhenLeavingGameMode(EditorSingleTest):
  91. from .EditorScripts import EditorWorkflow_EditorCameraInBeThisCameraReturnsToOriginalPositionWhenLeavingGameMode as test_module
  92. class test_EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenLeavingFullscreenGameMode(EditorSingleTest):
  93. from .EditorScripts import EditorWorkflow_EditorCameraReturnsToOriginalPositionWhenLeavingFullscreenGameMode as test_module
  94. class test_EditorWorkflow_EditorCameraTransformCanBeModifiedWhileInBeThisCamera(EditorSingleTest):
  95. from .EditorScripts import EditorWorkflow_EditorCameraTransformCanBeModifiedWhileInBeThisCamera as test_module
  96. class test_EditorWorkflow_EditorCameraGameModeTransitionWithMultipleCamerasReportsNoErrors(EditorSingleTest):
  97. from .EditorScripts import EditorWorkflow_EditorCameraGameModeTransitionWithMultipleCamerasReportsNoErrors as test_module
  98. class test_EditorWorkflow_EditorCameraBeThisCameraIsClearedWhenChangingLevel(EditorSingleTest):
  99. # Custom teardown to remove level created during test
  100. def setup(self, request, workspace):
  101. self.cleanup_temp_levels(workspace)
  102. def teardown(self, request, workspace, editor_test_results):
  103. self.cleanup_temp_levels(workspace)
  104. from .EditorScripts import EditorWorkflow_EditorCameraBeThisCameraIsClearedWhenChangingLevel as test_module