Merge branch 'development' into Prefab/SaveAllPrefabs

Signed-off-by: srikappa-amzn <srikappa@amazon.com>
This commit is contained in:
srikappa-amzn
2021-09-02 23:40:54 -07:00
2357 changed files with 473642 additions and 159101 deletions
@@ -0,0 +1,36 @@
---
name: Nightly Build Error bug report
about: Create a report when the nightly build process fails
title: 'Nightly Build Failure'
labels: 'needs-triage,needs-sig,kind/bug,kind/nightlybuildfailure'
---
**Describe the bug**
A clear and concise description of what the bug is.
**Failure type**
Build | Asset Processing | Test Tools | Infrastructure | Test
**To Reproduce Test Failures**
- Paste the command line that reproduces the test failure
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Logs**
Attach the Jenkins logs that are relevant to the failure
**Desktop/Device (please complete the following information):**
- Device: [e.g. PC, Mac, iPhone, Samsung]
- OS: [e.g. Windows, macOS, iOS, Android]
- Version [e.g. 10, Bug Sur, Oreo]
- CPU [e.g. Intel I9-9900k , Ryzen 5900x, ]
- GPU [AMD 6800 XT, NVidia RTX 3090]
- Memory [e.g. 16GB]
**Additional context**
Add any other context about the problem here.
+1
View File
@@ -5,6 +5,7 @@ __pycache__
AssetProcessorTemp/**
[Bb]uild/**
[Oo]ut/**
CMakeUserPresets.json
[Cc]ache/
/install/
Editor/EditorEventLog.xml
@@ -6,4 +6,4 @@
#
#
set(SQUISH-CCR_LIBS ${BASE_PATH}/lib/Mac/Release/libsquish-ccr.a)
ly_install_directory(DIRECTORIES .)
+3 -29
View File
@@ -35,37 +35,11 @@ ly_create_alias(NAME AutomatedTesting.Servers NAMESPACE Gem TARGETS Gem::Automa
# Gem dependencies
################################################################################
# The GameLauncher uses "Clients" gem variants:
ly_enable_gems(PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
TARGETS AutomatedTesting.GameLauncher
VARIANTS Clients)
# Enable the enabled_gems for the Project:
ly_enable_gems(PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake)
# If we build a server, then apply the gems to the server
# Add project to the list server projects to create the AutomatedTesting.ServerLauncher
if(PAL_TRAIT_BUILD_SERVER_SUPPORTED)
# if we're making a server, then add the "Server" gem variants to it:
ly_enable_gems(PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
TARGETS AutomatedTesting.ServerLauncher
VARIANTS Servers)
set_property(GLOBAL APPEND PROPERTY LY_LAUNCHER_SERVER_PROJECTS AutomatedTesting)
endif()
if (PAL_TRAIT_BUILD_HOST_TOOLS)
# The Editor uses "Tools" gem variants:
ly_enable_gems(
PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
TARGETS Editor
VARIANTS Tools)
# The Material Editor needs the Lyshine "Tools" gem variant for the custom LyShine pass
ly_enable_gems(
PROJECT_NAME AutomatedTesting GEMS LyShine
TARGETS MaterialEditor
VARIANTS Tools)
# The pipeline tools use "Builders" gem variants:
ly_enable_gems(
PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
TARGETS AssetBuilder AssetProcessor AssetProcessorBatch
VARIANTS Builders)
endif()
@@ -17,7 +17,7 @@
namespace PythonCoverage
{
static constexpr char* const LogCallSite = "PythonCoverageEditorSystemComponent";
static constexpr const char* const LogCallSite = "PythonCoverageEditorSystemComponent";
void PythonCoverageEditorSystemComponent::Reflect(AZ::ReflectContext* context)
{
@@ -5,12 +5,14 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
# ARN of the IAM role to assume for retrieving temporary AWS credentials
ASSUME_ROLE_ARN = 'arn:aws:iam::645075835648:role/o3de-automation-tests'
ASSUME_ROLE_ARN = os.environ.get('ASSUME_ROLE_ARN', 'arn:aws:iam::645075835648:role/o3de-automation-tests')
# Name of the AWS project deployed by the CDK applications
AWS_PROJECT_NAME = 'AWSAUTO'
AWS_PROJECT_NAME = os.environ.get('O3DE_AWS_PROJECT_NAME', 'AWSAUTO')
# Region for the existing CloudFormation stacks used by the automation tests
AWS_REGION = 'us-east-1'
AWS_REGION = os.environ.get('O3DE_AWS_DEPLOY_REGION', 'us-east-1')
# Name of the default resource mapping config file used by the automation tests
AWS_RESOURCE_MAPPING_FILE_NAME = 'default_aws_resource_mappings.json'
# Name of the game launcher log
@@ -0,0 +1,47 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# Built-in Imports
from __future__ import annotations
# Open 3D Engine Imports
import azlmbr.bus as bus
import azlmbr.asset as azasset
import azlmbr.math as math
class Asset:
"""
Used to find Asset Id by its path and path of asset by its Id
If a component has any asset property, then this class object can be called as:
asset_id = editor_python_test_tools.editor_entity_utils.EditorComponent.get_component_property_value(<arguments>)
asset = asset_utils.Asset(asset_id)
"""
def __init__(self, id: azasset.AssetId):
self.id: azasset.AssetId = id
# Creation functions
@classmethod
def find_asset_by_path(cls, path: str, RegisterType: bool = False) -> Asset:
"""
:param path: Absolute file path of the asset
:param RegisterType: Whether to register the asset if it's not in the database,
default to false for the general case
:return: Asset object associated with file path
"""
asset_id = azasset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", path, math.Uuid(), RegisterType)
assert asset_id.is_valid(), f"Couldn't find Asset with path: {path}"
asset = cls(asset_id)
return asset
# Methods
def get_path(self) -> str:
"""
:return: Absolute file path of Asset
"""
assert self.id.is_valid(), "Invalid Asset Id"
return azasset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetPathById", self.id)
@@ -45,10 +45,6 @@ def C18977329_NvCloth_AddClothSimulationToMesh():
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.utils import Report
# Helper file Imports
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.utils import Tracer
@@ -84,7 +80,5 @@ def C18977329_NvCloth_AddClothSimulationToMesh():
helper.close_editor()
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C18977329_NvCloth_AddClothSimulationToMesh)
@@ -44,11 +44,7 @@ def C18977330_NvCloth_AddClothSimulationToActor():
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.utils import Report
# Helper file Imports
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.utils import Tracer
@@ -84,7 +80,5 @@ def C18977330_NvCloth_AddClothSimulationToActor():
helper.close_editor()
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C18977330_NvCloth_AddClothSimulationToActor)
@@ -12,7 +12,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
TEST_SUITE main
TEST_REQUIRES gpu
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
@@ -1,11 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
def init():
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
@@ -22,12 +22,11 @@ from base import TestAutomationBase
class TestAutomation(TestAutomationBase):
use_null_renderer = False # Use default renderer (needs gpu)
extra_cmdline_args = []
def test_C18977329_NvCloth_AddClothSimulationToMesh(self, request, workspace, editor, launcher_platform):
from . import C18977329_NvCloth_AddClothSimulationToMesh as test_module
self._run_test(request, workspace, editor, test_module, self.extra_cmdline_args, self.use_null_renderer)
self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer)
def test_C18977330_NvCloth_AddClothSimulationToActor(self, request, workspace, editor, launcher_platform):
from . import C18977330_NvCloth_AddClothSimulationToActor as test_module
self._run_test(request, workspace, editor, test_module, self.extra_cmdline_args, self.use_null_renderer)
self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer)
@@ -342,7 +342,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) ->
# Run a full scan to ENSURE that both caches (pc and osx) are COMPLETELY POPULATED
# Needed for asset bundling
# fmt:off
assert asset_processor.batch_process(fastscan=False, timeout=timeout * len(platforms), platforms=platforms_list), \
assert asset_processor.batch_process(fastscan=True, timeout=timeout * len(platforms), platforms=platforms_list), \
"AP Batch failed to process in bundler_batch_fixture"
# fmt:on
@@ -92,25 +92,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::AssetProcessor
)
# Issue #3017
#ly_add_pytest(
# NAME AssetPipelineTests.AssetBundler
# PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py
# EXCLUDE_TEST_RUN_TARGET_FROM_IDE
# TEST_SERIAL
# TEST_SUITE periodic
# RUNTIME_DEPENDENCIES
# AZ::AssetProcessor
# AZ::AssetBundlerBatch
#)
ly_add_pytest(
NAME AssetPipelineTests.AssetBundler_SandBox
TEST_SUITE sandbox
NAME AssetPipelineTests.AssetBundler
PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py
PYTEST_MARKS "SUITE_sandbox" # run only sandbox tests in this file
EXCLUDE_TEST_RUN_TARGET_FROM_IDE
TEST_SERIAL
TEST_SUITE periodic
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
AZ::AssetBundlerBatch
@@ -33,6 +33,7 @@ MATERIAL_TYPE_PATH = os.path.join(
azlmbr.paths.devroot, "Gems", "Atom", "Feature", "Common", "Assets",
"Materials", "Types", "StandardPBR.materialtype",
)
CACHE_FILE_EXTENSION = ".azmaterial"
def run():
@@ -67,6 +68,7 @@ def run():
material_editor.save_document_as_child(document_id, target_path)
material_editor.wait_for_condition(lambda: os.path.exists(target_path), 2.0)
print(f"New asset created: {os.path.exists(target_path)}")
time.sleep(2.0)
# Verify if the newly created document is open
new_document_id = material_editor.open_material(target_path)
@@ -101,22 +103,29 @@ def run():
expected_color = math.Color(0.25, 0.25, 0.25, 1.0)
material_editor.set_property(document_id, property_name, expected_color)
material_editor.save_document(document_id)
time.sleep(2.0)
# 7) Test Case: Saving as a New Material
# Assign new color to the material file and save the document as copy
expected_color_1 = math.Color(0.5, 0.5, 0.5, 1.0)
material_editor.set_property(document_id, property_name, expected_color_1)
target_path_1 = os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Materials", NEW_MATERIAL_1)
cache_file_name_1 = os.path.splitext(NEW_MATERIAL_1) # Example output: ('test_material_1', '.material')
cache_file_1 = f"{cache_file_name_1[0]}{CACHE_FILE_EXTENSION}"
target_path_1_cache = os.path.join(azlmbr.paths.devassets, "Cache", "pc", "materials", cache_file_1)
material_editor.save_document_as_copy(document_id, target_path_1)
time.sleep(2.0)
material_editor.wait_for_condition(lambda: os.path.exists(target_path_1_cache), 4.0)
# 8) Test Case: Saving as a Child Material
# Assign new color to the material file save the document as child
expected_color_2 = math.Color(0.75, 0.75, 0.75, 1.0)
material_editor.set_property(document_id, property_name, expected_color_2)
target_path_2 = os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Materials", NEW_MATERIAL_2)
cache_file_name_2 = os.path.splitext(NEW_MATERIAL_1) # Example output: ('test_material_2', '.material')
cache_file_2 = f"{cache_file_name_2[0]}{CACHE_FILE_EXTENSION}"
target_path_2_cache = os.path.join(azlmbr.paths.devassets, "Cache", "pc", "materials", cache_file_2)
material_editor.save_document_as_child(document_id, target_path_2)
time.sleep(2.0)
material_editor.wait_for_condition(lambda: os.path.exists(target_path_2_cache), 4.0)
# Close/Reopen documents
material_editor.close_all_documents()
@@ -181,3 +181,39 @@ class TestPerformanceBenchmarkSuite(object):
aggregator = BenchmarkDataAggregator(workspace, logger, 'periodic')
aggregator.upload_metrics(rhi)
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("launcher_platform", ['windows_generic'])
@pytest.mark.system
class TestMaterialEditor(object):
@pytest.mark.parametrize("cfg_args", ["-rhi=dx12", "-rhi=Vulkan"])
@pytest.mark.parametrize("exe_file_name", ["MaterialEditor"])
def test_MaterialEditorLaunch_AllRHIOptionsSucceed(
self, request, workspace, project, launcher_platform, generic_launcher, exe_file_name, cfg_args):
"""
Tests each valid RHI option (Null RHI excluded) can be launched with the MaterialEditor.
Checks for the "Finished loading viewport configurtions." success message post lounch.
"""
expected_lines = ["Finished loading viewport configurtions."]
unexpected_lines = [
# "Trace::Assert",
# "Trace::Error",
"Traceback (most recent call last):",
]
hydra.launch_and_validate_results(
request,
TEST_DIRECTORY,
generic_launcher,
editor_script="",
run_python="--runpython",
timeout=30,
expected_lines=expected_lines,
unexpected_lines=unexpected_lines,
halt_on_unexpected=False,
null_renderer=False,
cfg_args=[cfg_args],
log_file_name="MaterialEditor.log"
)
@@ -16,7 +16,6 @@ import editor_python_test_tools.hydra_test_utils as hydra
from atom_renderer.atom_utils.atom_constants import LIGHT_TYPES
logger = logging.getLogger(__name__)
EDITOR_TIMEOUT = 120
TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "atom_hydra_scripts")
@@ -175,7 +174,7 @@ class TestAtomEditorComponentsMain(object):
TEST_DIRECTORY,
editor,
"hydra_AtomEditorComponents_AddedToEntity.py",
timeout=EDITOR_TIMEOUT,
timeout=120,
expected_lines=expected_lines,
unexpected_lines=unexpected_lines,
halt_on_unexpected=True,
@@ -236,7 +235,7 @@ class TestAtomEditorComponentsMain(object):
TEST_DIRECTORY,
editor,
"hydra_AtomEditorComponents_LightComponent.py",
timeout=EDITOR_TIMEOUT,
timeout=120,
expected_lines=expected_lines,
unexpected_lines=unexpected_lines,
halt_on_unexpected=True,
@@ -299,9 +298,10 @@ class TestMaterialEditorBasicTests(object):
generic_launcher,
"hydra_AtomMaterialEditor_BasicTests.py",
run_python="--runpython",
timeout=80,
timeout=120,
expected_lines=expected_lines,
unexpected_lines=unexpected_lines,
halt_on_unexpected=True,
null_renderer=True,
log_file_name="MaterialEditor.log",
)
@@ -51,8 +51,8 @@ class TestAutomationBase:
cls.asset_processor.teardown()
cls._kill_ly_processes()
def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[], use_null_renderer=True):
def _run_test(self, request, workspace, editor, testcase_module, extra_cmdline_args=[], batch_mode=True,
autotest_mode=True, use_null_renderer=True):
test_starttime = time.time()
self.logger = logging.getLogger(__name__)
errors = []
@@ -90,9 +90,13 @@ class TestAutomationBase:
editor_starttime = time.time()
self.logger.debug("Running automated test")
testcase_module_filepath = self._get_testcase_module_filepath(testcase_module)
pycmd = ["--runpythontest", testcase_module_filepath, "-BatchMode", "-autotest_mode", f"-pythontestcase={request.node.originalname}"]
pycmd = ["--runpythontest", testcase_module_filepath, f"-pythontestcase={request.node.originalname}"]
if use_null_renderer:
pycmd += ["-rhi=null"]
if batch_mode:
pycmd += ["-BatchMode"]
if autotest_mode:
pycmd += ["-autotest_mode"]
pycmd += extra_cmdline_args
editor.args.extend(pycmd) # args are added to the WinLauncher start command
editor.start(backupFiles = False, launch_ap = False)
@@ -11,22 +11,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
NAME AutomatedTesting::EditorTests_Main
TEST_SUITE main
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}
PYTEST_MARKS "SUITE_main and not REQUIRES_gpu"
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Editor
)
ly_add_pytest(
NAME AutomatedTesting::EditorTests_Periodic
TEST_SUITE periodic
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}
PYTEST_MARKS "SUITE_periodic and not REQUIRES_gpu"
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
PYTEST_MARKS "not REQUIRES_gpu"
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
@@ -40,8 +26,21 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
TEST_SUITE main
TEST_SERIAL
TEST_REQUIRES gpu
PATH ${CMAKE_CURRENT_LIST_DIR}
PYTEST_MARKS "SUITE_main and REQUIRES_gpu"
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
PYTEST_MARKS "REQUIRES_gpu"
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Editor
)
ly_add_pytest(
NAME AutomatedTesting::EditorTests_Periodic
TEST_SUITE periodic
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
@@ -54,8 +53,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
NAME AutomatedTesting::EditorTests_Sandbox
TEST_SUITE sandbox
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}
PYTEST_MARKS "SUITE_sandbox"
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
@@ -63,4 +61,47 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
COMPONENT
Editor
)
ly_add_pytest(
NAME AutomatedTesting::EditorTests_Main_Optimized
TEST_SUITE main
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py
PYTEST_MARKS "not REQUIRES_gpu"
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Editor
)
ly_add_pytest(
NAME AutomatedTesting::EditorTests_Main_GPU_Optimized
TEST_SUITE main
TEST_SERIAL
TEST_REQUIRES gpu
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py
PYTEST_MARKS "REQUIRES_gpu"
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Editor
)
ly_add_pytest(
NAME AutomatedTesting::EditorTests_Sandbox_Optimized
TEST_SUITE sandbox
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox_Optimized.py
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Editor
)
endif()
@@ -5,30 +5,24 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13660194 : Asset Browser - Filtering
"""
import os
import sys
from PySide2 import QtWidgets, QtTest, QtCore
from PySide2.QtCore import Qt
import azlmbr.legacy.general as general
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
import editor_python_test_tools.hydra_editor_utils as hydra
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
class Tests:
asset_filtered = (
"Asset was filtered to in the Asset Browser",
"Failed to filter to the expected asset"
)
asset_type_filtered = (
"Expected asset type was filtered to in the Asset Browser",
"Failed to filter to the expected asset type"
)
class AssetBrowserSearchFilteringTest(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="AssetBrowser_SearchFiltering", args=["level"])
def AssetBrowser_SearchFiltering():
import editor_python_test_tools.pyside_utils as pyside_utils
@pyside_utils.wrap_async
async def run_test(self):
async def run_test():
"""
Summary:
Asset Browser - Filtering
@@ -60,7 +54,13 @@ class AssetBrowserSearchFilteringTest(EditorTestHelper):
:return: None
"""
self.incorrect_file_found = False
from PySide2 import QtWidgets, QtTest, QtCore
from PySide2.QtCore import Qt
import azlmbr.legacy.general as general
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
def verify_files_appeared(model, allowed_asset_extentions, parent_index=QtCore.QModelIndex()):
indexes = [parent_index]
@@ -74,25 +74,24 @@ class AssetBrowserSearchFilteringTest(EditorTestHelper):
and (cur_data.lower().split(".")[-1] not in allowed_asset_extentions)
and not cur_data[-1] == ")"
):
print(f"Incorrect file found: {cur_data}")
self.incorrect_file_found = True
indexes = list()
break
Report.info(f"Incorrect file found: {cur_data}")
return False
indexes.append(cur_index)
return True
# 1) Open an existing simple level
helper.init_idle()
helper.open_level("Physics", "Base")
# 1) Open level
self.test_success = self.create_level(
self.args["level"],
heightmap_resolution=1024,
heightmap_meters_per_pixel=1,
terrain_texture_resolution=4096,
use_terrain=False,
)
# 2) Open Asset Browser
general.close_pane("Asset Browser")
general.open_pane("Asset Browser")
# 2) Open Asset Browser (if not opened already)
editor_window = pyside_utils.get_editor_main_window()
asset_browser_open = general.is_pane_visible("Asset Browser")
if not asset_browser_open:
Report.info("Opening Asset Browser")
action = pyside_utils.get_action_for_menu_path(editor_window, "Tools", "Asset Browser")
action.trigger()
else:
Report.info("Asset Browser is already open")
editor_window = pyside_utils.get_editor_main_window()
app = QtWidgets.QApplication.instance()
@@ -103,10 +102,9 @@ class AssetBrowserSearchFilteringTest(EditorTestHelper):
asset_browser_tree = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTreeViewWidget")
model_index = pyside_utils.find_child_by_pattern(asset_browser_tree, "cedar.fbx")
pyside_utils.item_view_index_mouse_click(asset_browser_tree, model_index)
is_filtered = pyside_utils.wait_for_condition(
is_filtered = await pyside_utils.wait_for_condition(
lambda: asset_browser_tree.indexBelow(asset_browser_tree.currentIndex()) == QtCore.QModelIndex(), 5.0)
if is_filtered:
print("cedar.fbx asset is filtered in Asset Browser")
Report.result(Tests.asset_filtered, is_filtered)
# 4) Click the "X" in the search bar.
clear_search = asset_browser.findChild(QtWidgets.QToolButton, "ClearToolButton")
@@ -122,40 +120,47 @@ class AssetBrowserSearchFilteringTest(EditorTestHelper):
tree.model().setData(animation_model_index, 2, Qt.CheckStateRole)
general.idle_wait(1.0)
# check asset types after clicking on Animation filter
verify_files_appeared(asset_browser_tree.model(), ["i_caf", "fbx", "xml", "animgraph", "motionset"])
print(f"Animation file type(s) is present in the file tree: {not self.incorrect_file_found}")
asset_type_filter = verify_files_appeared(asset_browser_tree.model(), ["i_caf", "fbx", "xml", "animgraph", "motionset"])
Report.result(Tests.asset_type_filtered, asset_type_filter)
# 6) Add additional filter(FileTag) from the filter menu
self.incorrect_file_found = False
line_edit.setText("FileTag")
filetag_model_index = await pyside_utils.wait_for_child_by_pattern(tree, "FileTag")
tree.model().setData(filetag_model_index, 2, Qt.CheckStateRole)
general.idle_wait(1.0)
# check asset types after clicking on FileTag filter
verify_files_appeared(
more_types_filtered = verify_files_appeared(
asset_browser_tree.model(), ["i_caf", "fbx", "xml", "animgraph", "motionset", "filetag"]
)
print(f"FileTag file type(s) and Animation file type(s) is present in the file tree: {not self.incorrect_file_found}")
Report.result(Tests.asset_type_filtered, more_types_filtered)
# 7) Remove one of the filtered asset types from the list of applied filters
self.incorrect_file_found = False
filter_layout = asset_browser.findChild(QtWidgets.QFrame, "filteredLayout")
animation_close_button = filter_layout.children()[1]
first_close_button = animation_close_button.findChild(QtWidgets.QPushButton, "closeTag")
first_close_button.click()
general.idle_wait(1.0)
# check asset types after removing Animation filter
verify_files_appeared(asset_browser_tree.model(), ["filetag"])
print(f"FileTag file type(s) is present in the file tree after removing Animation filter: {not self.incorrect_file_found}")
remove_filtered = verify_files_appeared(asset_browser_tree.model(), ["filetag"])
Report.result(Tests.asset_type_filtered, remove_filtered)
# 8) Remove all of the filter asset types from the list of filters
filetag_close_button = filter_layout.children()[1]
second_close_button = filetag_close_button.findChild(QtWidgets.QPushButton, "closeTag")
second_close_button.click()
# 9) Close the asset browser
asset_browser.close()
# Click off of the Asset Browser filter window to close it
QtTest.QTest.mouseClick(tree, Qt.LeftButton, Qt.NoModifier)
# 9) Restore Asset Browser tool state and
if not asset_browser_open:
Report.info("Closing Asset Browser")
general.close_pane("Asset Browser")
run_test()
test = AssetBrowserSearchFilteringTest()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(AssetBrowser_SearchFiltering)
@@ -5,124 +5,119 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13660195: Asset Browser - File Tree Navigation
"""
import os
import sys
from PySide2 import QtWidgets, QtTest, QtCore
import azlmbr.legacy.general as general
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
class Tests:
collapse_expand = (
"Asset Browser hierarchy successfully collapsed/expanded",
"Failed to collapse/expand Asset Browser hierarchy"
)
asset_visible = (
"Expected asset is visible in the Asset Browser hierarchy",
"Failed to find expected asset in the Asset Browser hierarchy"
)
scrollbar_visible = (
"Scrollbar is visible",
"Scrollbar was not found"
)
class AssetBrowserTreeNavigationTest(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="AssetBrowser_TreeNavigation", args=["level"])
def AssetBrowser_TreeNavigation():
"""
Summary:
Verify if we are able to expand a file hierarchy in the Asset Browser and ScrollBar appears
appropriately.
def run_test(self):
"""
Summary:
Verify if we are able to expand a file hierarchy in the Asset Browser and ScrollBar appears
appropriately.
Expected Behavior:
The folder list is expanded to display the children of the selected folder.
A scroll bar appears to allow scrolling up and down through the asset browser.
Assets are present in the Asset Browser.
Expected Behavior:
The folder list is expanded to display the children of the selected folder.
A scroll bar appears to allow scrolling up and down through the asset browser.
Assets are present in the Asset Browser.
Test Steps:
1) Open a simple level
2) Open Asset Browser
3) Collapse all files initially
4) Get all Model Indexes
5) Expand each of the folder and verify if it is opened
6) Verify if the ScrollBar appears after expanding the tree
Test Steps:
1) Open a new level
2) Open Asset Browser
3) Collapse all files initially
4) Get all Model Indexes
5) Expand each of the folder and verify if it is opened
6) Verify if the ScrollBar appears after expanding the tree
Note:
- This test file must be called from the Open 3D Engine Editor command terminal
- Any passed and failed tests are written to the Editor.log file.
Parsing the file or running a log_monitor are required to observe the test results.
Note:
- This test file must be called from the Open 3D Engine Editor command terminal
- Any passed and failed tests are written to the Editor.log file.
Parsing the file or running a log_monitor are required to observe the test results.
:return: None
"""
:return: None
"""
from PySide2 import QtWidgets, QtTest, QtCore
def collapse_expand_and_verify(model_index, hierarchy_level):
tree.collapse(model_index)
collapse_success = not tree.isExpanded(model_index)
self.log(f"Level {hierarchy_level} collapsed: {collapse_success}")
tree.expand(model_index)
expand_success = tree.isExpanded(model_index)
self.log(f"Level {hierarchy_level} expanded: {expand_success}")
return collapse_success and expand_success
import azlmbr.legacy.general as general
# This is the hierarchy we are expanding (4 steps inside)
self.file_path = ("AutomatedTesting", "Assets", "ImageGradients", "image_grad_test_gsi.png")
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
# 1) Open a new level
self.test_success = self.create_level(
self.args["level"],
heightmap_resolution=1024,
heightmap_meters_per_pixel=1,
terrain_texture_resolution=4096,
use_terrain=False,
)
def collapse_expand_and_verify(model_index, hierarchy_level):
tree.collapse(model_index)
collapse_success = not tree.isExpanded(model_index)
Report.info(f"Level {hierarchy_level} collapsed: {collapse_success}")
tree.expand(model_index)
expand_success = tree.isExpanded(model_index)
Report.info(f"Level {hierarchy_level} expanded: {expand_success}")
return collapse_success and expand_success
# 2) Open Asset Browser (if not opened already)
editor_window = pyside_utils.get_editor_main_window()
asset_browser_open = general.is_pane_visible("Asset Browser")
if not asset_browser_open:
self.log("Opening Asset Browser")
action = pyside_utils.get_action_for_menu_path(editor_window, "Tools", "Asset Browser")
action.trigger()
else:
self.log("Asset Browser is already open")
# This is the hierarchy we are expanding (4 steps inside)
file_path = ("AutomatedTesting", "Assets", "ImageGradients", "image_grad_test_gsi.png")
# 3) Collapse all files initially
main_window = editor_window.findChild(QtWidgets.QMainWindow)
asset_browser = pyside_utils.find_child_by_hierarchy(main_window, ..., "Asset Browser")
tree = pyside_utils.find_child_by_hierarchy(asset_browser, ..., "m_assetBrowserTreeViewWidget")
scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer")
scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar)
tree.collapseAll()
# 1) Open an existing simple level
helper.init_idle()
helper.open_level("Physics", "Base")
# 4) Get all Model Indexes
model_index_1 = pyside_utils.find_child_by_hierarchy(tree, self.file_path[0])
model_index_2 = pyside_utils.find_child_by_hierarchy(model_index_1, self.file_path[1])
model_index_3 = pyside_utils.find_child_by_hierarchy(model_index_2, self.file_path[2])
model_index_4 = pyside_utils.find_child_by_hierarchy(model_index_3, self.file_path[3])
# 2) Open Asset Browser (if not opened already)
editor_window = pyside_utils.get_editor_main_window()
asset_browser_open = general.is_pane_visible("Asset Browser")
if not asset_browser_open:
Report.info("Opening Asset Browser")
action = pyside_utils.get_action_for_menu_path(editor_window, "Tools", "Asset Browser")
action.trigger()
else:
Report.info("Asset Browser is already open")
# 5) Verify each level of the hierarchy to the file can be collapsed/expanded
self.test_success = collapse_expand_and_verify(model_index_1, 1) and self.test_success
self.test_success = collapse_expand_and_verify(model_index_2, 2) and self.test_success
self.test_success = collapse_expand_and_verify(model_index_3, 3) and self.test_success
self.log(f"Collapse/Expand tests: {self.test_success}")
# 3) Collapse all files initially
main_window = editor_window.findChild(QtWidgets.QMainWindow)
asset_browser = pyside_utils.find_child_by_hierarchy(main_window, ..., "Asset Browser")
tree = pyside_utils.find_child_by_hierarchy(asset_browser, ..., "m_assetBrowserTreeViewWidget")
scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer")
scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar)
tree.collapseAll()
# Select the asset
tree.scrollTo(model_index_4)
pyside_utils.item_view_index_mouse_click(tree, model_index_4)
# 4) Get all Model Indexes
model_index_1 = pyside_utils.find_child_by_hierarchy(tree, file_path[0])
model_index_2 = pyside_utils.find_child_by_hierarchy(model_index_1, file_path[1])
model_index_3 = pyside_utils.find_child_by_hierarchy(model_index_2, file_path[2])
model_index_4 = pyside_utils.find_child_by_hierarchy(model_index_3, file_path[3])
# Verify if the currently selected item model index is same as the Asset Model index
# to prove that it is visible
asset_visible = tree.currentIndex() == model_index_4
self.test_success = asset_visible and self.test_success
self.log(f"Asset visibility test: {asset_visible}")
# 5) Verify each level of the hierarchy to the file can be collapsed/expanded
Report.result(Tests.collapse_expand, collapse_expand_and_verify(model_index_1, 1) and
collapse_expand_and_verify(model_index_2, 2) and collapse_expand_and_verify(model_index_3, 3))
# 6) Verify if the ScrollBar appears after expanding the tree
scrollbar_visible = scroll_bar.isVisible()
self.test_success = scrollbar_visible and self.test_success
self.log(f"Scrollbar visibility test: {scrollbar_visible}")
# Select the asset
tree.scrollTo(model_index_4)
pyside_utils.item_view_index_mouse_click(tree, model_index_4)
# 7) Restore Asset Browser tool state
if not asset_browser_open:
self.log("Closing Asset Browser")
general.close_pane("Asset Browser")
# Verify if the currently selected item model index is same as the Asset Model index
# to prove that it is visible
Report.result(Tests.asset_visible, tree.currentIndex() == model_index_4)
# 6) Verify if the ScrollBar appears after expanding the tree
Report.result(Tests.scrollbar_visible, scroll_bar.isVisible())
# 7) Restore Asset Browser tool state
if not asset_browser_open:
Report.info("Closing Asset Browser")
general.close_pane("Asset Browser")
test = AssetBrowserTreeNavigationTest()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(AssetBrowser_TreeNavigation)
@@ -5,33 +5,13 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13751579: Asset Picker UI/UX
"""
import os
import sys
from PySide2 import QtWidgets, QtTest, QtCore
from PySide2.QtCore import Qt
def AssetPicker_UI_UX():
import azlmbr.asset as asset
import azlmbr.bus as bus
import azlmbr.legacy.general as general
import azlmbr.paths
import azlmbr.math as math
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
import editor_python_test_tools.hydra_editor_utils as hydra
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
class AssetPickerUIUXTest(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="AssetPicker_UI_UX", args=["level"])
import editor_python_test_tools.pyside_utils as pyside_utils
@pyside_utils.wrap_async
async def run_test(self):
async def run_test():
"""
Summary:
Verify the functionality of Asset Picker and UI/UX properties
@@ -45,7 +25,7 @@ class AssetPickerUIUXTest(EditorTestHelper):
The asset picker is closed and the selected asset is assigned to the mesh component.
Test Steps:
1) Open a new level
1) Open a simple level
2) Create entity and add Mesh component
3) Access Entity Inspector
4) Click Asset Picker (Mesh Asset)
@@ -68,10 +48,20 @@ class AssetPickerUIUXTest(EditorTestHelper):
:return: None
"""
self.file_path = ["AutomatedTesting", "Assets", "Objects", "Foliage"]
self.incorrect_file_found = False
self.mesh_asset = "cedar.azmodel"
self.prefix = ""
import os
from PySide2 import QtWidgets, QtTest, QtCore
from PySide2.QtCore import Qt
import azlmbr.asset as asset
import azlmbr.bus as bus
import azlmbr.legacy.general as general
import azlmbr.math as math
import editor_python_test_tools.hydra_editor_utils as hydra
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
file_path = ["AutomatedTesting", "Assets", "Objects", "Foliage"]
def is_asset_assigned(component, interaction_option):
path = os.path.join("assets", "objects", "foliage", "cedar.azmodel")
@@ -80,7 +70,7 @@ class AssetPickerUIUXTest(EditorTestHelper):
result = hydra.get_component_property_value(component, "Controller|Configuration|Mesh Asset")
expected_asset_str = expected_asset_id.invoke("ToString")
result_str = result.invoke("ToString")
print(f"Asset assigned for {interaction_option} option: {expected_asset_str == result_str}")
Report.info(f"Asset assigned for {interaction_option} option: {expected_asset_str == result_str}")
return expected_asset_str == result_str
def move_and_resize_widget(widget):
@@ -89,9 +79,11 @@ class AssetPickerUIUXTest(EditorTestHelper):
x, y = initial_position.x() + 5, initial_position.y() + 5
widget.move(x, y)
curr_position = widget.pos()
move_success = curr_position.x() == x and curr_position.y() == y
self.test_success = move_success and self.test_success
self.log(f"Widget Move Test: {move_success}")
asset_picker_moved = (
"Asset Picker widget moved successfully",
"Failed to move Asset Picker widget"
)
Report.result(asset_picker_moved, curr_position.x() == x and curr_position.y() == y)
# Resize the widget and verify size
width, height = (
@@ -99,9 +91,36 @@ class AssetPickerUIUXTest(EditorTestHelper):
widget.geometry().height() + 10,
)
widget.resize(width, height)
resize_success = widget.geometry().width() == width and widget.geometry().height() == height
self.test_success = resize_success and self.test_success
self.log(f"Widget Resize Test: {resize_success}")
asset_picker_resized = (
"Resized Asset Picker widget successfully",
"Failed to resize Asset Picker widget"
)
Report.result(asset_picker_resized, widget.geometry().width() == width and widget.geometry().height() ==
height)
def verify_expand(model_index, tree):
initially_collapsed = (
"Folder initially collapsed",
"Folder unexpectedly expanded"
)
expanded = (
"Folder expanded successfully",
"Failed to expand folder"
)
# Check initial collapse
Report.result(initially_collapsed, not tree.isExpanded(model_index))
# Expand at the specified index
tree.expand(model_index)
# Verify expansion
Report.result(expanded, tree.isExpanded(model_index))
def verify_collapse(model_index, tree):
collapsed = (
"Folder hierarchy collapsed successfully",
"Failed to collapse folder hierarchy"
)
tree.collapse(model_index)
Report.result(collapsed, not tree.isExpanded(model_index))
def verify_files_appeared(model, allowed_asset_extensions, parent_index=QtCore.QModelIndex()):
indices = [parent_index]
@@ -115,22 +134,20 @@ class AssetPickerUIUXTest(EditorTestHelper):
and (cur_data.lower().split(".")[-1] not in allowed_asset_extensions)
and not cur_data[-1] == ")"
):
print(f"Incorrect file found: {cur_data}")
self.incorrect_file_found = True
indices = list()
break
Report.info(f"Incorrect file found: {cur_data}")
return False
indices.append(cur_index)
self.test_success = not self.incorrect_file_found and self.test_success
return True
def print_message_prefix(message):
print(f"{self.prefix}: {message}")
async def asset_picker(prefix, allowed_asset_extensions, asset, interaction_option):
async def asset_picker(allowed_asset_extensions, asset, interaction_option):
active_modal_widget = await pyside_utils.wait_for_modal_widget()
if active_modal_widget and self.prefix == "":
self.prefix = prefix
if active_modal_widget:
dialog = active_modal_widget.findChildren(QtWidgets.QDialog, "AssetPickerDialogClass")[0]
print_message_prefix(f"Asset Picker title for Mesh: {dialog.windowTitle()}")
asset_picker_title = (
"Asset Picker window is titled as expected",
"Asset Picker window has an unexpected title"
)
Report.result(asset_picker_title, dialog.windowTitle() == "Pick ModelAsset")
tree = dialog.findChildren(QtWidgets.QTreeView, "m_assetBrowserTreeViewWidget")[0]
scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer")
scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar)
@@ -138,39 +155,42 @@ class AssetPickerUIUXTest(EditorTestHelper):
# a) Collapse all the files initially and verify if scroll bar is not visible
tree.collapseAll()
await pyside_utils.wait_for_condition(lambda: not scroll_bar.isVisible(), 0.5)
print_message_prefix(
f"Scroll Bar is not visible before expanding the tree: {not scroll_bar.isVisible()}"
scroll_bar_hidden = (
"Scroll Bar is not visible before tree expansion",
"Scroll Bar is visible before tree expansion"
)
Report.result(scroll_bar_hidden, not scroll_bar.isVisible())
# Get Model Index of the file paths
model_index_1 = pyside_utils.find_child_by_pattern(tree, self.file_path[0])
print(model_index_1.model())
model_index_2 = pyside_utils.find_child_by_pattern(model_index_1, self.file_path[1])
model_index_1 = pyside_utils.find_child_by_pattern(tree, file_path[0])
model_index_2 = pyside_utils.find_child_by_pattern(model_index_1, file_path[1])
# b) Expand/Verify Top folder of file path
print_message_prefix(f"Top level folder initially collapsed: {not tree.isExpanded(model_index_1)}")
tree.expand(model_index_1)
print_message_prefix(f"Top level folder expanded: {tree.isExpanded(model_index_1)}")
verify_expand(model_index_1, tree)
# c) Expand/Verify Nested folder of file path
print_message_prefix(f"Nested folder initially collapsed: {not tree.isExpanded(model_index_2)}")
tree.expand(model_index_2)
print_message_prefix(f"Nested folder expanded: {tree.isExpanded(model_index_2)}")
verify_expand(model_index_2, tree)
# d) Verify if the ScrollBar appears after expanding folders
tree.expandAll()
await pyside_utils.wait_for_condition(lambda: scroll_bar.isVisible(), 0.5)
print_message_prefix(f"Scroll Bar appeared after expanding tree: {scroll_bar.isVisible()}")
scroll_bar_visible = (
"Scroll Bar is visible after tree expansion",
"Scroll Bar is not visible after tree expansion"
)
Report.result(scroll_bar_visible, scroll_bar.isVisible())
# e) Collapse Nested and Top Level folders and verify if collapsed
tree.collapse(model_index_2)
print_message_prefix(f"Nested folder collapsed: {not tree.isExpanded(model_index_2)}")
tree.collapse(model_index_1)
print_message_prefix(f"Top level folder collapsed: {not tree.isExpanded(model_index_1)}")
verify_collapse(model_index_2, tree)
verify_collapse(model_index_1, tree)
# f) Verify if the correct files are appearing in the Asset Picker
verify_files_appeared(tree.model(), allowed_asset_extensions)
print_message_prefix(f"Expected Assets populated in the file picker: {not self.incorrect_file_found}")
asset_picker_correct_files_appear = (
"Expected assets populated in the file picker",
"Found unexpected assets in the file picker"
)
Report.result(asset_picker_correct_files_appear, verify_files_appeared(tree.model(),
allowed_asset_extensions))
# While we are here we can also check if we can resize and move the widget
move_and_resize_widget(active_modal_widget)
@@ -193,16 +213,10 @@ class AssetPickerUIUXTest(EditorTestHelper):
await pyside_utils.click_button_async(ok_button)
elif interaction_option == "enter":
QtTest.QTest.keyClick(tree, Qt.Key_Enter, Qt.NoModifier)
self.prefix = ""
# 1) Open a new level
self.test_success = self.create_level(
self.args["level"],
heightmap_resolution=1024,
heightmap_meters_per_pixel=1,
terrain_texture_resolution=4096,
use_terrain=False,
)
# 1) Open an existing simple level
helper.init_idle()
helper.open_level("Physics", "Base")
# 2) Create entity and add Mesh component
entity_position = math.Vector3(125.0, 136.0, 32.0)
@@ -222,7 +236,7 @@ class AssetPickerUIUXTest(EditorTestHelper):
# Assign Mesh Asset via OK button
pyside_utils.click_button_async(attached_button)
await asset_picker("Mesh Asset", ["azmodel", "fbx"], "cedar (ModelAsset)", "ok")
await asset_picker(["azmodel", "fbx"], "cedar (ModelAsset)", "ok")
# 5) Verify if Mesh Asset is assigned
try:
@@ -231,7 +245,11 @@ class AssetPickerUIUXTest(EditorTestHelper):
except pyside_utils.EventLoopTimeoutException as err:
print(err)
mesh_success = False
self.test_success = mesh_success and self.test_success
mesh_asset_assigned_ok = (
"Successfully assigned Mesh asset via OK button",
"Failed to assign Mesh asset via OK button"
)
Report.result(mesh_asset_assigned_ok, mesh_success)
# Clear Mesh Asset
hydra.get_set_test(entity, 0, "Controller|Configuration|Mesh Asset", None)
@@ -242,7 +260,7 @@ class AssetPickerUIUXTest(EditorTestHelper):
# Assign Mesh Asset via Enter
pyside_utils.click_button_async(attached_button)
await asset_picker("Mesh Asset", ["azmodel", "fbx"], "cedar (ModelAsset)", "enter")
await asset_picker(["azmodel", "fbx"], "cedar (ModelAsset)", "enter")
# 5) Verify if Mesh Asset is assigned
try:
@@ -251,8 +269,16 @@ class AssetPickerUIUXTest(EditorTestHelper):
except pyside_utils.EventLoopTimeoutException as err:
print(err)
mesh_success = False
self.test_success = mesh_success and self.test_success
mesh_asset_assigned_enter = (
"Successfully assigned Mesh asset via Enter button",
"Failed to assign Mesh asset via Enter button"
)
Report.result(mesh_asset_assigned_enter, mesh_success)
run_test()
test = AssetPickerUIUXTest()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(AssetPicker_UI_UX)
@@ -5,36 +5,44 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C6351273: Create a new level
C6384955: Basic Workflow: Entity Manipulation in the Outliner
C16929880: Add Delete Components
C15167490: Save a level
C15167491: Export a level
"""
import os
import sys
from PySide2 import QtWidgets
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.entity as entity
import azlmbr.math as math
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
import editor_python_test_tools.hydra_editor_utils as hydra
class Tests:
level_created = (
"New level created successfully",
"Failed to create new level"
)
new_entity_created = (
"New entity created successfully",
"Failed to create a new entity"
)
child_entity_created = (
"New child entity created successfully",
"Failed to create new child entity"
)
component_added = (
"Component added to entity successfully",
"Failed to add component to entity"
)
component_updated = (
"Component property updated successfully",
"Failed to update component property"
)
component_removed = (
"Component removed from entity successfully",
"Failed to remove component from entity"
)
level_saved_and_exported = (
"Level saved and exported successfully",
"Failed to save/export level"
)
class TestBasicEditorWorkflows(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="BasicEditorWorkflows_LevelEntityComponent", args=["level"])
def BasicEditorWorkflows_LevelEntityComponentCRUD():
import editor_python_test_tools.pyside_utils as pyside_utils
@pyside_utils.wrap_async
async def run_test(self):
async def run_test():
"""
Summary:
Open O3DE editor and check if basic Editor workflows are completable.
@@ -55,6 +63,18 @@ class TestBasicEditorWorkflows(EditorTestHelper):
:return: None
"""
import os
from PySide2 import QtWidgets
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.entity as entity
import azlmbr.math as math
import azlmbr.paths
import editor_python_test_tools.hydra_editor_utils as hydra
from editor_python_test_tools.utils import Report
def find_entity_by_name(entity_name):
search_filter = entity.SearchFilter()
search_filter.names = [entity_name]
@@ -64,6 +84,7 @@ class TestBasicEditorWorkflows(EditorTestHelper):
return None
# 1) Create a new level
level = "tmp_level"
editor_window = pyside_utils.get_editor_main_window()
new_level_action = pyside_utils.get_action_for_menu_path(editor_window, "File", "New Level")
pyside_utils.trigger_action_async(new_level_action)
@@ -71,21 +92,17 @@ class TestBasicEditorWorkflows(EditorTestHelper):
new_level_dlg = active_modal_widget.findChild(QtWidgets.QWidget, "CNewLevelDialog")
if new_level_dlg:
if new_level_dlg.windowTitle() == "New Level":
self.log("New Level dialog opened")
Report.info("New Level dialog opened")
grp_box = new_level_dlg.findChild(QtWidgets.QGroupBox, "STATIC_GROUP1")
level_name = grp_box.findChild(QtWidgets.QLineEdit, "LEVEL")
level_name.setText(self.args["level"])
level_name.setText(level)
button_box = new_level_dlg.findChild(QtWidgets.QDialogButtonBox, "buttonBox")
button_box.button(QtWidgets.QDialogButtonBox.Ok).click()
# Verify new level was created successfully
level_create_success = await pyside_utils.wait_for_condition(lambda: editor.EditorToolsApplicationRequestBus(
bus.Broadcast, "GetCurrentLevelName") == self.args["level"], 5.0)
self.test_success = level_create_success
self.log(f"Create and load new level: {level_create_success}")
# Execute EditorTestHelper setup since level was created outside of EditorTestHelper's methods
self.test_success = self.test_success and self.after_level_load()
bus.Broadcast, "GetCurrentLevelName") == level, 5.0)
Report.critical_result(Tests.level_created, level_create_success)
# 2) Delete existing entities, and create and manipulate new entities via Entity Inspector
search_filter = azlmbr.entity.SearchFilter()
@@ -99,8 +116,7 @@ class TestBasicEditorWorkflows(EditorTestHelper):
# Find the new entity
parent_entity_id = find_entity_by_name("Entity1")
parent_entity_success = await pyside_utils.wait_for_condition(lambda: parent_entity_id is not None, 5.0)
self.test_success = self.test_success and parent_entity_success
self.log(f"New entity creation: {parent_entity_success}")
Report.critical_result(Tests.new_entity_created, parent_entity_success)
# TODO: Replace Hydra call to creates child entity and add components with context menu triggering - LYN-3951
# Create a new child entity
@@ -111,29 +127,27 @@ class TestBasicEditorWorkflows(EditorTestHelper):
# Verify entity hierarchy
child_entity.get_parent_info()
self.test_success = self.test_success and child_entity.parent_id == parent_entity_id
self.log(f"Create entity hierarchy: {child_entity.parent_id == parent_entity_id}")
Report.result(Tests.child_entity_created, child_entity.parent_id == parent_entity_id)
# 3) Add/configure a component on an entity
# Add component and verify success
child_entity.add_component("Box Shape")
component_add_success = self.wait_for_condition(lambda: hydra.has_components(child_entity.id, ["Box Shape"]), 5.0)
self.test_success = self.test_success and component_add_success
self.log(f"Add component: {component_add_success}")
component_add_success = await pyside_utils.wait_for_condition(lambda: hydra.has_components(child_entity.id,
["Box Shape"]), 5.0)
Report.result(Tests.component_added, component_add_success)
# Update the component
dimensions_to_set = math.Vector3(16.0, 16.0, 16.0)
child_entity.get_set_test(0, "Box Shape|Box Configuration|Dimensions", dimensions_to_set)
box_shape_dimensions = hydra.get_component_property_value(child_entity.components[0], "Box Shape|Box Configuration|Dimensions")
self.test_success = self.test_success and box_shape_dimensions == dimensions_to_set
self.log(f"Component update: {box_shape_dimensions == dimensions_to_set}")
box_shape_dimensions = hydra.get_component_property_value(child_entity.components[0],
"Box Shape|Box Configuration|Dimensions")
Report.result(Tests.component_updated, box_shape_dimensions == dimensions_to_set)
# Remove the component
child_entity.remove_component("Box Shape")
component_rem_success = self.wait_for_condition(lambda: not hydra.has_components(child_entity.id, ["Box Shape"]),
5.0)
self.test_success = self.test_success and component_rem_success
self.log(f"Remove component: {component_rem_success}")
component_rem_success = await pyside_utils.wait_for_condition(lambda: not hydra.has_components(child_entity.id,
["Box Shape"]), 5.0)
Report.result(Tests.component_removed, component_rem_success)
# 4) Save the level
save_level_action = pyside_utils.get_action_for_menu_path(editor_window, "File", "Save")
@@ -143,12 +157,15 @@ class TestBasicEditorWorkflows(EditorTestHelper):
export_action = pyside_utils.get_action_for_menu_path(editor_window, "Game", "Export to Engine")
pyside_utils.trigger_action_async(export_action)
level_pak_file = os.path.join(
"AutomatedTesting", "Levels", self.args["level"], "level.pak"
"AutomatedTesting", "Levels", level, "level.pak"
)
export_success = self.wait_for_condition(lambda: os.path.exists(level_pak_file), 5.0)
self.test_success = self.test_success and export_success
self.log(f"Save and Export: {export_success}")
export_success = await pyside_utils.wait_for_condition(lambda: os.path.exists(level_pak_file), 5.0)
Report.result(Tests.level_saved_and_exported, export_success)
run_test()
test = TestBasicEditorWorkflows()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(BasicEditorWorkflows_LevelEntityComponentCRUD)
@@ -5,37 +5,39 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C16929880: Add Delete Components
"""
import os
import sys
from PySide2 import QtWidgets, QtTest, QtCore
from PySide2.QtCore import Qt
import azlmbr.legacy.general as general
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.entity as entity
import azlmbr.math as math
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
import editor_python_test_tools.hydra_editor_utils as hydra
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
class Tests:
entity_created = (
"Entity created successfully",
"Failed to create entity"
)
box_component_added = (
"Box Shape component added to entity",
"Failed to add Box Shape component to entity"
)
mesh_component_added = (
"Mesh component added to entity",
"Failed to add Mesh component to entity"
)
mesh_component_deleted = (
"Mesh component removed from entity",
"Failed to remove Mesh component from entity"
)
mesh_component_delete_undo = (
"Mesh component removal was successfully undone",
"Failed to undo Mesh component removal"
)
class AddDeleteComponentsTest(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="ComponentCRUD_Add_Delete_Components", args=["level"])
def ComponentCRUD_Add_Delete_Components():
import editor_python_test_tools.pyside_utils as pyside_utils
@pyside_utils.wrap_async
async def run_test(self):
async def run_test():
"""
Summary:
Add/Delete Components to an entity.
Add/Delete Components to/from an entity.
Expected Behavior:
1) Components can be added to an entity.
@@ -61,36 +63,43 @@ class AddDeleteComponentsTest(EditorTestHelper):
:return: None
"""
from PySide2 import QtWidgets, QtTest, QtCore
from PySide2.QtCore import Qt
import azlmbr.legacy.general as general
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.entity as entity
import azlmbr.math as math
import editor_python_test_tools.hydra_editor_utils as hydra
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
async def add_component(component_name):
pyside_utils.click_button_async(add_comp_btn)
popup = await pyside_utils.wait_for_popup_widget()
tree = popup.findChild(QtWidgets.QTreeView, "Tree")
component_index = pyside_utils.find_child_by_pattern(tree, component_name)
if component_index.isValid():
print(f"{component_name} found")
Report.info(f"{component_name} found")
tree.expand(component_index)
tree.setCurrentIndex(component_index)
QtTest.QTest.keyClick(tree, Qt.Key_Enter, Qt.NoModifier)
# 1) Open level
self.test_success = self.create_level(
self.args["level"],
heightmap_resolution=1024,
heightmap_meters_per_pixel=1,
terrain_texture_resolution=4096,
use_terrain=False,
)
# 1) Open an existing simple level
helper.init_idle()
helper.open_level("Physics", "Base")
# 2) Create entity
entity_position = math.Vector3(125.0, 136.0, 32.0)
entity_id = editor.ToolsApplicationRequestBus(
bus.Broadcast, "CreateNewEntityAtPosition", entity_position, entity.EntityId()
)
if entity_id.IsValid():
print("Entity Created")
Report.critical_result(Tests.entity_created, entity_id.IsValid())
# 3) Select the newly created entity
general.select_object("Entity2")
general.select_object("Entity1")
# Give the Entity Inspector time to fully create its contents
general.idle_wait(0.5)
@@ -100,11 +109,11 @@ class AddDeleteComponentsTest(EditorTestHelper):
entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector")
add_comp_btn = entity_inspector.findChild(QtWidgets.QPushButton, "m_addComponentButton")
await add_component("Box Shape")
print(f"Box Shape Component added: {hydra.has_components(entity_id, ['Box Shape'])}")
Report.result(Tests.box_component_added, hydra.has_components(entity_id, ['Box Shape']))
# 5) Add/verify Mesh component
await add_component("Mesh")
print(f"Mesh Component added: {hydra.has_components(entity_id, ['Mesh'])}")
Report.result(Tests.mesh_component_added, hydra.has_components(entity_id, ['Mesh']))
# 6) Delete Mesh Component
general.idle_wait(0.5)
@@ -116,15 +125,17 @@ class AddDeleteComponentsTest(EditorTestHelper):
QtTest.QTest.mouseClick(mesh_frame, Qt.LeftButton, Qt.NoModifier)
QtTest.QTest.keyClick(mesh_frame, Qt.Key_Delete, Qt.NoModifier)
success = await pyside_utils.wait_for_condition(lambda: not hydra.has_components(entity_id, ['Mesh']), 5.0)
if success:
print(f"Mesh Component deleted: {not hydra.has_components(entity_id, ['Mesh'])}")
Report.result(Tests.mesh_component_deleted, success)
# 7) Undo deletion of component
QtTest.QTest.keyPress(entity_inspector, Qt.Key_Z, Qt.ControlModifier)
success = await pyside_utils.wait_for_condition(lambda: hydra.has_components(entity_id, ['Mesh']), 5.0)
if success:
print(f"Mesh Component deletion undone: {hydra.has_components(entity_id, ['Mesh'])}")
Report.result(Tests.mesh_component_delete_undo, success)
run_test()
test = AddDeleteComponentsTest()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(ComponentCRUD_Add_Delete_Components)
@@ -7,27 +7,32 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
C6376081: Basic Function: Docked/Undocked Tools
"""
import os
import sys
from PySide2 import QtWidgets, QtTest, QtCore
import azlmbr.legacy.general as general
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.entity as entity
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
class Tests:
all_tools_docked = (
"The tools are all docked together in a tabbed widget",
"Failed to dock all tools together"
)
docked_outliner_works = (
"Entity Outliner works when docked, can select an Entity",
"Failed to select an Entity in the Outliner while docked"
)
docked_inspector_works = (
"Entity Inspector works when docked, Entity name changed",
"Failed to change Entity name in the Inspector while docked"
)
docked_console_works = (
"Console works when docked, sent a Console Command",
"Failed to send Console Command in the Console while docked"
)
class TestDockingBasicDockedTools(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="Docking_BasicDockedTools", args=["level"])
def Docking_BasicDockedTools():
import editor_python_test_tools.pyside_utils as pyside_utils
@pyside_utils.wrap_async
async def run_test(self):
async def run_test():
"""
Summary:
Test that tools still work as expected when docked together.
@@ -50,14 +55,19 @@ class TestDockingBasicDockedTools(EditorTestHelper):
:return: None
"""
# Create a level since we are going to be dealing with an Entity.
self.create_level(
self.args["level"],
heightmap_resolution=1024,
heightmap_meters_per_pixel=1,
terrain_texture_resolution=4096,
use_terrain=False,
)
from PySide2 import QtWidgets, QtTest, QtCore
import azlmbr.legacy.general as general
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.entity as entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
# Open an existing simple level
helper.init_idle()
helper.open_level("Physics", "Base")
# Make sure the Entity Outliner, Entity Inspector and Console tools are open
general.open_pane("Entity Outliner (PREVIEW)")
@@ -101,12 +111,14 @@ class TestDockingBasicDockedTools(EditorTestHelper):
entity_inspector_parent = entity_inspector.parentWidget()
entity_outliner_parent = entity_outliner.parentWidget()
console_parent = console.parentWidget()
print(f"Entity Inspector parent = {entity_inspector_parent}, Entity Outliner parent = {entity_outliner_parent}, Console parent = {console_parent}")
return isinstance(entity_inspector_parent, QtWidgets.QStackedWidget) and (entity_inspector_parent == entity_outliner_parent) and (entity_outliner_parent == console_parent)
Report.info(f"Entity Inspector parent = {entity_inspector_parent}, Entity Outliner parent = "
f"{entity_outliner_parent}, Console parent = {console_parent}")
return isinstance(entity_inspector_parent, QtWidgets.QStackedWidget) and \
(entity_inspector_parent == entity_outliner_parent) and \
(entity_outliner_parent == console_parent)
success = await pyside_utils.wait_for(check_all_panes_tabbed, timeout=3.0)
if success:
print("The tools are all docked together in a tabbed widget")
Report.result(Tests.all_tools_docked, success)
# 2.1,2) Select an Entity in the Entity Outliner.
entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector")
@@ -116,8 +128,7 @@ class TestDockingBasicDockedTools(EditorTestHelper):
test_entity_index = pyside_utils.find_child_by_pattern(object_tree, entity_original_name)
object_tree.clearSelection()
object_tree.setCurrentIndex(test_entity_index)
if object_tree.currentIndex():
print("Entity Outliner works when docked, can select an Entity")
Report.result(Tests.docked_outliner_works, object_tree.currentIndex() == test_entity_index)
# 2.3,4) Change the name of the selected Entity via the Entity Inspector.
entity_inspector_name_field = entity_inspector.findChild(QtWidgets.QLineEdit, "m_entityNameEditor")
@@ -125,14 +136,23 @@ class TestDockingBasicDockedTools(EditorTestHelper):
entity_inspector_name_field.setText(expected_new_name)
QtTest.QTest.keyClick(entity_inspector_name_field, QtCore.Qt.Key_Enter)
entity_new_name = editor.EditorEntityInfoRequestBus(bus.Event, "GetName", entity_id)
if entity_new_name == expected_new_name:
print(f"Entity Inspector works when docked, Entity name changed to {entity_new_name}")
Report.result(Tests.docked_inspector_works, entity_new_name == expected_new_name)
# 2.5,6) Send a console command.
console_line_edit = console.findChild(QtWidgets.QLineEdit, "lineEdit")
console_line_edit.setText("Hello, world!")
console_line_edit.setText("t_Scale 2")
QtTest.QTest.keyClick(console_line_edit, QtCore.Qt.Key_Enter)
general.get_cvar("t_Scale")
Report.result(Tests.docked_console_works, general.get_cvar("t_Scale") == "2")
# Reset the altered cvar
console_line_edit.setText("t_Scale 1")
QtTest.QTest.keyClick(console_line_edit, QtCore.Qt.Key_Enter)
run_test()
test = TestDockingBasicDockedTools()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(Docking_BasicDockedTools)
@@ -5,32 +5,36 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C1506881: Adding/Removing Event Groups
"""
import os
import sys
from PySide2 import QtWidgets
class Tests:
asset_editor_opened = (
"Successfully opened the Asset Editor",
"Failed to open the Asset Editor"
)
event_groups_added = (
"Successfully added event groups via +",
"Failed to add event groups"
)
single_event_group_deleted = (
"Successfully deleted an event group",
"Failed to delete event group"
)
all_event_groups_deleted = (
"Successfully deleted all event groups",
"Failed to delete all event groups"
)
asset_editor_closed = (
"Successfully closed the Asset Editor",
"Failed to close the Asset Editor"
)
import azlmbr.legacy.general as general
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.entity as entity
import azlmbr.math as math
import azlmbr.paths
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
import editor_python_test_tools.hydra_editor_utils as hydra
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.editor_test_helper import EditorTestHelper
def InputBindings_Add_Remove_Input_Events():
class AddRemoveInputEventsTest(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="InputBindings_Add_Remove_Input_Events", args=["level"])
import editor_python_test_tools.pyside_utils as pyside_utils
@pyside_utils.wrap_async
async def run_test(self):
async def run_test():
"""
Summary:
Verify if we are able add/remove input events in inputbindings file.
@@ -42,7 +46,7 @@ class AddRemoveInputEventsTest(EditorTestHelper):
Test Steps:
1) Open a new level
1) Open an existing level
2) Open Asset Editor
3) Access Asset Editor
4) Create a new .inputbindings file and add event groups
@@ -61,6 +65,13 @@ class AddRemoveInputEventsTest(EditorTestHelper):
:return: None
"""
from PySide2 import QtWidgets
import azlmbr.legacy.general as general
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
def open_asset_editor():
general.open_pane("Asset Editor")
return general.is_pane_visible("Asset Editor")
@@ -69,17 +80,12 @@ class AddRemoveInputEventsTest(EditorTestHelper):
general.close_pane("Asset Editor")
return not general.is_pane_visible("Asset Editor")
# 1) Open a new level
self.test_success = self.create_level(
self.args["level"],
heightmap_resolution=1024,
heightmap_meters_per_pixel=1,
terrain_texture_resolution=4096,
use_terrain=False,
)
# 1) Open an existing simple level
helper.init_idle()
helper.open_level("Physics", "Base")
# 2) Open Asset Editor
print(f"Asset Editor opened: {open_asset_editor()}")
Report.result(Tests.asset_editor_opened, open_asset_editor())
# 3) Access Asset Editor
editor_window = pyside_utils.get_editor_main_window()
@@ -103,8 +109,7 @@ class AddRemoveInputEventsTest(EditorTestHelper):
# 5) Verify if there are 3 elements in the Input Event Groups label
no_of_elements_label = input_event_groups.findChild(QtWidgets.QLabel, "DefaultLabel")
success = await pyside_utils.wait_for_condition(lambda: "3 elements" in no_of_elements_label.text(), 2.0)
if success:
print("New Event Groups added when + is clicked")
Report.result(Tests.event_groups_added, success)
# 6) Delete one event group
event = asset_editor_widget.findChildren(QtWidgets.QFrame, "<Unspecified Event>")[0]
@@ -121,11 +126,11 @@ class AddRemoveInputEventsTest(EditorTestHelper):
input_event_group = input_event_groups[1]
no_of_elements_label = input_event_group.findChild(QtWidgets.QLabel, "DefaultLabel")
return no_of_elements_label.text()
return ""
return "";
success = await pyside_utils.wait_for_condition(lambda: "2 elements" in get_elements_label_text(asset_editor_widget), 2.0)
if success:
print("Event Group deleted when the Delete button is clicked on an Event Group")
success = await pyside_utils.wait_for_condition(lambda: "2 elements" in
get_elements_label_text(asset_editor_widget), 2.0)
Report.result(Tests.single_event_group_deleted, success)
# 8) Click on Delete button to delete all the Event Groups
# First QToolButton child of active input_event_groups is +, Second QToolButton is Delete
@@ -141,13 +146,17 @@ class AddRemoveInputEventsTest(EditorTestHelper):
yes_button.click()
# 9) Verify if all the elements are deleted
success = await pyside_utils.wait_for_condition(lambda: "0 elements" in get_elements_label_text(asset_editor_widget), 2.0)
if success:
print("All event groups deleted on clicking the Delete button")
success = await pyside_utils.wait_for_condition(lambda: "0 elements" in
get_elements_label_text(asset_editor_widget), 2.0)
Report.result(Tests.all_event_groups_deleted, success)
# 10) Close Asset Editor
print(f"Asset Editor closed: {close_asset_editor()}")
Report.result(Tests.asset_editor_closed, close_asset_editor())
run_test()
test = AddRemoveInputEventsTest()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(InputBindings_Add_Remove_Input_Events)
@@ -5,93 +5,78 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C24064529: Base Edit Menu Options
"""
import os
import sys
def Menus_EditMenuOptions_Work():
"""
Summary:
Interact with Edit Menu options and verify if all the options are working.
import azlmbr.paths
Expected Behavior:
The Edit menu functions normally.
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
Test Steps:
1) Open an existing level
2) Interact with Edit Menu options
Note:
- This test file must be called from the O3DE Editor command terminal
- Any passed and failed tests are written to the Editor.log file.
Parsing the file or running a log_monitor are required to observe the test results.
class TestEditMenuOptions(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="Menus_EditMenuOptions", args=["level"])
:return: None
"""
def run_test(self):
"""
Summary:
Interact with Edit Menu options and verify if all the options are working.
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
Expected Behavior:
The Edit menu functions normally.
edit_menu_options = [
("Undo",),
("Redo",),
("Duplicate",),
("Delete",),
("Select All",),
("Invert Selection",),
("Toggle Pivot Location",),
("Reset Entity Transform",),
("Reset Manipulator",),
("Reset Transform (Local)",),
("Reset Transform (World)",),
("Hide Selection",),
("Show All",),
("Modify", "Snap", "Snap angle"),
("Modify", "Transform Mode", "Move"),
("Modify", "Transform Mode", "Rotate"),
("Modify", "Transform Mode", "Scale"),
("Editor Settings", "Global Preferences"),
("Editor Settings", "Editor Settings Manager"),
("Editor Settings", "Keyboard Customization", "Customize Keyboard"),
("Editor Settings", "Keyboard Customization", "Export Keyboard Settings"),
("Editor Settings", "Keyboard Customization", "Import Keyboard Settings"),
]
Test Steps:
1) Create a temp level
2) Interact with Edit Menu options
# 1) Open an existing simple level
helper.init_idle()
helper.open_level("Physics", "Base")
Note:
- This test file must be called from the O3DE Editor command terminal
- Any passed and failed tests are written to the Editor.log file.
Parsing the file or running a log_monitor are required to observe the test results.
:return: None
"""
edit_menu_options = [
("Undo",),
("Redo",),
("Duplicate",),
("Delete",),
("Select All",),
("Invert Selection",),
("Toggle Pivot Location",),
("Reset Entity Transform",),
("Reset Manipulator",),
("Reset Transform (Local)",),
("Reset Transform (World)",),
("Hide Selection",),
("Show All",),
("Modify", "Snap", "Snap angle"),
("Modify", "Transform Mode", "Move"),
("Modify", "Transform Mode", "Rotate"),
("Modify", "Transform Mode", "Scale"),
("Editor Settings", "Global Preferences"),
("Editor Settings", "Editor Settings Manager"),
("Editor Settings", "Keyboard Customization", "Customize Keyboard"),
("Editor Settings", "Keyboard Customization", "Export Keyboard Settings"),
("Editor Settings", "Keyboard Customization", "Import Keyboard Settings"),
]
# 1) Create and open the temp level
self.test_success = self.create_level(
self.args["level"],
heightmap_resolution=1024,
heightmap_meters_per_pixel=1,
terrain_texture_resolution=4096,
use_terrain=False,
)
def on_action_triggered(action_name):
print(f"{action_name} Action triggered")
# 2) Interact with Edit Menu options
# 2) Interact with Edit Menu options
editor_window = pyside_utils.get_editor_main_window()
for option in edit_menu_options:
try:
editor_window = pyside_utils.get_editor_main_window()
for option in edit_menu_options:
action = pyside_utils.get_action_for_menu_path(editor_window, "Edit", *option)
trig_func = lambda: on_action_triggered(action.iconText())
action.triggered.connect(trig_func)
action.trigger()
action.triggered.disconnect(trig_func)
action = pyside_utils.get_action_for_menu_path(editor_window, "Edit", *option)
action.trigger()
action_triggered = True
except Exception as e:
self.test_success = False
action_triggered = False
print(e)
menu_action_triggered = (
f"{action.iconText()} action triggered successfully",
f"Failed to trigger {action.iconText()} action"
)
Report.result(menu_action_triggered, action_triggered)
test = TestEditMenuOptions()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(Menus_EditMenuOptions_Work)
@@ -5,80 +5,69 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import sys
import azlmbr.paths
def Menus_FileMenuOptions_Work():
"""
Summary:
Interact with File Menu options and verify if all the options are working.
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
Expected Behavior:
The File menu functions normally.
Test Steps:
1) Open level
2) Interact with File Menu options
class TestFileMenuOptions(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="file_menu_options: ", args=["level"])
Note:
- This test file must be called from the O3DE Editor command terminal
- Any passed and failed tests are written to the Editor.log file.
Parsing the file or running a log_monitor are required to observe the test results.
def run_test(self):
"""
Summary:
Interact with File Menu options and verify if all the options are working.
:return: None
"""
Expected Behavior:
The File menu functions normally.
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
Test Steps:
1) Open level
2) Interact with File Menu options
file_menu_options = [
("New Level",),
("Open Level",),
("Import",),
("Save",),
("Save As",),
("Save Level Statistics",),
("Edit Project Settings",),
("Edit Platform Settings",),
("New Project",),
("Open Project",),
("Show Log File",),
("Resave All Slices",),
("Exit",),
]
Note:
- This test file must be called from the O3DE Editor command terminal
- Any passed and failed tests are written to the Editor.log file.
Parsing the file or running a log_monitor are required to observe the test results.
# 1) Open an existing simple level
helper.init_idle()
helper.open_level("Physics", "Base")
:return: None
"""
file_menu_options = [
("New Level",),
("Open Level",),
("Import",),
("Save",),
("Save As",),
("Save Level Statistics",),
("Edit Project Settings",),
("Edit Platform Settings",),
("New Project",),
("Open Project",),
("Show Log File",),
("Resave All Slices",),
("Exit",),
]
# 1) Open level
self.test_success = self.create_level(
self.args["level"],
heightmap_resolution=1024,
heightmap_meters_per_pixel=1,
terrain_texture_resolution=4096,
use_terrain=False,
)
def on_action_triggered(action_name):
print(f"{action_name} Action triggered")
# 2) Interact with File Menu options
# 2) Interact with File Menu options
editor_window = pyside_utils.get_editor_main_window()
for option in file_menu_options:
try:
editor_window = pyside_utils.get_editor_main_window()
for option in file_menu_options:
action = pyside_utils.get_action_for_menu_path(editor_window, "File", *option)
trig_func = lambda: on_action_triggered(action.iconText())
action.triggered.connect(trig_func)
action.trigger()
action.triggered.disconnect(trig_func)
action = pyside_utils.get_action_for_menu_path(editor_window, "File", *option)
action.trigger()
action_triggered = True
except Exception as e:
self.test_success = False
action_triggered = False
print(e)
menu_action_triggered = (
f"{action.iconText()} action triggered successfully",
f"Failed to trigger {action.iconText()} action"
)
Report.result(menu_action_triggered, action_triggered)
test = TestFileMenuOptions()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(Menus_FileMenuOptions_Work)
@@ -5,81 +5,66 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C24064534: The View menu options function normally
"""
import os
import sys
def Menus_ViewMenuOptions_Work():
"""
Summary:
Interact with View Menu options and verify if all the options are working.
import azlmbr.paths
Expected Behavior:
The View menu functions normally.
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
from editor_python_test_tools.editor_test_helper import EditorTestHelper
import editor_python_test_tools.pyside_utils as pyside_utils
Test Steps:
1) Open an existing level
2) Interact with View Menu options
Note:
- This test file must be called from the O3DE Editor command terminal
- Any passed and failed tests are written to the Editor.log file.
Parsing the file or running a log_monitor are required to observe the test results.
class TestViewMenuOptions(EditorTestHelper):
def __init__(self):
EditorTestHelper.__init__(self, log_prefix="Menus_EditMenuOptions", args=["level"])
:return: None
"""
def run_test(self):
"""
Summary:
Interact with View Menu options and verify if all the options are working.
import editor_python_test_tools.pyside_utils as pyside_utils
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
Expected Behavior:
The View menu functions normally.
view_menu_options = [
("Center on Selection",),
("Show Quick Access Bar",),
("Viewport", "Configure Layout"),
("Viewport", "Go to Position"),
("Viewport", "Center on Selection"),
("Viewport", "Go to Location"),
("Viewport", "Remember Location"),
("Viewport", "Switch Camera"),
("Viewport", "Show/Hide Helpers"),
("Refresh Style",),
]
Test Steps:
1) Create a temp level
2) Interact with View Menu options
# 1) Open an existing simple level
helper.init_idle()
helper.open_level("Physics", "Base")
Note:
- This test file must be called from the O3DE Editor command terminal
- Any passed and failed tests are written to the Editor.log file.
Parsing the file or running a log_monitor are required to observe the test results.
:return: None
"""
view_menu_options = [
("Center on Selection",),
("Show Quick Access Bar",),
("Viewport", "Configure Layout"),
("Viewport", "Go to Position"),
("Viewport", "Center on Selection"),
("Viewport", "Go to Location"),
("Viewport", "Remember Location"),
("Viewport", "Switch Camera"),
("Viewport", "Show/Hide Helpers"),
("Refresh Style",),
]
# 1) Create and open the temp level
self.test_success = self.create_level(
self.args["level"],
heightmap_resolution=1024,
heightmap_meters_per_pixel=1,
terrain_texture_resolution=4096,
use_terrain=False,
)
def on_action_triggered(action_name):
print(f"{action_name} Action triggered")
# 2) Interact with View Menu options
# 2) Interact with View Menu options
editor_window = pyside_utils.get_editor_main_window()
for option in view_menu_options:
try:
editor_window = pyside_utils.get_editor_main_window()
for option in view_menu_options:
action = pyside_utils.get_action_for_menu_path(editor_window, "View", *option)
trig_func = lambda: on_action_triggered(action.iconText())
action.triggered.connect(trig_func)
action.trigger()
action.triggered.disconnect(trig_func)
action = pyside_utils.get_action_for_menu_path(editor_window, "View", *option)
action.trigger()
action_triggered = True
except Exception as e:
self.test_success = False
action_triggered = False
print(e)
menu_action_triggered = (
f"{action.iconText()} action triggered successfully",
f"Failed to trigger {action.iconText()} action"
)
Report.result(menu_action_triggered, action_triggered)
test = TestViewMenuOptions()
test.run()
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(Menus_ViewMenuOptions_Work)
@@ -0,0 +1,43 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
import sys
import ly_test_tools.environment.file_system as file_system
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
from base import TestAutomationBase
@pytest.fixture
def remove_test_level(request, workspace, project):
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True)
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True)
request.addfinalizer(teardown)
@pytest.mark.SUITE_main
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(TestAutomationBase):
def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform,
remove_test_level):
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False)
@pytest.mark.REQUIRES_gpu
def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform,
remove_test_level):
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False,
use_null_renderer=False)
@@ -0,0 +1,75 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
import ly_test_tools.environment.file_system as file_system
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
@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 TestAutomationNoAutoTestMode(EditorTestSuite):
# Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests
# interact with modal dialogs
global_extra_cmdline_args = []
class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest):
# Custom teardown to remove slice asset created during test
def teardown(self, request, workspace, editor, editor_test_results, launcher_platform):
file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")],
True, True)
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
@pytest.mark.REQUIRES_gpu
class test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(EditorSingleTest):
# Disable null renderer
use_null_renderer = False
# Custom teardown to remove slice asset created during test
def teardown(self, request, workspace, editor, editor_test_results, launcher_platform):
file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")],
True, True)
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest):
from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
class test_AssetPicker_UI_UX(EditorSharedTest):
from .EditorScripts import AssetPicker_UI_UX as test_module
@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 TestAutomationAutoTestMode(EditorTestSuite):
# Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
global_extra_cmdline_args = ["-autotest_mode"]
class test_AssetBrowser_TreeNavigation(EditorSharedTest):
from .EditorScripts import AssetBrowser_TreeNavigation as test_module
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
class test_AssetBrowser_SearchFiltering(EditorSharedTest):
from .EditorScripts import AssetBrowser_SearchFiltering as test_module
class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest):
from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module
class test_Menus_ViewMenuOptions_Work(EditorSharedTest):
from .EditorScripts import Menus_ViewMenuOptions as test_module
@pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208")
class test_Menus_FileMenuOptions_Work(EditorSharedTest):
from .EditorScripts import Menus_FileMenuOptions as test_module
@@ -0,0 +1,62 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
import sys
import ly_test_tools.environment.file_system as file_system
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
from base import TestAutomationBase
@pytest.fixture
def remove_test_level(request, workspace, project):
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True)
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True)
request.addfinalizer(teardown)
@pytest.mark.SUITE_periodic
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(TestAutomationBase):
def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AssetBrowser_TreeNavigation as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False)
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AssetBrowser_SearchFiltering as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False)
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
def test_AssetPicker_UI_UX(self, request, workspace, editor, launcher_platform):
from .EditorScripts import AssetPicker_UI_UX as test_module
self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False)
def test_ComponentCRUD_Add_Delete_Components(self, request, workspace, editor, launcher_platform):
from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False)
def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform):
from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False)
def test_Menus_ViewMenuOptions_Work(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Menus_ViewMenuOptions as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False)
@pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208")
def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Menus_FileMenuOptions as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False)
@@ -0,0 +1,27 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
from base import TestAutomationBase
@pytest.mark.SUITE_sandbox
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(TestAutomationBase):
def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Menus_EditMenuOptions as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False)
def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform):
from .EditorScripts import Docking_BasicDockedTools as test_module
self._run_test(request, workspace, editor, test_module, batch_mode=False)
@@ -0,0 +1,27 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.")
@pytest.mark.SUITE_sandbox
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomationAutoTestMode(EditorTestSuite):
# Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
global_extra_cmdline_args = ["-autotest_mode"]
class test_Docking_BasicDockedTools(EditorSharedTest):
from .EditorScripts import Docking_BasicDockedTools as test_module
class test_Menus_EditMenuOptions_Work(EditorSharedTest):
from .EditorScripts import Menus_EditMenuOptions as test_module
@@ -1,89 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13660195: Asset Browser - File Tree Navigation
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
log_monitor_timeout = 180
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestAssetBrowser(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C13660195")
@pytest.mark.SUITE_periodic
def test_AssetBrowser_TreeNavigation(self, request, editor, level, launcher_platform):
expected_lines = [
"Collapse/Expand tests: True",
"Asset visibility test: True",
"Scrollbar visibility test: True",
"AssetBrowser_TreeNavigation: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"AssetBrowser_TreeNavigation.py",
expected_lines,
run_python="--runpython",
cfg_args=[level],
timeout=log_monitor_timeout
)
@pytest.mark.test_case_id("C13660194")
@pytest.mark.SUITE_periodic
def test_AssetBrowser_SearchFiltering(self, request, editor, level, launcher_platform):
expected_lines = [
"cedar.fbx asset is filtered in Asset Browser",
"Animation file type(s) is present in the file tree: True",
"FileTag file type(s) and Animation file type(s) is present in the file tree: True",
"FileTag file type(s) is present in the file tree after removing Animation filter: True",
]
unexpected_lines = [
"Asset Browser opened: False",
"Animation file type(s) is present in the file tree: False",
"FileTag file type(s) and Animation file type(s) is present in the file tree: False",
"FileTag file type(s) is present in the file tree after removing Animation filter: False",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"AssetBrowser_SearchFiltering.py",
expected_lines,
unexpected_lines=unexpected_lines,
cfg_args=[level],
auto_test_mode=False,
run_python="--runpython",
timeout=log_monitor_timeout,
)
@@ -1,74 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13751579: Asset Picker UI/UX
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
log_monitor_timeout = 90
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestAssetPicker(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C13751579", "C1508814")
@pytest.mark.SUITE_periodic
@pytest.mark.xfail # ATOM-15493
def test_AssetPicker_UI_UX(self, request, editor, level, launcher_platform):
expected_lines = [
"TestEntity Entity successfully created",
"Mesh component was added to entity",
"Entity has a Mesh component",
"Mesh Asset: Asset Picker title for Mesh: Pick ModelAsset",
"Mesh Asset: Scroll Bar is not visible before expanding the tree: True",
"Mesh Asset: Top level folder initially collapsed: True",
"Mesh Asset: Top level folder expanded: True",
"Mesh Asset: Nested folder initially collapsed: True",
"Mesh Asset: Nested folder expanded: True",
"Mesh Asset: Scroll Bar appeared after expanding tree: True",
"Mesh Asset: Nested folder collapsed: True",
"Mesh Asset: Top level folder collapsed: True",
"Mesh Asset: Expected Assets populated in the file picker: True",
"Widget Move Test: True",
"Widget Resize Test: True",
"Asset assigned for ok option: True",
"Asset assigned for enter option: True",
"AssetPicker_UI_UX: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"AssetPicker_UI_UX.py",
expected_lines,
cfg_args=[level],
run_python="--runpython",
auto_test_mode=False,
timeout=log_monitor_timeout,
)
@@ -1,96 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import ly_test_tools._internal.pytest_plugin as internal_plugin
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
log_monitor_timeout = 180
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestBasicEditorWorkflows(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C6351273", "C6384955", "C16929880", "C15167490", "C15167491")
@pytest.mark.SUITE_main
def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, editor, level, launcher_platform):
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
expected_lines = [
"Create and load new level: True",
"New entity creation: True",
"Create entity hierarchy: True",
"Add component: True",
"Component update: True",
"Remove component: True",
"Save and Export: True",
"BasicEditorWorkflows_LevelEntityComponent: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"BasicEditorWorkflows_LevelEntityComponentCRUD.py",
expected_lines,
cfg_args=[level],
timeout=log_monitor_timeout,
auto_test_mode=False
)
@pytest.mark.test_case_id("C6351273", "C6384955", "C16929880", "C15167490", "C15167491")
@pytest.mark.SUITE_main
@pytest.mark.REQUIRES_gpu
def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, editor, level, launcher_platform):
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
expected_lines = [
"Create and load new level: True",
"New entity creation: True",
"Create entity hierarchy: True",
"Add component: True",
"Component update: True",
"Remove component: True",
"Save and Export: True",
"BasicEditorWorkflows_LevelEntityComponent: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"BasicEditorWorkflows_LevelEntityComponentCRUD.py",
expected_lines,
cfg_args=[level],
timeout=log_monitor_timeout,
auto_test_mode=False,
null_renderer=False
)
@@ -1,62 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C16929880: Add Delete Components
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
log_monitor_timeout = 180
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestComponentCRUD(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C16929880", "C16877220")
@pytest.mark.SUITE_periodic
@pytest.mark.BAT
def test_ComponentCRUD_Add_Delete_Components(self, request, editor, level, launcher_platform):
expected_lines = [
"Entity Created",
"Box Shape found",
"Box Shape Component added: True",
"Mesh found",
"Mesh Component added: True",
"Mesh Component deleted: True",
"Mesh Component deletion undone: True",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"ComponentCRUD_Add_Delete_Components.py",
expected_lines,
cfg_args=[level],
auto_test_mode=False,
timeout=log_monitor_timeout
)
@@ -1,55 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
C6376081: Basic Function: Docked/Undocked Tools
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
log_monitor_timeout = 180
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestDocking(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C6376081")
@pytest.mark.SUITE_sandbox
def test_Docking_BasicDockedTools(self, request, editor, level, launcher_platform):
expected_lines = [
"The tools are all docked together in a tabbed widget",
"Entity Outliner works when docked, can select an Entity",
"Entity Inspector works when docked, Entity name changed to DifferentName",
"Hello, world!" # This line verifies the Console is working while docked
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"Docking_BasicDockedTools.py",
expected_lines,
cfg_args=[level],
timeout=log_monitor_timeout,
)
@@ -1,66 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C1506881: Adding/Removing Event Groups
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
log_monitor_timeout = 180
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestInputBindings(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C1506881")
@pytest.mark.SUITE_periodic
def test_InputBindings_Add_Remove_Input_Events(self, request, editor, level, launcher_platform):
expected_lines = [
"Asset Editor opened: True",
"New Event Groups added when + is clicked",
"Event Group deleted when the Delete button is clicked on an Event Group",
"All event groups deleted on clicking the Delete button",
"Asset Editor closed: True",
]
unexpected_lines = [
"Asset Editor opened: False",
"Asset Editor closed: False",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"InputBindings_Add_Remove_Input_Events.py",
expected_lines,
unexpected_lines=unexpected_lines,
cfg_args=[level],
run_python="--runpython",
auto_test_mode=False,
timeout=log_monitor_timeout,
)
@@ -1,132 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import ly_test_tools.environment.process_utils as process_utils
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
log_monitor_timeout = 180
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestMenus(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
process_utils.kill_processes_named("o3de", ignore_extensions=True) # Kill ProjectManager windows
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C16780783", "C2174438")
@pytest.mark.SUITE_sandbox
def test_Menus_EditMenuOptions_Work(self, request, editor, level, launcher_platform):
expected_lines = [
"Undo Action triggered",
"Redo Action triggered",
"Duplicate Action triggered",
"Delete Action triggered",
"Select All Action triggered",
"Invert Selection Action triggered",
"Toggle Pivot Location Action triggered",
"Reset Entity Transform",
"Reset Manipulator",
"Reset Transform (Local) Action triggered",
"Reset Transform (World) Action triggered",
"Hide Selection Action triggered",
"Show All Action triggered",
"Snap angle Action triggered",
"Move Action triggered",
"Rotate Action triggered",
"Scale Action triggered",
"Global Preferences Action triggered",
"Editor Settings Manager Action triggered",
"Customize Keyboard Action triggered",
"Export Keyboard Settings Action triggered",
"Import Keyboard Settings Action triggered",
"Menus_EditMenuOptions: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"Menus_EditMenuOptions.py",
expected_lines,
cfg_args=[level],
run_python="--runpython",
timeout=log_monitor_timeout
)
@pytest.mark.test_case_id("C16780807")
@pytest.mark.SUITE_periodic
def test_Menus_ViewMenuOptions_Work(self, request, editor, level, launcher_platform):
expected_lines = [
"Center on Selection Action triggered",
"Show Quick Access Bar Action triggered",
"Configure Layout Action triggered",
"Go to Position Action triggered",
"Center on Selection Action triggered",
"Go to Location Action triggered",
"Remember Location Action triggered",
"Switch Camera Action triggered",
"Show/Hide Helpers Action triggered",
"Refresh Style Action triggered",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"Menus_ViewMenuOptions.py",
expected_lines,
cfg_args=[level],
run_python="--runpython",
timeout=log_monitor_timeout
)
@pytest.mark.test_case_id("C16780778")
@pytest.mark.SUITE_sandbox
@pytest.mark.xfail # LYN-4208
def test_Menus_FileMenuOptions_Work(self, request, editor, level, launcher_platform):
expected_lines = [
"New Level Action triggered",
"Open Level Action triggered",
"Import Action triggered",
"Save Action triggered",
"Save As Action triggered",
"Save Level Statistics Action triggered",
"Edit Project Settings Action triggered",
"Edit Platform Settings Action triggered",
"New Project Action triggered",
"Open Project Action triggered",
"Show Log File Action triggered",
"Resave All Slices Action triggered",
"Exit Action triggered",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"Menus_FileMenuOptions.py",
expected_lines,
cfg_args=[level],
run_python="--runpython",
timeout=log_monitor_timeout
)
@@ -124,13 +124,14 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
COMPONENT
LargeWorlds
)
## LandscapeCanvas ##
ly_add_pytest(
NAME AutomatedTesting::LandscapeCanvasTests_Main
TEST_SERIAL
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/test_LandscapeCanvas_Main.py
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Main.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -143,7 +144,20 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
NAME AutomatedTesting::LandscapeCanvasTests_Periodic
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/test_LandscapeCanvas_Periodic.py
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Periodic.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
AutomatedTesting.Assets
COMPONENT
LargeWorlds
)
ly_add_pytest(
NAME AutomatedTesting::LandscapeCanvasTests_Main_Optimized
TEST_SERIAL
TEST_SUITE main
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Main_Optimized.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -153,11 +167,25 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
)
## GradientSignal ##
ly_add_pytest(
NAME AutomatedTesting::GradientSignalTests_Periodic
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/test_GradientSignal_Periodic.py
PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
AutomatedTesting.Assets
COMPONENT
LargeWorlds
)
ly_add_pytest(
NAME AutomatedTesting::GradientSignalTests_Periodic_Optimized
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic_Optimized.py
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
@@ -1,103 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
Tests that the Gradient Generator components are incompatible with Vegetation Area components
"""
import os
import pytest
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
gradient_generators = [
'Altitude Gradient',
'Constant Gradient',
'FastNoise Gradient',
'Image Gradient',
'Perlin Noise Gradient',
'Random Noise Gradient',
'Shape Falloff Gradient',
'Slope Gradient',
'Surface Mask Gradient'
]
gradient_modifiers = [
'Dither Gradient Modifier',
'Gradient Mixer',
'Invert Gradient Modifier',
'Levels Gradient Modifier',
'Posterize Gradient Modifier',
'Smooth-Step Gradient Modifier',
'Threshold Gradient Modifier'
]
vegetation_areas = [
'Vegetation Layer Spawner',
'Vegetation Layer Blender',
'Vegetation Layer Blocker',
'Vegetation Layer Blocker (Mesh)'
]
all_gradients = gradient_modifiers + gradient_generators
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientIncompatibilities(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
@pytest.mark.test_case_id('C2691648', 'C2691649', 'C2691650', 'C2691651',
'C2691653', 'C2691656', 'C2691657', 'C2691658',
'C2691647', 'C2691655')
@pytest.mark.SUITE_periodic
def test_GradientGenerators_Incompatibilities(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = []
for gradient_generator in gradient_generators:
for vegetation_area in vegetation_areas:
expected_lines.append(f"{gradient_generator} is disabled before removing {vegetation_area} component")
expected_lines.append(f"{gradient_generator} is enabled after removing {vegetation_area} component")
expected_lines.append("GradientGeneratorIncompatibilities: result=SUCCESS")
hydra.launch_and_validate_results(request, test_directory, editor,
'GradientGenerators_Incompatibilities.py',
expected_lines=expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C3416464', 'C3416546', 'C3961318', 'C3961319',
'C3961323', 'C3961324', 'C3980656', 'C3980657',
'C3980661', 'C3980662', 'C3980666', 'C3980667',
'C2691652')
@pytest.mark.SUITE_periodic
def test_GradientModifiers_Incompatibilities(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = []
for gradient_modifier in gradient_modifiers:
for vegetation_area in vegetation_areas:
expected_lines.append(f"{gradient_modifier} is disabled before removing {vegetation_area} component")
expected_lines.append(f"{gradient_modifier} is enabled after removing {vegetation_area} component")
for conflicting_gradient in all_gradients:
expected_lines.append(f"{gradient_modifier} is disabled before removing {conflicting_gradient} component")
expected_lines.append(f"{gradient_modifier} is enabled after removing {conflicting_gradient} component")
expected_lines.append("GradientModifiersIncompatibilities: result=SUCCESS")
hydra.launch_and_validate_results(request, test_directory, editor,
'GradientModifiers_Incompatibilities.py',
expected_lines=expected_lines, cfg_args=cfg_args)
@@ -1,118 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientPreviewSettings(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C3980668', 'C2676825', 'C2676828', 'C2676822', 'C3416547', 'C3961320', 'C3961325',
'C3980658', 'C3980663')
@pytest.mark.SUITE_periodic
def test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(self, request, editor, level, launcher_platform):
expected_lines = [
"Perlin Noise Gradient has Preview pinned to own Entity result: SUCCESS",
"Random Noise Gradient has Preview pinned to own Entity result: SUCCESS",
"FastNoise Gradient has Preview pinned to own Entity result: SUCCESS",
"Dither Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Invert Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Levels Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Posterize Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Smooth-Step Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"Threshold Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
"GradientPreviewSettings_DefaultPinnedEntity: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientPreviewSettings_DefaultPinnedEntityIsSelf.py",
expected_lines,
cfg_args=[level]
)
@pytest.mark.test_case_id("C2676829", "C3961326", "C3980659", "C3980664", "C3980669", "C3416548", "C2676823",
"C3961321", "C2676826")
@pytest.mark.SUITE_periodic
def test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(self, request, editor, level,
launcher_platform):
expected_lines = [
"Random Noise Gradient entity Created",
"Entity has a Random Noise Gradient component",
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"Random Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS",
"Random Noise Gradient --- Preview Position set to world origin",
"Random Noise Gradient --- Preview Size set to (1, 1, 1)",
"Levels Gradient Modifier entity Created",
"Entity has a Levels Gradient Modifier component",
"Levels Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Levels Gradient Modifier --- Preview Position set to world origin",
"Posterize Gradient Modifier entity Created",
"Entity has a Posterize Gradient Modifier component",
"Posterize Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Posterize Gradient Modifier --- Preview Position set to world origin",
"Smooth-Step Gradient Modifier entity Created",
"Entity has a Smooth-Step Gradient Modifier component",
"Smooth-Step Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Smooth-Step Gradient Modifier --- Preview Position set to world origin",
"Threshold Gradient Modifier entity Created",
"Entity has a Threshold Gradient Modifier component",
"Threshold Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Threshold Gradient Modifier --- Preview Position set to world origin",
"FastNoise Gradient entity Created",
"Entity has a FastNoise Gradient component",
"FastNoise Gradient Preview Settings|Pin Preview to Shape: SUCCESS",
"FastNoise Gradient --- Preview Position set to world origin",
"FastNoise Gradient --- Preview Size set to (1, 1, 1)",
"Dither Gradient Modifier entity Created",
"Entity has a Dither Gradient Modifier component",
"Dither Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Dither Gradient Modifier --- Preview Position set to world origin",
"Dither Gradient Modifier --- Preview Size set to (1, 1, 1)",
"Invert Gradient Modifier entity Created",
"Entity has a Invert Gradient Modifier component",
"Invert Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
"Invert Gradient Modifier --- Preview Position set to world origin",
"Perlin Noise Gradient entity Created",
"Entity has a Perlin Noise Gradient component",
"Perlin Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS",
"Perlin Noise Gradient --- Preview Position set to world origin",
"Perlin Noise Gradient --- Preview Size set to (1, 1, 1)",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py",
expected_lines,
cfg_args=[level]
)
@@ -1,86 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
import logging
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip("ly_test_tools")
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
logger = logging.getLogger(__name__)
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientSampling(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C3526311")
@pytest.mark.SUITE_periodic
def test_GradientSampling_GradientReferencesAddRemoveSuccessfully(self, request, editor, level, launcher_platform):
expected_lines = [
"Entity has a Random Noise Gradient component",
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"Entity has a Dither Gradient Modifier component",
"Gradient Generator is pinned to the Dither Gradient Modifier successfully",
"Gradient Generator is cleared from the Dither Gradient Modifier successfully",
"Entity has a Invert Gradient Modifier component",
"Gradient Generator is pinned to the Invert Gradient Modifier successfully",
"Gradient Generator is cleared from the Invert Gradient Modifier successfully",
"Entity has a Levels Gradient Modifier component",
"Gradient Generator is pinned to the Levels Gradient Modifier successfully",
"Gradient Generator is cleared from the Levels Gradient Modifier successfully",
"Entity has a Posterize Gradient Modifier component",
"Gradient Generator is pinned to the Posterize Gradient Modifier successfully",
"Gradient Generator is cleared from the Posterize Gradient Modifier successfully",
"Entity has a Smooth-Step Gradient Modifier component",
"Gradient Generator is pinned to the Smooth-Step Gradient Modifier successfully",
"Gradient Generator is cleared from the Smooth-Step Gradient Modifier successfully",
"Entity has a Threshold Gradient Modifier component",
"Gradient Generator is pinned to the Threshold Gradient Modifier successfully",
"Gradient Generator is cleared from the Threshold Gradient Modifier successfully",
]
unexpected_lines = [
"Failed to pin Gradient Generator to the Dither Gradient Modifier",
"Failed to clear Gradient Generator from the Dither Gradient Modifier",
"Failed to pin Gradient Generator to the Invert Gradient Modifier",
"Failed to clear Gradient Generator from the Invert Gradient Modifier",
"Failed to pin Gradient Generator to the Levels Gradient Modifier",
"Failed to clear Gradient Generator from the Levels Gradient Modifier",
"Failed to pin Gradient Generator to the Posterize Gradient Modifier",
"Failed to clear Gradient Generator from the Posterize Gradient Modifier",
"Failed to pin Gradient Generator to the Smooth-Step Gradient Modifier",
"Failed to clear Gradient Generator from the Smooth-Step Gradient Modifier",
"Failed to pin Gradient Generator to the Threshold Gradient Modifier",
"Failed to clear Gradient Generator from the Threshold Gradient Modifier",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientSampling_GradientReferencesAddRemoveSuccessfully.py",
expected_lines,
unexpected_lines,
cfg_args=[level]
)
@@ -1,116 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
import logging
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip("ly_test_tools")
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
logger = logging.getLogger(__name__)
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("level", ["tmp_level"])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientSurfaceTagEmitter(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
# Cleanup temp level before and after test runs
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id("C3297302")
@pytest.mark.SUITE_periodic
def test_GradientSurfaceTagEmitter_ComponentDependencies(self, request, editor, level, workspace,
launcher_platform):
cfg_args = [level]
expected_lines = [
"GradientSurfaceTagEmitter_ComponentDependencies: test started",
"GradientSurfaceTagEmitter_ComponentDependencies: Gradient Surface Tag Emitter is Disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Dither Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Gradient Mixer and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Invert Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Levels Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Posterize Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Smooth-Step Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Threshold Gradient Modifier and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Altitude Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Constant Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: FastNoise Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Image Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Perlin Noise Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Random Noise Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Reference Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Shape Falloff Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Slope Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Surface Mask Gradient and Gradient Surface Tag Emitter are enabled",
"GradientSurfaceTagEmitter_ComponentDependencies: result=SUCCESS",
]
unexpected_lines = [
"GradientSurfaceTagEmitter_ComponentDependencies: Gradient Surface Tag Emitter is Enabled, but should be Disabled without dependencies met",
"GradientSurfaceTagEmitter_ComponentDependencies: Dither Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Gradient Mixer and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Invert Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Levels Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Posterize Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Smooth-Step Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Threshold Gradient Modifier and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Altitude Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Constant Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: FastNoise Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Image Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Perlin Noise Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Random Noise Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Reference Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Shape Falloff Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Slope Gradient and Gradient Surface Tag Emitter are disabled",
"GradientSurfaceTagEmitter_ComponentDependencies: Surface Mask Gradient and Gradient Surface Tag Emitter are disabled",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientSurfaceTagEmitter_ComponentDependencies.py",
expected_lines=expected_lines,
unexpected_lines=unexpected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C3297303")
@pytest.mark.SUITE_periodic
def test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, editor, level,
launcher_platform):
expected_lines = [
"Entity has a Gradient Surface Tag Emitter component",
"Entity has a Reference Gradient component",
"Added SurfaceTag: container count is 1",
"Removed SurfaceTag: container count is 0",
"GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSucessfully: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py",
expected_lines,
cfg_args=[level]
)
@@ -1,157 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
Tests that the Gradient Transform Modifier component isn't enabled unless it has a component on
the same Entity that provides the ShapeService (e.g. box shape, or reference shape)
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientTransformRequiresShape(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C3430289')
@pytest.mark.SUITE_periodic
def test_GradientTransform_RequiresShape(self, request, editor, level, launcher_platform):
expected_lines = [
"Gradient Transform Modifier component was added to entity, but the component is disabled",
"Gradient Transform component is not active without a Shape component on the Entity",
"Box Shape component was added to entity",
"Gradient Transform Modifier component is active now that the Entity has a Shape",
"GradientTransformRequiresShape: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientTransform_RequiresShape.py",
expected_lines,
cfg_args=[level]
)
@pytest.mark.test_case_id("C3430292")
@pytest.mark.SUITE_periodic
def test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(self, request, editor, level, launcher_platform):
expected_lines = [
"Entity Created",
"Entity has a Random Noise Gradient component",
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"Components added to the entity",
"entity Configuration|Frequency Zoom: SUCCESS",
"Frequency Zoom is equal to expected value",
]
unexpected_lines = ["Frequency Zoom is not equal to expected value"]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py",
expected_lines,
unexpected_lines=unexpected_lines,
cfg_args=[level]
)
@pytest.mark.test_case_id("C3430297")
@pytest.mark.SUITE_periodic
def test_GradientTransform_ComponentIncompatibleWithSpawners(self, request, editor, launcher_platform, level):
# C3430297: Component cannot be active on the same Entity as an active Vegetation Layer Spawner
expected_lines = [
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"New Entity Created",
"Gradient Transform Modifier is Enabled",
"Box Shape is Enabled",
"Entity has a Vegetation Layer Spawner component",
"Vegetation Layer Spawner is incompatible and disabled",
"GradientTransform_ComponentIncompatibleWithSpawners: result=SUCCESS"
]
unexpected_lines = [
"Gradient Transform Modifier is Disabled. But It should be Enabled in an Entity",
"Box Shape is Disabled. But It should be Enabled in an Entity",
"Vegetation Layer Spawner is compatible and enabled. But It should be Incompatible and disabled",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientTransform_ComponentIncompatibleWithSpawners.py",
expected_lines,
unexpected_lines,
cfg_args=[level]
)
@pytest.mark.test_case_id("C4753767")
@pytest.mark.SUITE_periodic
def test_GradientTransform_ComponentIncompatibleWithExpectedGradients(self, request, editor, launcher_platform, level):
expected_lines = [
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"New Entity Created",
"Gradient Transform Modifier is Enabled",
"Box Shape is Enabled",
"Entity has a Constant Gradient component",
"Entity has a Altitude Gradient component",
"Entity has a Gradient Mixer component",
"Entity has a Reference Gradient component",
"Entity has a Shape Falloff Gradient component",
"Entity has a Slope Gradient component",
"Entity has a Surface Mask Gradient component",
"All newly added components are incompatible and disabled",
"GradientTransform_ComponentIncompatibleWithExpectedGradients: result=SUCCESS"
]
unexpected_lines = [
"Gradient Transform Modifier is disabled, but it should be enabled",
"Box Shape is disabled, but it should be enabled",
"Constant Gradient is enabled, but should be disabled",
"Altitude Gradient is enabled, but should be disabled",
"Gradient Mixer is enabled, but should be disabled",
"Reference Gradient is enabled, but should be disabled",
"Shape Falloff Gradient is enabled, but should be disabled",
"Slope Gradient is enabled, but should be disabled",
"Surface Mask Gradient component is enabled, but should be disabled",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GradientTransform_ComponentIncompatibleWithExpectedGradients.py",
expected_lines,
unexpected_lines,
cfg_args=[level]
)
@@ -1,69 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestImageGradientRequiresShape(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
@pytest.mark.test_case_id('C2707570')
@pytest.mark.SUITE_periodic
def test_ImageGradient_RequiresShape(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Image Gradient component was added to entity, but the component is disabled",
"Gradient Transform Modifier component was added to entity, but the component is disabled",
"Image Gradient component is not active without a Shape component on the Entity",
"Box Shape component was added to entity",
"Image Gradient component is active now that the Entity has a Shape",
"ImageGradientRequiresShape: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'ImageGradient_RequiresShape.py',
expected_lines=expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id("C3829430")
@pytest.mark.SUITE_periodic
def test_ImageGradient_ProcessedImageAssignedSuccessfully(self, request, editor, level, launcher_platform):
expected_lines = [
"Image Gradient Entity created",
"Entity has a Image Gradient component",
"Entity has a Gradient Transform Modifier component",
"Entity has a Box Shape component",
"image_grad_test_gsi.png was found in the workspace",
"Entity Configuration|Image Asset: SUCCESS",
"ImageGradient_ProcessedImageAssignedSucessfully: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"ImageGradient_ProcessedImageAssignedSuccessfully.py",
expected_lines,
cfg_args=[level]
)
@@ -17,6 +17,12 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, E
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest):
from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module
class test_LandscapeCanvas_GradientMixer_NodeConstruction(EditorSharedTest):
from .EditorScripts import GradientMixer_NodeConstruction as test_module
class test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(EditorSharedTest):
from .EditorScripts import AreaNodes_DependentComponentsAdded as test_module
@@ -86,4 +92,4 @@ class TestAutomation(EditorTestSuite):
from .EditorScripts import ShapeNodes_EntityCreatedOnNodeAdd as test_module
class test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(EditorSharedTest):
from .EditorScripts import ShapeNodes_EntityRemovedOnNodeDelete as test_module
from .EditorScripts import ShapeNodes_EntityRemovedOnNodeDelete as test_module
@@ -1,125 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13815919 - Appropriate component dependencies are automatically added to node entities
C13767844 - All Vegetation Area nodes can be added to a graph
C17605868 - All Vegetation Area nodes can be removed from a graph
C13815873 - All Filters/Modifiers/Selectors can be added to/removed from a Layer node
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestAreaNodes(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C13815919')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"SpawnerAreaNode created new Entity with all required components",
"MeshBlockerAreaNode created new Entity with all required components",
"BlockerAreaNode created new Entity with all required components",
"AreaNodeComponentDependency: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'AreaNodes_DependentComponentsAdded.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C13767844')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_AreaNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform):
"""
Verifies all Area nodes can be successfully added to a Landscape Canvas graph, and the proper entity
creation occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"AreaBlenderNode created new Entity with Vegetation Layer Blender Component",
"BlockerAreaNode created new Entity with Vegetation Layer Blocker Component",
"MeshBlockerAreaNode created new Entity with Vegetation Layer Blocker (Mesh) Component",
"SpawnerAreaNode created new Entity with Vegetation Layer Spawner Component",
"AreaNodeEntityCreate: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'AreaNodes_EntityCreatedOnNodeAdd.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C17605868')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_AreaNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform):
"""
Verifies all Area nodes can be successfully removed from a Landscape Canvas graph, and the proper entity
cleanup occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"AreaBlenderNode corresponding Entity was deleted when node is removed",
"MeshBlockerAreaNode corresponding Entity was deleted when node is removed",
"SpawnerAreaNode corresponding Entity was deleted when node is removed",
"BlockerAreaNode corresponding Entity was deleted when node is removed",
"AreaNodeEntityDelete: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'AreaNodes_EntityRemovedOnNodeDelete.py', expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C13815873')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_LayerExtenderNodes_ComponentEntitySync(self, request, editor, level, launcher_platform):
"""
Verifies all Area Extender nodes can be successfully added to and removed from a Landscape Canvas graph, and the
proper entity creation/cleanup occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"AreaBlenderNode successfully added and removed all filters/modifiers/selectors",
"SpawnerAreaNode successfully added and removed all filters/modifiers/selectors",
"LayerExtenderNodeComponentEntitySync: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'LayerExtenderNodes_ComponentEntitySync.py', expected_lines,
cfg_args=cfg_args)
@@ -1,84 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C29278563 - Disabled nodes can be successfully duplicated
C30813586 - Editor remains stable after Undoing deletion of a node on a slice entity
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestEditFunctionality(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C29278563')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_DuplicateDisabledNodes(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"SpawnerAreaNode duplicated with disabled component",
"SpawnerAreaNode duplicated with deleted component",
"MeshBlockerAreaNode duplicated with disabled component",
"MeshBlockerAreaNode duplicated with deleted component",
"BlockerAreaNode duplicated with disabled component",
"BlockerAreaNode duplicated with deleted component",
"FastNoiseGradientNode duplicated with disabled component",
"FastNoiseGradientNode duplicated with deleted component",
"ImageGradientNode duplicated with disabled component",
"ImageGradientNode duplicated with deleted component",
"PerlinNoiseGradientNode duplicated with disabled component",
"PerlinNoiseGradientNode duplicated with deleted component",
"RandomNoiseGradientNode duplicated with disabled component",
"RandomNoiseGradientNode duplicated with deleted component",
"DisabledNodeDuplication: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_DisabledNodeDuplication.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C30813586')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_UndoNodeDelete_SliceEntity(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Vegetation Layer Spawner node found on graph",
"Vegetation Layer Spawner node was removed",
"Editor is still responsive",
"UndoNodeDeleteSlice: result=SUCCESS"
]
unexpected_lines = [
"Vegetation Layer Spawner node not found",
"Vegetation Layer Spawner node was not removed"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_UndoNodeDelete_SliceEntity.py',
expected_lines, unexpected_lines=unexpected_lines, cfg_args=cfg_args)
@@ -1,173 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C2735988 - Landscape Canvas tool can be opened/closed
C13815862 - New graph can be created
C13767840 - New root entity is created when a new graph is created through Landscape Canvas
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip("ly_test_tools")
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("level", ["tmp_level"])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGeneralGraphFunctionality(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, True)
@pytest.mark.test_case_id("C2735988", "C13815862", "C13767840")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_NewGraph_CreatedSuccessfully(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"Root entity has Landscape Canvas component",
"Landscape Canvas pane is closed",
"CreateNewGraph: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"CreateNewGraph.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C2735990")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_Component_AddedRemoved(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas Component added to Entity",
"Landscape Canvas Component removed from Entity",
"LandscapeCanvasComponentAddedRemoved: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"LandscapeCanvasComponent_AddedRemoved.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C14212352")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GraphClosed_OnLevelChange(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"Graph is no longer open in Landscape Canvas",
"GraphClosedOnLevelChange: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GraphClosed_OnLevelChange.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C17488412")
@pytest.mark.SUITE_periodic
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2201")
def test_LandscapeCanvas_GraphClosed_OnEntityDelete(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"Graph registered with Landscape Canvas",
"The graph is no longer open after deleting the Entity",
"GraphClosedOnEntityDelete: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GraphClosed_OnEntityDelete.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C15167461")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GraphClosed_TabbedGraphClosesIndependently(self, request, editor, level,
launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"2nd new graph created",
"3rd new graph created",
"Graphs registered with Landscape Canvas",
"Graph 2 was successfully closed",
"GraphClosedTabbedGraph: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"GraphClosed_TabbedGraph.py",
expected_lines,
cfg_args=cfg_args
)
@pytest.mark.test_case_id("C22602016")
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_SliceCreateInstantiate(self, request, editor, level, workspace, launcher_platform):
cfg_args = [level]
expected_lines = [
"LandscapeCanvas_SliceCreateInstantiate: test started",
"landscape_canvas_entity Entity successfully created",
"LandscapeCanvas_SliceCreateInstantiate: Slice has been created successfully: True",
"LandscapeCanvas_SliceCreateInstantiate: Slice instantiated: True",
"LandscapeCanvas_SliceCreateInstantiate: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"LandscapeCanvas_SliceCreateInstantiate.py",
expected_lines=expected_lines,
cfg_args=cfg_args
)
@@ -1,92 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13767841 - All Gradient Modifier nodes can be added to a graph
C18055051 - All Gradient Modifier nodes can be removed from a graph
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientModifierNodes(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C13767841')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientModifierNodes_EntityCreatedOnNodeAdd(self, request, editor, level,
launcher_platform):
"""
Verifies all Gradient Modifier nodes can be successfully added to a Landscape Canvas graph, and the proper
entity creation occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"DitherGradientModifierNode created new Entity with Dither Gradient Modifier Component",
"GradientMixerNode created new Entity with Gradient Mixer Component",
"InvertGradientModifierNode created new Entity with Invert Gradient Modifier Component",
"LevelsGradientModifierNode created new Entity with Levels Gradient Modifier Component",
"PosterizeGradientModifierNode created new Entity with Posterize Gradient Modifier Component",
"SmoothStepGradientModifierNode created new Entity with Smooth-Step Gradient Modifier Component",
"ThresholdGradientModifierNode created new Entity with Threshold Gradient Modifier Component",
"GradientModifierNodeEntityCreate: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'GradientModifierNodes_EntityCreatedOnNodeAdd.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C18055051')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientModifierNodes_EntityRemovedOnNodeDelete(self, request, editor, level,
launcher_platform):
"""
Verifies all Gradient Modifier nodes can be successfully removed from a Landscape Canvas graph, and the proper
entity cleanup occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"DitherGradientModifierNode corresponding Entity was deleted when node is removed",
"GradientMixerNode corresponding Entity was deleted when node is removed",
"InvertGradientModifierNode corresponding Entity was deleted when node is removed",
"LevelsGradientModifierNode corresponding Entity was deleted when node is removed",
"PosterizeGradientModifierNode corresponding Entity was deleted when node is removed",
"SmoothStepGradientModifierNode corresponding Entity was deleted when node is removed",
"ThresholdGradientModifierNode corresponding Entity was deleted when node is removed",
"GradientModifierNodeEntityDelete: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'GradientModifierNodes_EntityRemovedOnNodeDelete.py',
expected_lines, cfg_args=cfg_args)
@@ -1,109 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13815920 - Appropriate component dependencies are automatically added to node entities
C13767842 - All Gradient nodes can be added to a graph
C17461363 - All Gradient nodes can be removed from a graph
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGradientNodes(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C13815920')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientNodes_DependentComponentsAdded(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"FastNoiseGradientNode created new Entity with all required components",
"ImageGradientNode created new Entity with all required components",
"PerlinNoiseGradientNode created new Entity with all required components",
"RandomNoiseGradientNode created new Entity with all required components"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_DependentComponentsAdded.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C13767842')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform):
"""
Verifies all Gradient nodes can be successfully added to a Landscape Canvas graph, and the proper entity
creation occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"AltitudeGradientNode created new Entity with Altitude Gradient Component",
"ConstantGradientNode created new Entity with Constant Gradient Component",
"FastNoiseGradientNode created new Entity with FastNoise Gradient Component",
"ImageGradientNode created new Entity with Image Gradient Component",
"PerlinNoiseGradientNode created new Entity with Perlin Noise Gradient Component",
"RandomNoiseGradientNode created new Entity with Random Noise Gradient Component",
"ShapeAreaFalloffGradientNode created new Entity with Shape Falloff Gradient Component",
"SlopeGradientNode created new Entity with Slope Gradient Component",
"SurfaceMaskGradientNode created new Entity with Surface Mask Gradient Component"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_EntityCreatedOnNodeAdd.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C17461363')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GradientNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform):
"""
Verifies all Gradient nodes can be successfully removed from a Landscape Canvas graph, and the proper entity
cleanup occurs.
"""
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"FastNoiseGradientNode corresponding Entity was deleted when node is removed",
"AltitudeGradientNode corresponding Entity was deleted when node is removed",
"ConstantGradientNode corresponding Entity was deleted when node is removed",
"RandomNoiseGradientNode corresponding Entity was deleted when node is removed",
"ShapeAreaFalloffGradientNode corresponding Entity was deleted when node is removed",
"SlopeGradientNode corresponding Entity was deleted when node is removed",
"PerlinNoiseGradientNode corresponding Entity was deleted when node is removed",
"ImageGradientNode corresponding Entity was deleted when node is removed",
"SurfaceMaskGradientNode corresponding Entity was deleted when node is removed"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_EntityRemovedOnNodeDelete.py',
expected_lines, cfg_args=cfg_args)
@@ -1,167 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C4705586 - Altering connections on graph nodes appropriately updates component properties
C22715182 - Components are updated when nodes are added/removed/updated
C22602072 - Graph is updated when underlying components are added/removed
C15987206 - Gradient Mixer Layers are properly setup when constructing in a graph
C21333743 - Vegetation Layer Blenders are properly setup when constructing in a graph
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import ly_test_tools._internal.pytest_plugin as internal_plugin
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestGraphComponentSync(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C4705586')
@pytest.mark.BAT
@pytest.mark.SUITE_main
def test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(self, request, editor, level, launcher_platform):
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"Random Noise Gradient component Preview Entity property set to Box Shape EntityId",
"Dither Gradient Modifier component Inbound Gradient property set to Random Noise Gradient EntityId",
"Gradient Mixer component Inbound Gradient extendable property set to Dither Gradient Modifier EntityId",
"SlotConnectionsUpdateComponents: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor,
'SlotConnections_UpdateComponentReferences.py', expected_lines,
cfg_args=cfg_args)
@pytest.mark.test_case_id('C22715182')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_GraphUpdates_UpdateComponents(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
'Rotation Modifier component was removed from entity',
'BushSpawner entity was deleted',
'Gradient Entity Id reference was properly updated',
'GraphUpdatesUpdateComponents: result=SUCCESS'
]
unexpected_lines = [
'Rotation Modifier component is still present on entity',
'Failed to delete BushSpawner entity',
'Gradient Entity Id was not updated properly'
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GraphUpdates_UpdateComponents.py',
expected_lines, unexpected_lines=unexpected_lines,
cfg_args=cfg_args)
@pytest.mark.test_case_id('C22602072')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_ComponentUpdates_UpdateGraph(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"LandscapeCanvas entity found",
"BushSpawner entity found",
"Vegetation Distribution Filter on BushSpawner entity found",
"Graph opened",
"Distribution Filter node found on graph",
"Vegetation Altitude Filter on BushSpawner entity found",
"Altitude Filter node found on graph",
"Vegetation Distribution Filter removed from BushSpawner entity",
"Distribution Filter node was removed from the graph",
"New entity successfully added as a child of the BushSpawner entity",
"Box Shape on Box entity found",
"Box Shape node found on graph",
'ComponentUpdatesUpdateGraph: result=SUCCESS'
]
unexpected_lines = [
"Distribution Filter node not found on graph",
"Distribution Filter node is still present on the graph",
"Altitude Filter node not found on graph",
"New entity added with an unexpected parent",
"Box Shape node not found on graph"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'ComponentUpdates_UpdateGraph.py',
expected_lines, unexpected_lines=unexpected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C15987206')
@pytest.mark.SUITE_main
def test_LandscapeCanvas_GradientMixer_NodeConstruction(self, request, editor, level, launcher_platform):
"""
Verifies a Gradient Mixer can be setup in Landscape Canvas and all references are property set.
"""
# Skip test if running against Debug build
if "debug" in internal_plugin.build_directory:
pytest.skip("Does not execute against debug builds.")
cfg_args = [level]
expected_lines = [
'Landscape Canvas pane is open',
'New graph created',
'Graph registered with Landscape Canvas',
'Perlin Noise Gradient component Preview Entity property set to Box Shape EntityId',
'Gradient Mixer component Inbound Gradient extendable property set to Perlin Noise Gradient EntityId',
'Gradient Mixer component Inbound Gradient extendable property set to FastNoise Gradient EntityId',
'Configuration|Layers|[0]|Operation set to 0',
'Configuration|Layers|[1]|Operation set to 6',
'GradientMixerNodeConstruction: result=SUCCESS'
]
hydra.launch_and_validate_results(request, test_directory, editor, 'GradientMixer_NodeConstruction.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C21333743')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_LayerBlender_NodeConstruction(self, request, editor, level, launcher_platform):
"""
Verifies a Layer Blender can be setup in Landscape Canvas and all references are property set.
"""
cfg_args = [level]
expected_lines = [
'Landscape Canvas pane is open',
'New graph created',
'Graph registered with Landscape Canvas',
'Vegetation Layer Blender component Vegetation Areas[0] property set to Vegetation Layer Spawner EntityId',
'Vegetation Layer Blender component Vegetation Areas[1] property set to Vegetation Layer Blocker EntityId',
'LayerBlenderNodeConstruction: result=SUCCESS'
]
hydra.launch_and_validate_results(request, test_directory, editor, 'LayerBlender_NodeConstruction.py',
expected_lines, cfg_args=cfg_args)
@@ -1,22 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import pytest
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
@pytest.mark.SUITE_periodic
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest):
from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module
class test_LandscapeCanvas_GradientMixer_NodeConstruction(EditorSharedTest):
from .EditorScripts import GradientMixer_NodeConstruction as test_module
@@ -1,82 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
C13767843 - All Shape nodes can be added to a graph
C17412059 - All Shape nodes can be removed from a graph
"""
import os
import pytest
# Bail on the test if ly_test_tools doesn't exist.
pytest.importorskip('ly_test_tools')
import ly_test_tools.environment.file_system as file_system
import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
@pytest.mark.parametrize('project', ['AutomatedTesting'])
@pytest.mark.parametrize('level', ['tmp_level'])
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestShapeNodes(object):
@pytest.fixture(autouse=True)
def setup_teardown(self, request, workspace, project, level):
def teardown():
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
request.addfinalizer(teardown)
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
@pytest.mark.test_case_id('C13767843')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_ShapeNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"BoxShapeNode created new Entity with Box Shape Component",
"CapsuleShapeNode created new Entity with Capsule Shape Component",
"CompoundShapeNode created new Entity with Compound Shape Component",
"CylinderShapeNode created new Entity with Cylinder Shape Component",
"PolygonPrismShapeNode created new Entity with Polygon Prism Shape Component",
"SphereShapeNode created new Entity with Sphere Shape Component",
"TubeShapeNode created new Entity with Tube Shape Component",
"DiskShapeNode created new Entity with Disk Shape Component",
"ShapeNodeEntityCreate: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'ShapeNodes_EntityCreatedOnNodeAdd.py',
expected_lines, cfg_args=cfg_args)
@pytest.mark.test_case_id('C17412059')
@pytest.mark.SUITE_periodic
def test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform):
cfg_args = [level]
expected_lines = [
"Landscape Canvas pane is open",
"New graph created",
"Graph registered with Landscape Canvas",
"BoxShapeNode corresponding Entity was deleted when node is removed",
"CapsuleShapeNode corresponding Entity was deleted when node is removed",
"CompoundShapeNode corresponding Entity was deleted when node is removed",
"CylinderShapeNode corresponding Entity was deleted when node is removed",
"PolygonPrismShapeNode corresponding Entity was deleted when node is removed",
"SphereShapeNode corresponding Entity was deleted when node is removed",
"TubeShapeNode corresponding Entity was deleted when node is removed",
"DiskShapeNode corresponding Entity was deleted when node is removed",
"ShapeNodeEntityDelete: result=SUCCESS"
]
hydra.launch_and_validate_results(request, test_directory, editor, 'ShapeNodes_EntityRemovedOnNodeDelete.py',
expected_lines, cfg_args=cfg_args)
@@ -19,6 +19,19 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
COMPONENT
Physics
)
ly_add_pytest(
NAME AutomatedTesting::PhysicsTests_Main_Optimized
TEST_SUITE main
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py
TIMEOUT 1500
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Physics
)
ly_add_pytest(
NAME AutomatedTesting::PhysicsTests_Periodic
TEST_SUITE periodic
@@ -1,11 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
def init():
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
@@ -13,25 +13,25 @@ import pytest
import os
import sys
from .FileManagement import FileManagement as fm
from .utils.FileManagement import FileManagement as fm
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
@pytest.mark.parametrize("spec", ["all"])
from base import TestAutomationBase
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.system
class TestAutomation(TestAutomationBase):
@fm.file_revert("ragdollbones.physmaterial",
r"AutomatedTesting\Levels\Physics\C4925582_Material_AddModifyDeleteOnRagdollBones")
def test_C4925582_Material_AddModifyDeleteOnRagdollBones(self, request, workspace, editor):
from . import C4925582_Material_AddModifyDeleteOnRagdollBones as test_module
from .material import C4925582_Material_AddModifyDeleteOnRagdollBones as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C4925580_Material_RagdollBonesMaterial(self, request, workspace, editor):
from . import C4925580_Material_RagdollBonesMaterial as test_module
from .material import C4925580_Material_RagdollBonesMaterial as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -40,7 +40,7 @@ class TestAutomation(TestAutomationBase):
@fm.file_revert("c15308221_material_componentsinsyncwithlibrary.physmaterial",
r"AutomatedTesting\Levels\Physics\C15308221_Material_ComponentsInSyncWithLibrary")
def test_C15308221_Material_ComponentsInSyncWithLibrary(self, request, workspace, editor):
from . import C15308221_Material_ComponentsInSyncWithLibrary as test_module
from .material import C15308221_Material_ComponentsInSyncWithLibrary as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -48,7 +48,7 @@ class TestAutomation(TestAutomationBase):
# BUG: LY-107723")
def test_C14976308_ScriptCanvas_SetKinematicTargetTransform(self, request, workspace, editor):
from . import C14976308_ScriptCanvas_SetKinematicTargetTransform as test_module
from .script_canvas import C14976308_ScriptCanvas_SetKinematicTargetTransform as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -58,7 +58,7 @@ class TestAutomation(TestAutomationBase):
@fm.file_revert("c4925579_material_addmodifydeleteonterrain.physmaterial",
r"AutomatedTesting\Levels\Physics\C4925579_Material_AddModifyDeleteOnTerrain")
def test_C4925579_Material_AddModifyDeleteOnTerrain(self, request, workspace, editor):
from . import C4925579_Material_AddModifyDeleteOnTerrain as test_module
from .material import C4925579_Material_AddModifyDeleteOnTerrain as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -66,7 +66,7 @@ class TestAutomation(TestAutomationBase):
# Failing, PhysXTerrain
def test_C13508019_Terrain_TerrainTexturePainterWorks(self, request, workspace, editor):
from . import C13508019_Terrain_TerrainTexturePainterWorks as test_module
from .terrain import C13508019_Terrain_TerrainTexturePainterWorks as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -74,7 +74,7 @@ class TestAutomation(TestAutomationBase):
# Failing, PhysXTerrain
def test_C4925577_Materials_MaterialAssignedToTerrain(self, request, workspace, editor):
from . import C4925577_Materials_MaterialAssignedToTerrain as test_module
from .material import C4925577_Materials_MaterialAssignedToTerrain as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -82,7 +82,7 @@ class TestAutomation(TestAutomationBase):
# Failing, PhysXTerrain
def test_C15096735_Materials_DefaultLibraryConsistency(self, request, workspace, editor):
from . import C15096735_Materials_DefaultLibraryConsistency as test_module
from .material import C15096735_Materials_DefaultLibraryConsistency as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -92,13 +92,13 @@ class TestAutomation(TestAutomationBase):
@fm.file_revert("all_ones_1.physmaterial", r"AutomatedTesting\Levels\Physics\C15096737_Materials_DefaultMaterialLibraryChanges")
@fm.file_override("default.physxconfiguration", "C15096737_Materials_DefaultMaterialLibraryChanges.physxconfiguration", "AutomatedTesting")
def test_C15096737_Materials_DefaultMaterialLibraryChanges(self, request, workspace, editor):
from . import C15096737_Materials_DefaultMaterialLibraryChanges as test_module
from .material import C15096737_Materials_DefaultMaterialLibraryChanges as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C4976242_Collision_SameCollisionlayerSameCollisiongroup(self, request, workspace, editor):
from . import C4976242_Collision_SameCollisionlayerSameCollisiongroup as test_module
from .collider import C4976242_Collision_SameCollisionlayerSameCollisiongroup as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -109,7 +109,7 @@ class TestAutomation(TestAutomationBase):
"Material_DefaultLibraryUpdatedAcrossLevels_before.physxconfiguration", "AutomatedTesting",
search_subdirs=True)
def test_levels_before(self, request, workspace, editor):
from . import C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before as test_module_0
from .material import C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before as test_module_0
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module_0, expected_lines, unexpected_lines)
@@ -119,7 +119,7 @@ class TestAutomation(TestAutomationBase):
"Material_DefaultLibraryUpdatedAcrossLevels_after.physxconfiguration", "AutomatedTesting",
search_subdirs=True)
def test_levels_after(self, request, workspace, editor):
from . import C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after as test_module_1
from .material import C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after as test_module_1
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module_1, expected_lines, unexpected_lines)
@@ -128,7 +128,7 @@ class TestAutomation(TestAutomationBase):
test_levels_after(self, request, workspace, editor)
def test_C14654882_Ragdoll_ragdollAPTest(self, request, workspace, editor):
from . import C14654882_Ragdoll_ragdollAPTest as test_module
from .ragdoll import C14654882_Ragdoll_ragdollAPTest as test_module
expected_lines = []
unexpected_lines = test_module.UnexpectedLines.lines
@@ -136,14 +136,14 @@ class TestAutomation(TestAutomationBase):
@fm.file_override("default.physxconfiguration", "C12712454_ScriptCanvas_OverlapNodeVerification.physxconfiguration")
def test_C12712454_ScriptCanvas_OverlapNodeVerification(self, request, workspace, editor):
from . import C12712454_ScriptCanvas_OverlapNodeVerification as test_module
from .script_canvas import C12712454_ScriptCanvas_OverlapNodeVerification as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C4044460_Material_StaticFriction(self, request, workspace, editor):
from . import C4044460_Material_StaticFriction as test_module
from .material import C4044460_Material_StaticFriction as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -154,7 +154,7 @@ class TestAutomation(TestAutomationBase):
@fm.file_revert("c4888315_material_addmodifydeleteoncollider.physmaterial",
r"AutomatedTesting\Levels\Physics\C4888315_Material_AddModifyDeleteOnCollider")
def test_C4888315_Material_AddModifyDeleteOnCollider(self, request, workspace, editor):
from . import C4888315_Material_AddModifyDeleteOnCollider as test_module
from .material import C4888315_Material_AddModifyDeleteOnCollider as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -164,7 +164,7 @@ class TestAutomation(TestAutomationBase):
@fm.file_revert("c15563573_material_addmodifydeleteoncharactercontroller.physmaterial",
r"AutomatedTesting\Levels\Physics\C15563573_Material_AddModifyDeleteOnCharacterController")
def test_C15563573_Material_AddModifyDeleteOnCharacterController(self, request, workspace, editor):
from . import C15563573_Material_AddModifyDeleteOnCharacterController as test_module
from .material import C15563573_Material_AddModifyDeleteOnCharacterController as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -173,7 +173,7 @@ class TestAutomation(TestAutomationBase):
@fm.file_revert("c4888315_material_addmodifydeleteoncollider.physmaterial",
r"AutomatedTesting\Levels\Physics\C4888315_Material_AddModifyDeleteOnCollider")
def test_C4888315_Material_AddModifyDeleteOnCollider(self, request, workspace, editor):
from . import C4888315_Material_AddModifyDeleteOnCollider as test_module
from .material import C4888315_Material_AddModifyDeleteOnCollider as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -185,7 +185,7 @@ class TestAutomation(TestAutomationBase):
@fm.file_revert("c15563573_material_addmodifydeleteoncharactercontroller.physmaterial",
r"AutomatedTesting\Levels\Physics\C15563573_Material_AddModifyDeleteOnCharacterController")
def test_C15563573_Material_AddModifyDeleteOnCharacterController(self, request, workspace, editor):
from . import C15563573_Material_AddModifyDeleteOnCharacterController as test_module
from .material import C15563573_Material_AddModifyDeleteOnCharacterController as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -194,7 +194,7 @@ class TestAutomation(TestAutomationBase):
@fm.file_revert("c4044455_material_librarychangesinstantly.physmaterial",
r"AutomatedTesting\Levels\Physics\C4044455_Material_LibraryChangesInstantly")
def test_C4044455_Material_libraryChangesInstantly(self, request, workspace, editor):
from . import C4044455_Material_libraryChangesInstantly as test_module
from .material import C4044455_Material_libraryChangesInstantly as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -204,103 +204,103 @@ class TestAutomation(TestAutomationBase):
@fm.file_revert("C15425935_Material_LibraryUpdatedAcrossLevels.physmaterial",
r"AutomatedTesting\Levels\Physics\C15425935_Material_LibraryUpdatedAcrossLevels")
def test_C15425935_Material_LibraryUpdatedAcrossLevels(self, request, workspace, editor):
from . import C15425935_Material_LibraryUpdatedAcrossLevels as test_module
from .material import C15425935_Material_LibraryUpdatedAcrossLevels as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C4976199_RigidBodies_LinearDampingObjectMotion(self, request, workspace, editor):
from . import C4976199_RigidBodies_LinearDampingObjectMotion as test_module
from .rigid_body import C4976199_RigidBodies_LinearDampingObjectMotion as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C5689518_PhysXTerrain_CollidesWithPhysXTerrain(self, request, workspace, editor):
from . import C5689518_PhysXTerrain_CollidesWithPhysXTerrain as test_module
from .terrain import C5689518_PhysXTerrain_CollidesWithPhysXTerrain as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(self, request, workspace, editor):
from . import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module
from .collider import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C29032500_EditorComponents_WorldBodyBusWorks(self, request, workspace, editor):
from . import C29032500_EditorComponents_WorldBodyBusWorks as test_module
from .general import C29032500_EditorComponents_WorldBodyBusWorks as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C14861498_ConfirmError_NoPxMesh(self, request, workspace, editor, launcher_platform):
from . import C14861498_ConfirmError_NoPxMesh as test_module
from .collider import C14861498_ConfirmError_NoPxMesh as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C5959763_ForceRegion_ForceRegionImpulsesCube(self, request, workspace, editor, launcher_platform):
from . import C5959763_ForceRegion_ForceRegionImpulsesCube as test_module
from .force_region import C5959763_ForceRegion_ForceRegionImpulsesCube as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C5689531_Warning_TerrainSliceTerrainComponent(self, request, workspace, editor, launcher_platform):
from . import C5689531_Warning_TerrainSliceTerrainComponent as test_module
from .terrain import C5689531_Warning_TerrainSliceTerrainComponent as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C5689522_Physxterrain_AddPhysxterrainNoEditorCrash(self, request, workspace, editor, launcher_platform):
from . import C5689522_Physxterrain_AddPhysxterrainNoEditorCrash as test_module
from .terrain import C5689522_Physxterrain_AddPhysxterrainNoEditorCrash as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C5689524_MultipleTerrains_CheckWarningInConsole(self, request, workspace, editor, launcher_platform):
from . import C5689524_MultipleTerrains_CheckWarningInConsole as test_module
from .terrain import C5689524_MultipleTerrains_CheckWarningInConsole as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C5689528_Terrain_MultipleTerrainComponents(self, request, workspace, editor, launcher_platform):
from . import C5689528_Terrain_MultipleTerrainComponents as test_module
from .terrain import C5689528_Terrain_MultipleTerrainComponents as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C5689528_Terrain_MultipleTerrainComponents(self, request, workspace, editor, launcher_platform):
from . import C5689528_Terrain_MultipleTerrainComponents as test_module
from .terrain import C5689528_Terrain_MultipleTerrainComponents as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C6321601_Force_HighValuesDirectionAxes(self, request, workspace, editor, launcher_platform):
from . import C6321601_Force_HighValuesDirectionAxes as test_module
from .force_region import C6321601_Force_HighValuesDirectionAxes as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C6032082_Terrain_MultipleResolutionsValid(self, request, workspace, editor, launcher_platform):
from . import C6032082_Terrain_MultipleResolutionsValid as test_module
from .terrain import C6032082_Terrain_MultipleResolutionsValid as test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
def test_C12905527_ForceRegion_MagnitudeDeviation(self, request, workspace, editor, launcher_platform):
from . import C12905527_ForceRegion_MagnitudeDeviation as test_module
from .force_region import C12905527_ForceRegion_MagnitudeDeviation as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -308,7 +308,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243580_Joints_Fixed2BodiesConstrained(self, request, workspace, editor, launcher_platform):
from . import C18243580_Joints_Fixed2BodiesConstrained as test_module
from .joints import C18243580_Joints_Fixed2BodiesConstrained as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -316,7 +316,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243583_Joints_Hinge2BodiesConstrained(self, request, workspace, editor, launcher_platform):
from . import C18243583_Joints_Hinge2BodiesConstrained as test_module
from .joints import C18243583_Joints_Hinge2BodiesConstrained as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -324,7 +324,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243588_Joints_Ball2BodiesConstrained(self, request, workspace, editor, launcher_platform):
from . import C18243588_Joints_Ball2BodiesConstrained as test_module
from .joints import C18243588_Joints_Ball2BodiesConstrained as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -332,7 +332,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243581_Joints_FixedBreakable(self, request, workspace, editor, launcher_platform):
from . import C18243581_Joints_FixedBreakable as test_module
from .joints import C18243581_Joints_FixedBreakable as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -340,7 +340,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243587_Joints_HingeBreakable(self, request, workspace, editor, launcher_platform):
from . import C18243587_Joints_HingeBreakable as test_module
from .joints import C18243587_Joints_HingeBreakable as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -348,7 +348,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243592_Joints_BallBreakable(self, request, workspace, editor, launcher_platform):
from . import C18243592_Joints_BallBreakable as test_module
from .joints import C18243592_Joints_BallBreakable as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -356,7 +356,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243585_Joints_HingeNoLimitsConstrained(self, request, workspace, editor, launcher_platform):
from . import C18243585_Joints_HingeNoLimitsConstrained as test_module
from .joints import C18243585_Joints_HingeNoLimitsConstrained as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -364,7 +364,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243590_Joints_BallNoLimitsConstrained(self, request, workspace, editor, launcher_platform):
from . import C18243590_Joints_BallNoLimitsConstrained as test_module
from .joints import C18243590_Joints_BallNoLimitsConstrained as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -372,7 +372,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243582_Joints_FixedLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
from . import C18243582_Joints_FixedLeadFollowerCollide as test_module
from .joints import C18243582_Joints_FixedLeadFollowerCollide as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -380,7 +380,7 @@ class TestAutomation(TestAutomationBase):
# Removed from active suite to meet 60 minutes limit in AR job
def test_C18243593_Joints_GlobalFrameConstrained(self, request, workspace, editor, launcher_platform):
from . import C18243593_Joints_GlobalFrameConstrained as test_module
from .joints import C18243593_Joints_GlobalFrameConstrained as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -12,7 +12,7 @@ import pytest
import os
import sys
from .FileManagement import FileManagement as fm
from .utils.FileManagement import FileManagement as fm
from ly_test_tools import LAUNCHERS
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
@@ -29,58 +29,63 @@ revert_physics_config = fm.file_revert_list(['physxdebugconfiguration.setreg', '
class TestAutomation(TestAutomationBase):
def test_C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(self, request, workspace, editor, launcher_platform):
from . import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
from .collider import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
from . import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module
from .force_region import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C4044459_Material_DynamicFriction.setreg_override', 'AutomatedTesting/Registry')
def test_C4044459_Material_DynamicFriction(self, request, workspace, editor, launcher_platform):
from . import C4044459_Material_DynamicFriction as test_module
from .material import C4044459_Material_DynamicFriction as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976243_Collision_SameCollisionGroupDiffCollisionLayers(self, request, workspace, editor,
launcher_platform):
from . import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module
from .collider import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C14654881_CharacterController_SwitchLevels(self, request, workspace, editor, launcher_platform):
from . import C14654881_CharacterController_SwitchLevels as test_module
from .character_controller import C14654881_CharacterController_SwitchLevels as test_module
self._run_test(request, workspace, editor, test_module)
def test_C17411467_AddPhysxRagdollComponent(self, request, workspace, editor, launcher_platform):
from . import C17411467_AddPhysxRagdollComponent as test_module
from .ragdoll import C17411467_AddPhysxRagdollComponent as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C12712453_ScriptCanvas_MultipleRaycastNode(self, request, workspace, editor, launcher_platform):
from . import C12712453_ScriptCanvas_MultipleRaycastNode as test_module
from .script_canvas import C12712453_ScriptCanvas_MultipleRaycastNode as test_module
# Fixme: unexpected_lines = ["Assert"] + test_module.Lines.unexpected
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C4982593_PhysXCollider_CollisionLayer.setreg_override', 'AutomatedTesting/Registry')
def test_C4982593_PhysXCollider_CollisionLayerTest(self, request, workspace, editor, launcher_platform):
from . import C4982593_PhysXCollider_CollisionLayerTest as test_module
from .collider import C4982593_PhysXCollider_CollisionLayerTest as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C18243586_Joints_HingeLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
from . import C18243586_Joints_HingeLeadFollowerCollide as test_module
from .joints import C18243586_Joints_HingeLeadFollowerCollide as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4982803_Enable_PxMesh_Option(self, request, workspace, editor, launcher_platform):
from . import C4982803_Enable_PxMesh_Option as test_module
from .collider import C4982803_Enable_PxMesh_Option as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(self, request, workspace, editor, launcher_platform):
from . import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module
from .collider import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform):
from .general import C15425929_Undo_Redo as test_module
self._run_test(request, workspace, editor, test_module)
@@ -0,0 +1,348 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import pytest
import os
import sys
import inspect
from ly_test_tools import LAUNCHERS
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
from .utils.FileManagement import FileManagement as fm
# Custom test spec, it provides functionality to override files
class EditorSingleTest_WithFileOverrides(EditorSingleTest):
# Specify here what files to override, [(original, override), ...]
files_to_override = [()]
# Base directory of the files (Default path is {ProjectName})
base_dir = None
# True will will search sub-directories for the files in base
search_subdirs = False
@classmethod
def wrap_run(cls, instance, request, workspace, editor, editor_test_results, launcher_platform):
root_path = cls.base_dir
if root_path is not None:
root_path = os.path.join(workspace.paths.engine_root(), root_path)
else:
# Default to project folder
root_path = workspace.paths.project()
# Try to locate both target and source files
original_file_list, override_file_list = zip(*cls.files_to_override)
try:
file_list = fm._find_files(original_file_list + override_file_list, root_path, cls.search_subdirs)
except RuntimeWarning as w:
assert False, (
w.message
+ " Please check use of search_subdirs; make sure you are using the correct parent directory."
)
for f in original_file_list:
fm._restore_file(f, file_list[f])
fm._backup_file(f, file_list[f])
for original, override in cls.files_to_override:
fm._copy_file(override, file_list[override], original, file_list[override])
yield # Run Test
for f in original_file_list:
fm._restore_file(f, file_list[f])
@pytest.mark.SUITE_main
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
@staticmethod
def get_number_parallel_editors():
return 16
#########################################
# Non-atomic tests: These need to be run in a single editor because they have custom setup and teardown
class C4044459_Material_DynamicFriction(EditorSingleTest_WithFileOverrides):
from .material import C4044459_Material_DynamicFriction as test_module
files_to_override = [
('physxsystemconfiguration.setreg', 'C4044459_Material_DynamicFriction.setreg_override')
]
base_dir = "AutomatedTesting/Registry"
class C4982593_PhysXCollider_CollisionLayerTest(EditorSingleTest_WithFileOverrides):
from .collider import C4982593_PhysXCollider_CollisionLayerTest as test_module
files_to_override = [
('physxsystemconfiguration.setreg', 'C4982593_PhysXCollider_CollisionLayer.setreg_override')
]
base_dir = "AutomatedTesting/Registry"
#########################################
class C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(EditorSharedTest):
from .collider import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
class C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(EditorSharedTest):
from .force_region import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module
class C15425929_Undo_Redo(EditorSharedTest):
from .general import C15425929_Undo_Redo as test_module
class C4976243_Collision_SameCollisionGroupDiffCollisionLayers(EditorSharedTest):
from .collider import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module
class C14654881_CharacterController_SwitchLevels(EditorSharedTest):
from .character_controller import C14654881_CharacterController_SwitchLevels as test_module
class C17411467_AddPhysxRagdollComponent(EditorSharedTest):
from .ragdoll import C17411467_AddPhysxRagdollComponent as test_module
class C12712453_ScriptCanvas_MultipleRaycastNode(EditorSharedTest):
from .script_canvas import C12712453_ScriptCanvas_MultipleRaycastNode as test_module
class C18243586_Joints_HingeLeadFollowerCollide(EditorSharedTest):
from .joints import C18243586_Joints_HingeLeadFollowerCollide as test_module
class C4982803_Enable_PxMesh_Option(EditorSharedTest):
from .collider import C4982803_Enable_PxMesh_Option as test_module
class C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(EditorSharedTest):
from .collider import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module
class C3510642_Terrain_NotCollideWithTerrain(EditorSharedTest):
from .terrain import C3510642_Terrain_NotCollideWithTerrain as test_module
class C4976195_RigidBodies_InitialLinearVelocity(EditorSharedTest):
from .rigid_body import C4976195_RigidBodies_InitialLinearVelocity as test_module
class C4976206_RigidBodies_GravityEnabledActive(EditorSharedTest):
from .rigid_body import C4976206_RigidBodies_GravityEnabledActive as test_module
class C4976207_PhysXRigidBodies_KinematicBehavior(EditorSharedTest):
from .rigid_body import C4976207_PhysXRigidBodies_KinematicBehavior as test_module
class C5932042_PhysXForceRegion_LinearDamping(EditorSharedTest):
from .force_region import C5932042_PhysXForceRegion_LinearDamping as test_module
class C5932043_ForceRegion_SimpleDragOnRigidBodies(EditorSharedTest):
from .force_region import C5932043_ForceRegion_SimpleDragOnRigidBodies as test_module
class C5959760_PhysXForceRegion_PointForceExertion(EditorSharedTest):
from .force_region import C5959760_PhysXForceRegion_PointForceExertion as test_module
class C5959764_ForceRegion_ForceRegionImpulsesCapsule(EditorSharedTest):
from .force_region import C5959764_ForceRegion_ForceRegionImpulsesCapsule as test_module
class C5340400_RigidBody_ManualMomentOfInertia(EditorSharedTest):
from .rigid_body import C5340400_RigidBody_ManualMomentOfInertia as test_module
class C4976210_COM_ManualSetting(EditorSharedTest):
from .rigid_body import C4976210_COM_ManualSetting as test_module
class C4976194_RigidBody_PhysXComponentIsValid(EditorSharedTest):
from .rigid_body import C4976194_RigidBody_PhysXComponentIsValid as test_module
class C5932045_ForceRegion_Spline(EditorSharedTest):
from .force_region import C5932045_ForceRegion_Spline as test_module
class C4982797_Collider_ColliderOffset(EditorSharedTest):
from .collider import C4982797_Collider_ColliderOffset as test_module
class C4976200_RigidBody_AngularDampingObjectRotation(EditorSharedTest):
from .rigid_body import C4976200_RigidBody_AngularDampingObjectRotation as test_module
class C5689529_Verify_Terrain_RigidBody_Collider_Mesh(EditorSharedTest):
from .general import C5689529_Verify_Terrain_RigidBody_Collider_Mesh as test_module
class C5959810_ForceRegion_ForceRegionCombinesForces(EditorSharedTest):
from .force_region import C5959810_ForceRegion_ForceRegionCombinesForces as test_module
class C5959765_ForceRegion_AssetGetsImpulsed(EditorSharedTest):
from .force_region import C5959765_ForceRegion_AssetGetsImpulsed as test_module
class C6274125_ScriptCanvas_TriggerEvents(EditorSharedTest):
from .script_canvas import C6274125_ScriptCanvas_TriggerEvents as test_module
# needs to be updated to log for unexpected lines
# expected_lines = test_module.LogLines.expected_lines
class C6090554_ForceRegion_PointForceNegative(EditorSharedTest):
from .force_region import C6090554_ForceRegion_PointForceNegative as test_module
class C6090550_ForceRegion_WorldSpaceForceNegative(EditorSharedTest):
from .force_region import C6090550_ForceRegion_WorldSpaceForceNegative as test_module
class C6090552_ForceRegion_LinearDampingNegative(EditorSharedTest):
from .force_region import C6090552_ForceRegion_LinearDampingNegative as test_module
class C5968760_ForceRegion_CheckNetForceChange(EditorSharedTest):
from .force_region import C5968760_ForceRegion_CheckNetForceChange as test_module
class C12712452_ScriptCanvas_CollisionEvents(EditorSharedTest):
from .script_canvas import C12712452_ScriptCanvas_CollisionEvents as test_module
class C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude(EditorSharedTest):
from .force_region import C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude as test_module
class C4976204_Verify_Start_Asleep_Condition(EditorSharedTest):
from .rigid_body import C4976204_Verify_Start_Asleep_Condition as test_module
class C6090546_ForceRegion_SliceFileInstantiates(EditorSharedTest):
from .force_region import C6090546_ForceRegion_SliceFileInstantiates as test_module
class C6090551_ForceRegion_LocalSpaceForceNegative(EditorSharedTest):
from .force_region import C6090551_ForceRegion_LocalSpaceForceNegative as test_module
class C6090553_ForceRegion_SimpleDragForceOnRigidBodies(EditorSharedTest):
from .force_region import C6090553_ForceRegion_SimpleDragForceOnRigidBodies as test_module
class C4976209_RigidBody_ComputesCOM(EditorSharedTest):
from .rigid_body import C4976209_RigidBody_ComputesCOM as test_module
class C4976201_RigidBody_MassIsAssigned(EditorSharedTest):
from .rigid_body import C4976201_RigidBody_MassIsAssigned as test_module
class C12868580_ForceRegion_SplineModifiedTransform(EditorSharedTest):
from .force_region import C12868580_ForceRegion_SplineModifiedTransform as test_module
class C12712455_ScriptCanvas_ShapeCastVerification(EditorSharedTest):
from .script_canvas import C12712455_ScriptCanvas_ShapeCastVerification as test_module
class C4976197_RigidBodies_InitialAngularVelocity(EditorSharedTest):
from .rigid_body import C4976197_RigidBodies_InitialAngularVelocity as test_module
class C6090555_ForceRegion_SplineFollowOnRigidBodies(EditorSharedTest):
from .force_region import C6090555_ForceRegion_SplineFollowOnRigidBodies as test_module
class C6131473_StaticSlice_OnDynamicSliceSpawn(EditorSharedTest):
from .general import C6131473_StaticSlice_OnDynamicSliceSpawn as test_module
class C5959808_ForceRegion_PositionOffset(EditorSharedTest):
from .force_region import C5959808_ForceRegion_PositionOffset as test_module
@pytest.mark.xfail(reason="Something with the CryRenderer disabling is causing this test to fail now.")
class C13895144_Ragdoll_ChangeLevel(EditorSharedTest):
from .ragdoll import C13895144_Ragdoll_ChangeLevel as test_module
class C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody(EditorSharedTest):
from .force_region import C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody as test_module
@pytest.mark.xfail(reason="This test will sometimes fail as the ball will continue to roll before the timeout is reached.")
class C4976202_RigidBody_StopsWhenBelowKineticThreshold(EditorSharedTest):
from .rigid_body import C4976202_RigidBody_StopsWhenBelowKineticThreshold as test_module
class C13351703_COM_NotIncludeTriggerShapes(EditorSharedTest):
from .rigid_body import C13351703_COM_NotIncludeTriggerShapes as test_module
class C5296614_PhysXMaterial_ColliderShape(EditorSharedTest):
from .material import C5296614_PhysXMaterial_ColliderShape as test_module
class C4982595_Collider_TriggerDisablesCollision(EditorSharedTest):
from .collider import C4982595_Collider_TriggerDisablesCollision as test_module
class C14976307_Gravity_SetGravityWorks(EditorSharedTest):
from .general import C14976307_Gravity_SetGravityWorks as test_module
class C4044694_Material_EmptyLibraryUsesDefault(EditorSharedTest):
from .material import C4044694_Material_EmptyLibraryUsesDefault as test_module
class C15845879_ForceRegion_HighLinearDampingForce(EditorSharedTest):
from .force_region import C15845879_ForceRegion_HighLinearDampingForce as test_module
class C4976218_RigidBodies_InertiaObjectsNotComputed(EditorSharedTest):
from .rigid_body import C4976218_RigidBodies_InertiaObjectsNotComputed as test_module
class C14902098_ScriptCanvas_PostPhysicsUpdate(EditorSharedTest):
from .script_canvas import C14902098_ScriptCanvas_PostPhysicsUpdate as test_module
# Note: Test needs to be updated to log for unexpected lines
# unexpected_lines = ["Assert"] + test_module.Lines.unexpected
class C5959761_ForceRegion_PhysAssetExertsPointForce(EditorSharedTest):
from .force_region import C5959761_ForceRegion_PhysAssetExertsPointForce as test_module
# Marking the Test as expected to fail using the xfail decorator due to sporadic failure on Automated Review: SPEC-3146
# The test still runs, but a failure of the test doesn't result in the test run failing
@pytest.mark.xfail(reason="Test Sporadically fails with message [ NOT FOUND ] Success: Bar1 : Expected angular velocity")
class C13352089_RigidBodies_MaxAngularVelocity(EditorSharedTest):
from .rigid_body import C13352089_RigidBodies_MaxAngularVelocity as test_module
class C18243584_Joints_HingeSoftLimitsConstrained(EditorSharedTest):
from .joints import C18243584_Joints_HingeSoftLimitsConstrained as test_module
class C18243589_Joints_BallSoftLimitsConstrained(EditorSharedTest):
from .joints import C18243589_Joints_BallSoftLimitsConstrained as test_module
class C18243591_Joints_BallLeadFollowerCollide(EditorSharedTest):
from .joints import C18243591_Joints_BallLeadFollowerCollide as test_module
class C19578018_ShapeColliderWithNoShapeComponent(EditorSharedTest):
from .collider import C19578018_ShapeColliderWithNoShapeComponent as test_module
class C14861500_DefaultSetting_ColliderShape(EditorSharedTest):
from .collider import C14861500_DefaultSetting_ColliderShape as test_module
class C19723164_ShapeCollider_WontCrashEditor(EditorSharedTest):
from .collider import C19723164_ShapeColliders_WontCrashEditor as test_module
class C4982800_PhysXColliderShape_CanBeSelected(EditorSharedTest):
from .collider import C4982800_PhysXColliderShape_CanBeSelected as test_module
class C4982801_PhysXColliderShape_CanBeSelected(EditorSharedTest):
from .collider import C4982801_PhysXColliderShape_CanBeSelected as test_module
class C4982802_PhysXColliderShape_CanBeSelected(EditorSharedTest):
from .collider import C4982802_PhysXColliderShape_CanBeSelected as test_module
class C12905528_ForceRegion_WithNonTriggerCollider(EditorSharedTest):
from .force_region import C12905528_ForceRegion_WithNonTriggerCollider as test_module
# Fixme: expected_lines = ["[Warning] (PhysX Force Region) - Please ensure collider component marked as trigger exists in entity"]
class C5932040_ForceRegion_CubeExertsWorldForce(EditorSharedTest):
from .force_region import C5932040_ForceRegion_CubeExertsWorldForce as test_module
class C5932044_ForceRegion_PointForceOnRigidBody(EditorSharedTest):
from .force_region import C5932044_ForceRegion_PointForceOnRigidBody as test_module
class C5959759_RigidBody_ForceRegionSpherePointForce(EditorSharedTest):
from .force_region import C5959759_RigidBody_ForceRegionSpherePointForce as test_module
class C5959809_ForceRegion_RotationalOffset(EditorSharedTest):
from .force_region import C5959809_ForceRegion_RotationalOffset as test_module
class C15096740_Material_LibraryUpdatedCorrectly(EditorSharedTest):
from .material import C15096740_Material_LibraryUpdatedCorrectly as test_module
class C4976236_AddPhysxColliderComponent(EditorSharedTest):
from .collider import C4976236_AddPhysxColliderComponent as test_module
@pytest.mark.xfail(reason="This will fail due to this issue ATOM-15487.")
class C14861502_PhysXCollider_AssetAutoAssigned(EditorSharedTest):
from .collider import C14861502_PhysXCollider_AssetAutoAssigned as test_module
class C14861501_PhysXCollider_RenderMeshAutoAssigned(EditorSharedTest):
from .collider import C14861501_PhysXCollider_RenderMeshAutoAssigned as test_module
class C4044695_PhysXCollider_AddMultipleSurfaceFbx(EditorSharedTest):
from .collider import C4044695_PhysXCollider_AddMultipleSurfaceFbx as test_module
class C14861504_RenderMeshAsset_WithNoPxAsset(EditorSharedTest):
from .collider import C14861504_RenderMeshAsset_WithNoPxAsset as test_module
class C100000_RigidBody_EnablingGravityWorksPoC(EditorSharedTest):
from .collider import C100000_RigidBody_EnablingGravityWorksPoC as test_module
class C4982798_Collider_ColliderRotationOffset(EditorSharedTest):
from .collider import C4982798_Collider_ColliderRotationOffset as test_module
class C15308217_NoCrash_LevelSwitch(EditorSharedTest):
from .terrain import C15308217_NoCrash_LevelSwitch as test_module
class C6090547_ForceRegion_ParentChildForceRegions(EditorSharedTest):
from .force_region import C6090547_ForceRegion_ParentChildForceRegions as test_module
class C19578021_ShapeCollider_CanBeAdded(EditorSharedTest):
from .collider import C19578021_ShapeCollider_CanBeAdded as test_module
class C15425929_Undo_Redo(EditorSharedTest):
from .general import C15425929_Undo_Redo as test_module
@@ -1,105 +0,0 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import pytest
import os
import sys
import inspect
from ly_test_tools import LAUNCHERS
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
from .FileManagement import FileManagement as fm
# Custom test spec, it provides functionality to override files
class EditorSingleTest_WithFileOverrides(EditorSingleTest):
# Specify here what files to override, [(original, override), ...]
files_to_override = [()]
# Base directory of the files (Default path is {ProjectName})
base_dir = None
# True will will search sub-directories for the files in base
search_subdirs = False
@classmethod
def wrap_run(cls, instance, request, workspace, editor, editor_test_results, launcher_platform):
root_path = cls.base_dir
if root_path is not None:
root_path = os.path.join(workspace.paths.engine_root(), root_path)
else:
# Default to project folder
root_path = workspace.paths.project()
# Try to locate both target and source files
original_file_list, override_file_list = zip(*cls.files_to_override)
try:
file_list = fm._find_files(original_file_list + override_file_list, root_path, cls.search_subdirs)
except RuntimeWarning as w:
assert False, (
w.message
+ " Please check use of search_subdirs; make sure you are using the correct parent directory."
)
for f in original_file_list:
fm._restore_file(f, file_list[f])
fm._backup_file(f, file_list[f])
for original, override in cls.files_to_override:
fm._copy_file(override, file_list[override], original, file_list[override])
yield # Run Test
for f in original_file_list:
fm._restore_file(f, file_list[f])
@pytest.mark.SUITE_main
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(EditorTestSuite):
class C4044459_Material_DynamicFriction(EditorSingleTest_WithFileOverrides):
from . import C4044459_Material_DynamicFriction as test_module
files_to_override = [
('physxsystemconfiguration.setreg', 'C4044459_Material_DynamicFriction.setreg_override')
]
base_dir = "AutomatedTesting/Registry"
class C4982593_PhysXCollider_CollisionLayerTest(EditorSingleTest_WithFileOverrides):
from . import C4982593_PhysXCollider_CollisionLayerTest as test_module
files_to_override = [
('physxsystemconfiguration.setreg', 'C4982593_PhysXCollider_CollisionLayer.setreg_override')
]
base_dir = "AutomatedTesting/Registry"
class C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(EditorSharedTest):
from . import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
class C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(EditorSharedTest):
from . import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module
class C15425929_Undo_Redo(EditorSharedTest):
from . import C15425929_Undo_Redo as test_module
class C4976243_Collision_SameCollisionGroupDiffCollisionLayers(EditorSharedTest):
from . import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module
class C14654881_CharacterController_SwitchLevels(EditorSharedTest):
from . import C14654881_CharacterController_SwitchLevels as test_module
class C17411467_AddPhysxRagdollComponent(EditorSharedTest):
from . import C17411467_AddPhysxRagdollComponent as test_module
class C12712453_ScriptCanvas_MultipleRaycastNode(EditorSharedTest):
from . import C12712453_ScriptCanvas_MultipleRaycastNode as test_module
class C18243586_Joints_HingeLeadFollowerCollide(EditorSharedTest):
from . import C18243586_Joints_HingeLeadFollowerCollide as test_module
class C4982803_Enable_PxMesh_Option(EditorSharedTest):
from . import C4982803_Enable_PxMesh_Option as test_module
class C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(EditorSharedTest):
from . import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module
@@ -12,7 +12,7 @@ import pytest
import os
import sys
from .FileManagement import FileManagement as fm
from .utils.FileManagement import FileManagement as fm
from ly_test_tools import LAUNCHERS
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
@@ -30,219 +30,219 @@ class TestAutomation(TestAutomationBase):
@revert_physics_config
def test_C3510642_Terrain_NotCollideWithTerrain(self, request, workspace, editor, launcher_platform):
from . import C3510642_Terrain_NotCollideWithTerrain as test_module
from .terrain import C3510642_Terrain_NotCollideWithTerrain as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976195_RigidBodies_InitialLinearVelocity(self, request, workspace, editor, launcher_platform):
from . import C4976195_RigidBodies_InitialLinearVelocity as test_module
from .rigid_body import C4976195_RigidBodies_InitialLinearVelocity as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976206_RigidBodies_GravityEnabledActive(self, request, workspace, editor, launcher_platform):
from . import C4976206_RigidBodies_GravityEnabledActive as test_module
from .rigid_body import C4976206_RigidBodies_GravityEnabledActive as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976207_PhysXRigidBodies_KinematicBehavior(self, request, workspace, editor, launcher_platform):
from . import C4976207_PhysXRigidBodies_KinematicBehavior as test_module
from .rigid_body import C4976207_PhysXRigidBodies_KinematicBehavior as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5932042_PhysXForceRegion_LinearDamping(self, request, workspace, editor, launcher_platform):
from . import C5932042_PhysXForceRegion_LinearDamping as test_module
from .force_region import C5932042_PhysXForceRegion_LinearDamping as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5932043_ForceRegion_SimpleDragOnRigidBodies(self, request, workspace, editor, launcher_platform):
from . import C5932043_ForceRegion_SimpleDragOnRigidBodies as test_module
from .force_region import C5932043_ForceRegion_SimpleDragOnRigidBodies as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5959760_PhysXForceRegion_PointForceExertion(self, request, workspace, editor, launcher_platform):
from . import C5959760_PhysXForceRegion_PointForceExertion as test_module
from .force_region import C5959760_PhysXForceRegion_PointForceExertion as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5959764_ForceRegion_ForceRegionImpulsesCapsule(self, request, workspace, editor, launcher_platform):
from . import C5959764_ForceRegion_ForceRegionImpulsesCapsule as test_module
from .force_region import C5959764_ForceRegion_ForceRegionImpulsesCapsule as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5340400_RigidBody_ManualMomentOfInertia(self, request, workspace, editor, launcher_platform):
from . import C5340400_RigidBody_ManualMomentOfInertia as test_module
from .rigid_body import C5340400_RigidBody_ManualMomentOfInertia as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976210_COM_ManualSetting(self, request, workspace, editor, launcher_platform):
from . import C4976210_COM_ManualSetting as test_module
from .rigid_body import C4976210_COM_ManualSetting as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976194_RigidBody_PhysXComponentIsValid(self, request, workspace, editor, launcher_platform):
from . import C4976194_RigidBody_PhysXComponentIsValid as test_module
from .rigid_body import C4976194_RigidBody_PhysXComponentIsValid as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5932045_ForceRegion_Spline(self, request, workspace, editor, launcher_platform):
from . import C5932045_ForceRegion_Spline as test_module
from .force_region import C5932045_ForceRegion_Spline as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C4044457_Material_RestitutionCombine.setreg_override', 'AutomatedTesting/Registry')
def test_C4044457_Material_RestitutionCombine(self, request, workspace, editor, launcher_platform):
from . import C4044457_Material_RestitutionCombine as test_module
from .material import C4044457_Material_RestitutionCombine as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C4044456_Material_FrictionCombine.setreg_override', 'AutomatedTesting/Registry')
def test_C4044456_Material_FrictionCombine(self, request, workspace, editor, launcher_platform):
from . import C4044456_Material_FrictionCombine as test_module
from .material import C4044456_Material_FrictionCombine as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4982797_Collider_ColliderOffset(self, request, workspace, editor, launcher_platform):
from . import C4982797_Collider_ColliderOffset as test_module
from .collider import C4982797_Collider_ColliderOffset as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976200_RigidBody_AngularDampingObjectRotation(self, request, workspace, editor, launcher_platform):
from . import C4976200_RigidBody_AngularDampingObjectRotation as test_module
from .rigid_body import C4976200_RigidBody_AngularDampingObjectRotation as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5689529_Verify_Terrain_RigidBody_Collider_Mesh(self, request, workspace, editor, launcher_platform):
from . import C5689529_Verify_Terrain_RigidBody_Collider_Mesh as test_module
from .general import C5689529_Verify_Terrain_RigidBody_Collider_Mesh as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5959810_ForceRegion_ForceRegionCombinesForces(self, request, workspace, editor, launcher_platform):
from . import C5959810_ForceRegion_ForceRegionCombinesForces as test_module
from .force_region import C5959810_ForceRegion_ForceRegionCombinesForces as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5959765_ForceRegion_AssetGetsImpulsed(self, request, workspace, editor, launcher_platform):
from . import C5959765_ForceRegion_AssetGetsImpulsed as test_module
from .force_region import C5959765_ForceRegion_AssetGetsImpulsed as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6274125_ScriptCanvas_TriggerEvents(self, request, workspace, editor, launcher_platform):
from . import C6274125_ScriptCanvas_TriggerEvents as test_module
from .script_canvas import C6274125_ScriptCanvas_TriggerEvents as test_module
# FIXME: expected_lines = test_module.LogLines.expected_lines
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6090554_ForceRegion_PointForceNegative(self, request, workspace, editor, launcher_platform):
from . import C6090554_ForceRegion_PointForceNegative as test_module
from .force_region import C6090554_ForceRegion_PointForceNegative as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6090550_ForceRegion_WorldSpaceForceNegative(self, request, workspace, editor, launcher_platform):
from . import C6090550_ForceRegion_WorldSpaceForceNegative as test_module
from .force_region import C6090550_ForceRegion_WorldSpaceForceNegative as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6090552_ForceRegion_LinearDampingNegative(self, request, workspace, editor, launcher_platform):
from . import C6090552_ForceRegion_LinearDampingNegative as test_module
from .force_region import C6090552_ForceRegion_LinearDampingNegative as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5968760_ForceRegion_CheckNetForceChange(self, request, workspace, editor, launcher_platform):
from . import C5968760_ForceRegion_CheckNetForceChange as test_module
from .force_region import C5968760_ForceRegion_CheckNetForceChange as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C12712452_ScriptCanvas_CollisionEvents(self, request, workspace, editor, launcher_platform):
from . import C12712452_ScriptCanvas_CollisionEvents as test_module
from .script_canvas import C12712452_ScriptCanvas_CollisionEvents as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude(self, request, workspace, editor, launcher_platform):
from . import C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude as test_module
from .force_region import C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976204_Verify_Start_Asleep_Condition(self, request, workspace, editor, launcher_platform):
from . import C4976204_Verify_Start_Asleep_Condition as test_module
from .rigid_body import C4976204_Verify_Start_Asleep_Condition as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6090546_ForceRegion_SliceFileInstantiates(self, request, workspace, editor, launcher_platform):
from . import C6090546_ForceRegion_SliceFileInstantiates as test_module
from .force_region import C6090546_ForceRegion_SliceFileInstantiates as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6090551_ForceRegion_LocalSpaceForceNegative(self, request, workspace, editor, launcher_platform):
from . import C6090551_ForceRegion_LocalSpaceForceNegative as test_module
from .force_region import C6090551_ForceRegion_LocalSpaceForceNegative as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6090553_ForceRegion_SimpleDragForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
from . import C6090553_ForceRegion_SimpleDragForceOnRigidBodies as test_module
from .force_region import C6090553_ForceRegion_SimpleDragForceOnRigidBodies as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976209_RigidBody_ComputesCOM(self, request, workspace, editor, launcher_platform):
from . import C4976209_RigidBody_ComputesCOM as test_module
from .rigid_body import C4976209_RigidBody_ComputesCOM as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976201_RigidBody_MassIsAssigned(self, request, workspace, editor, launcher_platform):
from . import C4976201_RigidBody_MassIsAssigned as test_module
from .rigid_body import C4976201_RigidBody_MassIsAssigned as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C18981526_Material_RestitutionCombinePriority.setreg_override', 'AutomatedTesting/Registry')
def test_C18981526_Material_RestitutionCombinePriority(self, request, workspace, editor, launcher_platform):
from . import C18981526_Material_RestitutionCombinePriority as test_module
from .material import C18981526_Material_RestitutionCombinePriority as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C12868580_ForceRegion_SplineModifiedTransform(self, request, workspace, editor, launcher_platform):
from . import C12868580_ForceRegion_SplineModifiedTransform as test_module
from .force_region import C12868580_ForceRegion_SplineModifiedTransform as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C12712455_ScriptCanvas_ShapeCastVerification(self, request, workspace, editor, launcher_platform):
from . import C12712455_ScriptCanvas_ShapeCastVerification as test_module
from .script_canvas import C12712455_ScriptCanvas_ShapeCastVerification as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976197_RigidBodies_InitialAngularVelocity(self, request, workspace, editor, launcher_platform):
from . import C4976197_RigidBodies_InitialAngularVelocity as test_module
from .rigid_body import C4976197_RigidBodies_InitialAngularVelocity as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6090555_ForceRegion_SplineFollowOnRigidBodies(self, request, workspace, editor, launcher_platform):
from . import C6090555_ForceRegion_SplineFollowOnRigidBodies as test_module
from .force_region import C6090555_ForceRegion_SplineFollowOnRigidBodies as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6131473_StaticSlice_OnDynamicSliceSpawn(self, request, workspace, editor, launcher_platform):
from . import C6131473_StaticSlice_OnDynamicSliceSpawn as test_module
from .general import C6131473_StaticSlice_OnDynamicSliceSpawn as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5959808_ForceRegion_PositionOffset(self, request, workspace, editor, launcher_platform):
from . import C5959808_ForceRegion_PositionOffset as test_module
from .force_region import C5959808_ForceRegion_PositionOffset as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C18977601_Material_FrictionCombinePriority.setreg_override', 'AutomatedTesting/Registry')
def test_C18977601_Material_FrictionCombinePriority(self, request, workspace, editor, launcher_platform):
from . import C18977601_Material_FrictionCombinePriority as test_module
from .material import C18977601_Material_FrictionCombinePriority as test_module
self._run_test(request, workspace, editor, test_module)
@pytest.mark.xfail(
reason="Something with the CryRenderer disabling is causing this test to fail now.")
@revert_physics_config
def test_C13895144_Ragdoll_ChangeLevel(self, request, workspace, editor, launcher_platform):
from . import C13895144_Ragdoll_ChangeLevel as test_module
from .ragdoll import C13895144_Ragdoll_ChangeLevel as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody(self, request, workspace, editor, launcher_platform):
from . import C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody as test_module
from .force_region import C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody as test_module
self._run_test(request, workspace, editor, test_module)
# Marking the test as an expected failure due to sporadic failure on Automated Review: LYN-2580
@@ -252,96 +252,96 @@ class TestAutomation(TestAutomationBase):
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C4044697_Material_PerfaceMaterialValidation.setreg_override', 'AutomatedTesting/Registry')
def test_C4044697_Material_PerfaceMaterialValidation(self, request, workspace, editor, launcher_platform):
from . import C4044697_Material_PerfaceMaterialValidation as test_module
from .material import C4044697_Material_PerfaceMaterialValidation as test_module
self._run_test(request, workspace, editor, test_module)
@pytest.mark.xfail(
reason="This test will sometimes fail as the ball will continue to roll before the timeout is reached.")
@revert_physics_config
def test_C4976202_RigidBody_StopsWhenBelowKineticThreshold(self, request, workspace, editor, launcher_platform):
from . import C4976202_RigidBody_StopsWhenBelowKineticThreshold as test_module
from .rigid_body import C4976202_RigidBody_StopsWhenBelowKineticThreshold as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C13351703_COM_NotIncludeTriggerShapes(self, request, workspace, editor, launcher_platform):
from . import C13351703_COM_NotIncludeTriggerShapes as test_module
from .rigid_body import C13351703_COM_NotIncludeTriggerShapes as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5296614_PhysXMaterial_ColliderShape(self, request, workspace, editor, launcher_platform):
from . import C5296614_PhysXMaterial_ColliderShape as test_module
from .material import C5296614_PhysXMaterial_ColliderShape as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4982595_Collider_TriggerDisablesCollision(self, request, workspace, editor, launcher_platform):
from . import C4982595_Collider_TriggerDisablesCollision as test_module
from .collider import C4982595_Collider_TriggerDisablesCollision as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C14976307_Gravity_SetGravityWorks(self, request, workspace, editor, launcher_platform):
from . import C14976307_Gravity_SetGravityWorks as test_module
from .general import C14976307_Gravity_SetGravityWorks as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override', 'AutomatedTesting/Registry')
def test_C15556261_PhysXMaterials_CharacterControllerMaterialAssignment(self, request, workspace, editor, launcher_platform):
from . import C15556261_PhysXMaterials_CharacterControllerMaterialAssignment as test_module
from .material import C15556261_PhysXMaterials_CharacterControllerMaterialAssignment as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4044694_Material_EmptyLibraryUsesDefault(self, request, workspace, editor, launcher_platform):
from . import C4044694_Material_EmptyLibraryUsesDefault as test_module
from .material import C4044694_Material_EmptyLibraryUsesDefault as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C15845879_ForceRegion_HighLinearDampingForce(self, request, workspace, editor, launcher_platform):
from . import C15845879_ForceRegion_HighLinearDampingForce as test_module
from .force_region import C15845879_ForceRegion_HighLinearDampingForce as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4976218_RigidBodies_InertiaObjectsNotComputed(self, request, workspace, editor, launcher_platform):
from . import C4976218_RigidBodies_InertiaObjectsNotComputed as test_module
from .rigid_body import C4976218_RigidBodies_InertiaObjectsNotComputed as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C14902098_ScriptCanvas_PostPhysicsUpdate(self, request, workspace, editor, launcher_platform):
from . import C14902098_ScriptCanvas_PostPhysicsUpdate as test_module
from .script_canvas import C14902098_ScriptCanvas_PostPhysicsUpdate as test_module
# Fixme: unexpected_lines = ["Assert"] + test_module.Lines.unexpected
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C4976245_PhysXCollider_CollisionLayerTest.setreg_override', 'AutomatedTesting/Registry')
def test_C4976245_PhysXCollider_CollisionLayerTest(self, request, workspace, editor, launcher_platform):
from . import C4976245_PhysXCollider_CollisionLayerTest as test_module
from .collider import C4976245_PhysXCollider_CollisionLayerTest as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C4976244_Collider_SameGroupSameLayerCollision.setreg_override', 'AutomatedTesting/Registry')
def test_C4976244_Collider_SameGroupSameLayerCollision(self, request, workspace, editor, launcher_platform):
from . import C4976244_Collider_SameGroupSameLayerCollision as test_module
from .collider import C4976244_Collider_SameGroupSameLayerCollision as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxdefaultsceneconfiguration.setreg','C14195074_ScriptCanvas_PostUpdateEvent.setreg_override', 'AutomatedTesting/Registry')
def test_C14195074_ScriptCanvas_PostUpdateEvent(self, request, workspace, editor, launcher_platform):
from . import C14195074_ScriptCanvas_PostUpdateEvent as test_module
from .script_canvas import C14195074_ScriptCanvas_PostUpdateEvent as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C4044461_Material_Restitution.setreg_override', 'AutomatedTesting/Registry')
def test_C4044461_Material_Restitution(self, request, workspace, editor, launcher_platform):
from . import C4044461_Material_Restitution as test_module
from .material import C4044461_Material_Restitution as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxdefaultsceneconfiguration.setreg','C14902097_ScriptCanvas_PreUpdateEvent.setreg_override', 'AutomatedTesting/Registry')
def test_C14902097_ScriptCanvas_PreUpdateEvent(self, request, workspace, editor, launcher_platform):
from . import C14902097_ScriptCanvas_PreUpdateEvent as test_module
from .script_canvas import C14902097_ScriptCanvas_PreUpdateEvent as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C5959761_ForceRegion_PhysAssetExertsPointForce(self, request, workspace, editor, launcher_platform):
from . import C5959761_ForceRegion_PhysAssetExertsPointForce as test_module
from .force_region import C5959761_ForceRegion_PhysAssetExertsPointForce as test_module
self._run_test(request, workspace, editor, test_module)
# Marking the Test as expected to fail using the xfail decorator due to sporadic failure on Automated Review: SPEC-3146
@@ -349,138 +349,138 @@ class TestAutomation(TestAutomationBase):
@pytest.mark.xfail(reason="Test Sporadically fails with message [ NOT FOUND ] Success: Bar1 : Expected angular velocity")
@revert_physics_config
def test_C13352089_RigidBodies_MaxAngularVelocity(self, request, workspace, editor, launcher_platform):
from . import C13352089_RigidBodies_MaxAngularVelocity as test_module
from .rigid_body import C13352089_RigidBodies_MaxAngularVelocity as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C18243584_Joints_HingeSoftLimitsConstrained(self, request, workspace, editor, launcher_platform):
from . import C18243584_Joints_HingeSoftLimitsConstrained as test_module
from .joints import C18243584_Joints_HingeSoftLimitsConstrained as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C18243589_Joints_BallSoftLimitsConstrained(self, request, workspace, editor, launcher_platform):
from . import C18243589_Joints_BallSoftLimitsConstrained as test_module
from .joints import C18243589_Joints_BallSoftLimitsConstrained as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C18243591_Joints_BallLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
from . import C18243591_Joints_BallLeadFollowerCollide as test_module
from .joints import C18243591_Joints_BallLeadFollowerCollide as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C4976227_Collider_NewGroup.setreg_override', 'AutomatedTesting/Registry')
def test_C4976227_Collider_NewGroup(self, request, workspace, editor, launcher_platform):
from . import C4976227_Collider_NewGroup as test_module
from .collider import C4976227_Collider_NewGroup as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C19578018_ShapeColliderWithNoShapeComponent(self, request, workspace, editor, launcher_platform):
from . import C19578018_ShapeColliderWithNoShapeComponent as test_module
from .collider import C19578018_ShapeColliderWithNoShapeComponent as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C14861500_DefaultSetting_ColliderShape(self, request, workspace, editor, launcher_platform):
from . import C14861500_DefaultSetting_ColliderShape as test_module
from .collider import C14861500_DefaultSetting_ColliderShape as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C19723164_ShapeCollider_WontCrashEditor(self, request, workspace, editor, launcher_platform):
from . import C19723164_ShapeColliders_WontCrashEditor as test_module
from .collider import C19723164_ShapeColliders_WontCrashEditor as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4982800_PhysXColliderShape_CanBeSelected(self, request, workspace, editor, launcher_platform):
from . import C4982800_PhysXColliderShape_CanBeSelected as test_module
from .collider import C4982800_PhysXColliderShape_CanBeSelected as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4982801_PhysXColliderShape_CanBeSelected(self, request, workspace, editor, launcher_platform):
from . import C4982801_PhysXColliderShape_CanBeSelected as test_module
from .collider import C4982801_PhysXColliderShape_CanBeSelected as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4982802_PhysXColliderShape_CanBeSelected(self, request, workspace, editor, launcher_platform):
from . import C4982802_PhysXColliderShape_CanBeSelected as test_module
from .collider import C4982802_PhysXColliderShape_CanBeSelected as test_module
self._run_test(request, workspace, editor, test_module)
def test_C12905528_ForceRegion_WithNonTriggerCollider(self, request, workspace, editor, launcher_platform):
from . import C12905528_ForceRegion_WithNonTriggerCollider as test_module
from .force_region import C12905528_ForceRegion_WithNonTriggerCollider as test_module
# Fixme: expected_lines = ["[Warning] (PhysX Force Region) - Please ensure collider component marked as trigger exists in entity"]
self._run_test(request, workspace, editor, test_module)
def test_C5932040_ForceRegion_CubeExertsWorldForce(self, request, workspace, editor, launcher_platform):
from . import C5932040_ForceRegion_CubeExertsWorldForce as test_module
from .force_region import C5932040_ForceRegion_CubeExertsWorldForce as test_module
self._run_test(request, workspace, editor, test_module)
def test_C5932044_ForceRegion_PointForceOnRigidBody(self, request, workspace, editor, launcher_platform):
from . import C5932044_ForceRegion_PointForceOnRigidBody as test_module
from .force_region import C5932044_ForceRegion_PointForceOnRigidBody as test_module
self._run_test(request, workspace, editor, test_module)
def test_C5959759_RigidBody_ForceRegionSpherePointForce(self, request, workspace, editor, launcher_platform):
from . import C5959759_RigidBody_ForceRegionSpherePointForce as test_module
from .force_region import C5959759_RigidBody_ForceRegionSpherePointForce as test_module
self._run_test(request, workspace, editor, test_module)
def test_C5959809_ForceRegion_RotationalOffset(self, request, workspace, editor, launcher_platform):
from . import C5959809_ForceRegion_RotationalOffset as test_module
from .force_region import C5959809_ForceRegion_RotationalOffset as test_module
self._run_test(request, workspace, editor, test_module)
def test_C15096740_Material_LibraryUpdatedCorrectly(self, request, workspace, editor, launcher_platform):
from . import C15096740_Material_LibraryUpdatedCorrectly as test_module
from .material import C15096740_Material_LibraryUpdatedCorrectly as test_module
self._run_test(request, workspace, editor, test_module)
def test_C4976236_AddPhysxColliderComponent(self, request, workspace, editor, launcher_platform):
from . import C4976236_AddPhysxColliderComponent as test_module
from .collider import C4976236_AddPhysxColliderComponent as test_module
self._run_test(request, workspace, editor, test_module)
@pytest.mark.xfail(
reason="This will fail due to this issue ATOM-15487.")
def test_C14861502_PhysXCollider_AssetAutoAssigned(self, request, workspace, editor, launcher_platform):
from . import C14861502_PhysXCollider_AssetAutoAssigned as test_module
from .collider import C14861502_PhysXCollider_AssetAutoAssigned as test_module
self._run_test(request, workspace, editor, test_module)
def test_C14861501_PhysXCollider_RenderMeshAutoAssigned(self, request, workspace, editor, launcher_platform):
from . import C14861501_PhysXCollider_RenderMeshAutoAssigned as test_module
from .collider import C14861501_PhysXCollider_RenderMeshAutoAssigned as test_module
self._run_test(request, workspace, editor, test_module)
def test_C4044695_PhysXCollider_AddMultipleSurfaceFbx(self, request, workspace, editor, launcher_platform):
from . import C4044695_PhysXCollider_AddMultipleSurfaceFbx as test_module
from .collider import C4044695_PhysXCollider_AddMultipleSurfaceFbx as test_module
self._run_test(request, workspace, editor, test_module)
def test_C14861504_RenderMeshAsset_WithNoPxAsset(self, request, workspace, editor, launcher_platform):
from . import C14861504_RenderMeshAsset_WithNoPxAsset as test_module
from .collider import C14861504_RenderMeshAsset_WithNoPxAsset as test_module
self._run_test(request, workspace, editor, test_module)
def test_C100000_RigidBody_EnablingGravityWorksPoC(self, request, workspace, editor, launcher_platform):
from . import C100000_RigidBody_EnablingGravityWorksPoC as test_module
from .collider import C100000_RigidBody_EnablingGravityWorksPoC as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
@fm.file_override('physxsystemconfiguration.setreg','C3510644_Collider_CollisionGroups.setreg_override', 'AutomatedTesting/Registry')
def test_C3510644_Collider_CollisionGroups(self, request, workspace, editor, launcher_platform):
from . import C3510644_Collider_CollisionGroups as test_module
from .collider import C3510644_Collider_CollisionGroups as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C4982798_Collider_ColliderRotationOffset(self, request, workspace, editor, launcher_platform):
from . import C4982798_Collider_ColliderRotationOffset as test_module
from .collider import C4982798_Collider_ColliderRotationOffset as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C15308217_NoCrash_LevelSwitch(self, request, workspace, editor, launcher_platform):
from . import C15308217_NoCrash_LevelSwitch as test_module
from .terrain import C15308217_NoCrash_LevelSwitch as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C6090547_ForceRegion_ParentChildForceRegions(self, request, workspace, editor, launcher_platform):
from . import C6090547_ForceRegion_ParentChildForceRegions as test_module
from .force_region import C6090547_ForceRegion_ParentChildForceRegions as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C19578021_ShapeCollider_CanBeAdded(self, request, workspace, editor, launcher_platform):
from . import C19578021_ShapeCollider_CanBeAdded as test_module
from .collider import C19578021_ShapeCollider_CanBeAdded as test_module
self._run_test(request, workspace, editor, test_module)
@revert_physics_config
def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform):
from . import C15425929_Undo_Redo as test_module
from .general import C15425929_Undo_Redo as test_module
self._run_test(request, workspace, editor, test_module)
@@ -12,7 +12,7 @@ import pytest
import os
import sys
from .FileManagement import FileManagement as fm
from .utils.FileManagement import FileManagement as fm
from ly_test_tools import LAUNCHERS
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
@@ -30,24 +30,16 @@ class TestAutomation(TestAutomationBase):
## Seems to be flaky, need to investigate
def test_C19536274_GetCollisionName_PrintsName(self, request, workspace, editor, launcher_platform):
from . import C19536274_GetCollisionName_PrintsName as test_module
from .general import C19536274_GetCollisionName_PrintsName as test_module
# Fixme: expected_lines=["Layer Name: Right"]
self._run_test(request, workspace, editor, test_module)
## Seems to be flaky, need to investigate
def test_C19536277_GetCollisionName_PrintsNothing(self, request, workspace, editor, launcher_platform):
from . import C19536277_GetCollisionName_PrintsNothing as test_module
from .general import C19536277_GetCollisionName_PrintsNothing as test_module
# All groups present in the PhysX Collider that could show up in test
# Fixme: collision_groups = ["All", "None", "All_NoTouchBend", "All_3", "None_1", "All_NoTouchBend_1", "All_2", "None_1_1", "All_NoTouchBend_1_1", "All_1", "None_1_1_1", "All_NoTouchBend_1_1_1", "All_4", "None_1_1_1_1", "All_NoTouchBend_1_1_1_1", "GroupLeft", "GroupRight"]
# Fixme: for group in collision_groups:
# Fixme: unexpected_lines.append(f"GroupName: {group}")
# Fixme: expected_lines=["GroupName: "]
self._run_test(request, workspace, editor, test_module)
## Seems to be flaky, need to investigate
@pytest.mark.xfail(
reason="Editor crashes and errors about files accessed by multiple processes appear in the log.")
@revert_physics_config
def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform):
from . import C15425929_Undo_Redo as test_module
self._run_test(request, workspace, editor, test_module)
@@ -29,14 +29,14 @@ class TestUtils(TestAutomationBase):
:param request: Built in pytest object, and is needed to call the pytest "addfinalizer" teardown command.
:editor: Fixture containing editor details
"""
from . import UtilTest_Physmaterial_Editor as physmaterial_editor_test_module
from .utils import UtilTest_Physmaterial_Editor as physmaterial_editor_test_module
expected_lines = []
unexpected_lines = ["Assert"]
self._run_test(request, workspace, editor, physmaterial_editor_test_module, expected_lines, unexpected_lines)
def test_UtilTest_Tracer_PicksErrorsAndWarnings(self, request, workspace, editor):
from . import UtilTest_Tracer_PicksErrorsAndWarnings as testcase_module
from .utils import UtilTest_Tracer_PicksErrorsAndWarnings as testcase_module
self._run_test(request, workspace, editor, testcase_module, [], [])
def test_FileManagement_FindingFiles(self, workspace):
@@ -262,7 +262,7 @@ class TestUtils(TestAutomationBase):
)
@fm.file_override("default.physxconfiguration", "UtilTest_PhysxConfig_Override.physxconfiguration")
def test_UtilTest_Managed_Files(self, request, workspace, editor):
from . import UtilTest_Managed_Files as test_module
from .utils import UtilTest_Managed_Files as test_module
expected_lines = []
unexpected_lines = ["Assert"]
@@ -53,11 +53,6 @@ def C14654881_CharacterController_SwitchLevels():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
import azlmbr.legacy.general as general
@@ -93,8 +88,5 @@ def C14654881_CharacterController_SwitchLevels():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C14654881_CharacterController_SwitchLevels)
@@ -25,11 +25,6 @@ class Tests():
def C100000_RigidBody_EnablingGravityWorksPoC():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -77,8 +72,5 @@ def C100000_RigidBody_EnablingGravityWorksPoC():
helper.exit_game_mode(Tests.exit_game_mode)
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C100000_RigidBody_EnablingGravityWorksPoC)
@@ -24,11 +24,6 @@ def C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC():
# Setup path
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -84,8 +79,5 @@ def C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC():
helper.exit_game_mode(Tests.exit_game_mode)
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC)
@@ -48,11 +48,6 @@ def C14861498_ConfirmError_NoPxMesh():
"""
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.utils import Tracer
@@ -85,8 +80,5 @@ def C14861498_ConfirmError_NoPxMesh():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C14861498_ConfirmError_NoPxMesh)
@@ -40,9 +40,7 @@ def C14861500_DefaultSetting_ColliderShape():
:return: None
"""
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -70,8 +68,5 @@ def C14861500_DefaultSetting_ColliderShape():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C14861500_DefaultSetting_ColliderShape)
@@ -48,13 +48,11 @@ def C14861501_PhysXCollider_RenderMeshAutoAssigned():
import os
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
from asset_utils import Asset
from editor_python_test_tools.asset_utils import Asset
# Asset paths
STATIC_MESH = os.path.join("assets", "c14861501_physxcollider_rendermeshautoassigned", "spherebot", "r0-b_body.azmodel")
@@ -91,8 +89,5 @@ def C14861501_PhysXCollider_RenderMeshAutoAssigned():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C14861501_PhysXCollider_RenderMeshAutoAssigned)
@@ -47,13 +47,11 @@ def C14861502_PhysXCollider_AssetAutoAssigned():
import os
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
from asset_utils import Asset
from editor_python_test_tools.asset_utils import Asset
# Open 3D Engine Imports
import azlmbr.legacy.general as general
@@ -93,8 +91,5 @@ def C14861502_PhysXCollider_AssetAutoAssigned():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C14861502_PhysXCollider_AssetAutoAssigned)
@@ -22,7 +22,7 @@ class Tests():
# fmt: on
def run():
def C14861504_RenderMeshAsset_WithNoPxAsset():
"""
Summary:
Create entity with Mesh component and assign a render mesh that has no physics asset to the Mesh component.
@@ -52,14 +52,12 @@ def run():
import os
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.utils import Tracer
from asset_utils import Asset
from editor_python_test_tools.asset_utils import Asset
# Open 3D Engine Imports
import azlmbr.asset as azasset
@@ -102,4 +100,5 @@ def run():
if __name__ == "__main__":
run()
from editor_python_test_tools.utils import Report
Report.start_test(C14861504_RenderMeshAsset_WithNoPxAsset)
@@ -47,9 +47,7 @@ def C19578018_ShapeColliderWithNoShapeComponent():
"""
# Built-in Imports
import ImportPathHelper as imports
imports.init()
# Helper Imports
from editor_python_test_tools.utils import Report
@@ -92,8 +90,5 @@ def C19578018_ShapeColliderWithNoShapeComponent():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C19578018_ShapeColliderWithNoShapeComponent)
@@ -44,9 +44,7 @@ def C19578021_ShapeCollider_CanBeAdded():
:return: None
"""
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -90,8 +88,5 @@ def C19578021_ShapeCollider_CanBeAdded():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C19578021_ShapeCollider_CanBeAdded)
@@ -40,9 +40,7 @@ def C19723164_ShapeColliders_WontCrashEditor():
:return: None
"""
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
@@ -96,8 +94,5 @@ def C19723164_ShapeColliders_WontCrashEditor():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C19723164_ShapeColliders_WontCrashEditor)
@@ -51,9 +51,7 @@ def C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity
import azlmbr.legacy.general as general
import azlmbr.bus
@@ -134,8 +132,5 @@ def C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain)
@@ -90,11 +90,6 @@ def C3510644_Collider_CollisionGroups():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -362,8 +357,5 @@ def C3510644_Collider_CollisionGroups():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C3510644_Collider_CollisionGroups)
@@ -48,13 +48,11 @@ def C4044695_PhysXCollider_AddMultipleSurfaceFbx():
import os
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
from asset_utils import Asset
from editor_python_test_tools.asset_utils import Asset
# Constants
PHYSICS_ASSET_INDEX = 7 # Hardcoded enum index value for Shape property
@@ -107,8 +105,5 @@ def C4044695_PhysXCollider_AddMultipleSurfaceFbx():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4044695_PhysXCollider_AddMultipleSurfaceFbx)
@@ -51,11 +51,6 @@ def C4976227_Collider_NewGroup():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -84,8 +79,5 @@ def C4976227_Collider_NewGroup():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4976227_Collider_NewGroup)
@@ -42,14 +42,12 @@ def C4976236_AddPhysxColliderComponent():
"""
# Helper file Imports
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
from editor_python_test_tools.utils import Tracer
from asset_utils import Asset
from editor_python_test_tools.asset_utils import Asset
helper.init_idle()
# 1) Load the level
@@ -84,8 +82,5 @@ def C4976236_AddPhysxColliderComponent():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4976236_AddPhysxColliderComponent)
@@ -62,11 +62,6 @@ def C4976242_Collision_SameCollisionlayerSameCollisiongroup():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -188,8 +183,5 @@ def C4976242_Collision_SameCollisionlayerSameCollisiongroup():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4976242_Collision_SameCollisionlayerSameCollisiongroup)
@@ -66,11 +66,6 @@ def C4976243_Collision_SameCollisionGroupDiffCollisionLayers():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -127,8 +122,5 @@ def C4976243_Collision_SameCollisionGroupDiffCollisionLayers():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4976243_Collision_SameCollisionGroupDiffCollisionLayers)
@@ -62,11 +62,6 @@ def C4976244_Collider_SameGroupSameLayerCollision():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -185,8 +180,5 @@ def C4976244_Collider_SameGroupSameLayerCollision():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4976244_Collider_SameGroupSameLayerCollision)
@@ -67,11 +67,6 @@ def C4976245_PhysXCollider_CollisionLayerTest():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
import azlmbr.legacy.general as general
@@ -223,8 +218,5 @@ def C4976245_PhysXCollider_CollisionLayerTest():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4976245_PhysXCollider_CollisionLayerTest)
@@ -67,11 +67,6 @@ def C4982593_PhysXCollider_CollisionLayerTest():
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
import azlmbr.legacy.general as general
@@ -231,8 +226,5 @@ def C4982593_PhysXCollider_CollisionLayerTest():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4982593_PhysXCollider_CollisionLayerTest)
@@ -75,11 +75,6 @@ def C4982595_Collider_TriggerDisablesCollision():
# Setup path
import os
import sys
import ImportPathHelper as imports
imports.init()
import azlmbr.legacy.general as general
import azlmbr.bus
import azlmbr.components
@@ -234,8 +229,5 @@ def C4982595_Collider_TriggerDisablesCollision():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4982595_Collider_TriggerDisablesCollision)
@@ -87,9 +87,7 @@ def C4982797_Collider_ColliderOffset():
import sys
# Internal editor imports
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -332,8 +330,5 @@ def C4982797_Collider_ColliderOffset():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4982797_Collider_ColliderOffset)
@@ -86,9 +86,7 @@ def C4982798_Collider_ColliderRotationOffset():
:return: None
"""
import ImportPathHelper as imports
imports.init()
# Internal editor imports
@@ -300,8 +298,5 @@ def C4982798_Collider_ColliderRotationOffset():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4982798_Collider_ColliderRotationOffset)
@@ -43,9 +43,7 @@ def C4982800_PhysXColliderShape_CanBeSelected():
:return: None
"""
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -91,8 +89,5 @@ def C4982800_PhysXColliderShape_CanBeSelected():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4982800_PhysXColliderShape_CanBeSelected)
@@ -43,9 +43,7 @@ def C4982801_PhysXColliderShape_CanBeSelected():
:return: None
"""
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -103,8 +101,5 @@ def C4982801_PhysXColliderShape_CanBeSelected():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4982801_PhysXColliderShape_CanBeSelected)
@@ -43,9 +43,7 @@ def C4982802_PhysXColliderShape_CanBeSelected():
:return: None
"""
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity as Entity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -103,8 +101,5 @@ def C4982802_PhysXColliderShape_CanBeSelected():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4982802_PhysXColliderShape_CanBeSelected)
@@ -57,13 +57,11 @@ def C4982803_Enable_PxMesh_Option():
import os
# Helper Files
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.editor_entity_utils import EditorEntity
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
from asset_utils import Asset
from editor_python_test_tools.asset_utils import Asset
import azlmbr.math as math
# Open 3D Engine Imports
@@ -141,8 +139,5 @@ def C4982803_Enable_PxMesh_Option():
helper.exit_game_mode(Tests.exit_game_mode)
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C4982803_Enable_PxMesh_Option)
@@ -86,11 +86,6 @@ def C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude():
"""
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -283,8 +278,5 @@ def C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude)
@@ -73,12 +73,6 @@ def C12868580_ForceRegion_SplineModifiedTransform():
"""
import os
import sys
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
@@ -168,8 +162,5 @@ def C12868580_ForceRegion_SplineModifiedTransform():
if __name__ == "__main__":
import ImportPathHelper as imports
imports.init()
from editor_python_test_tools.utils import Report
Report.start_test(C12868580_ForceRegion_SplineModifiedTransform)

Some files were not shown because too many files have changed in this diff Show More