3
0

TestSuite_Main.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 pytest
  7. import os
  8. import sys
  9. from ly_test_tools.o3de.editor_test import EditorTestSuite, EditorSingleTest
  10. sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
  11. from ly_test_tools.environment import process_utils
  12. from ly_test_tools.launchers import launcher_helper
  13. from ly_test_tools.log.log_monitor import LogMonitor
  14. import ly_test_tools.environment.waiter as waiter
  15. # Saves the level cache folder.
  16. # These artifacts will be saved in the test results so developers can access the level assets
  17. # to debug should the test ever fail.
  18. def save_multiplayer_level_cache_folder_artifact(workspace, multiplayer_level):
  19. level_cache_folder_path = os.path.join(workspace.paths.platform_cache(), "levels", "multiplayer", multiplayer_level)
  20. if os.path.exists(level_cache_folder_path):
  21. workspace.artifact_manager.save_artifact(level_cache_folder_path)
  22. else:
  23. pytest.fail(f"Failed to find level asset cache for '{multiplayer_level}', located here: '{level_cache_folder_path}'! Make sure AssetProcessor successfully built the level.")
  24. @pytest.mark.SUITE_main
  25. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  26. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  27. class TestAutomation(EditorTestSuite):
  28. class test_Multiplayer_BasicConnectivity_Connects(EditorSingleTest):
  29. from .tests import Multiplayer_BasicConnectivity_Connects as test_module
  30. @classmethod
  31. def setup(cls, instance, request, workspace):
  32. save_multiplayer_level_cache_folder_artifact(workspace, "basicconnectivity_connects")
  33. class test_Multiplayer_BasicConnectivity_Connects_ClientServer(EditorSingleTest):
  34. from .tests import Multiplayer_BasicConnectivity_Connects_ClientServer as test_module