Merge branch 'development' of https://github.com/o3de/o3de into carlitosan/development
commit
782c6748ae
@ -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
|
||||
)
|
||||
@ -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]
|
||||
)
|
||||
@ -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)
|
||||
@ -0,0 +1,349 @@
|
||||
"""
|
||||
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.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarly.")
|
||||
@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 . 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
|
||||
|
||||
class C3510642_Terrain_NotCollideWithTerrain(EditorSharedTest):
|
||||
from . import C3510642_Terrain_NotCollideWithTerrain as test_module
|
||||
|
||||
class C4976195_RigidBodies_InitialLinearVelocity(EditorSharedTest):
|
||||
from . import C4976195_RigidBodies_InitialLinearVelocity as test_module
|
||||
|
||||
class C4976206_RigidBodies_GravityEnabledActive(EditorSharedTest):
|
||||
from . import C4976206_RigidBodies_GravityEnabledActive as test_module
|
||||
|
||||
class C4976207_PhysXRigidBodies_KinematicBehavior(EditorSharedTest):
|
||||
from . import C4976207_PhysXRigidBodies_KinematicBehavior as test_module
|
||||
|
||||
class C5932042_PhysXForceRegion_LinearDamping(EditorSharedTest):
|
||||
from . import C5932042_PhysXForceRegion_LinearDamping as test_module
|
||||
|
||||
class C5932043_ForceRegion_SimpleDragOnRigidBodies(EditorSharedTest):
|
||||
from . import C5932043_ForceRegion_SimpleDragOnRigidBodies as test_module
|
||||
|
||||
class C5959760_PhysXForceRegion_PointForceExertion(EditorSharedTest):
|
||||
from . import C5959760_PhysXForceRegion_PointForceExertion as test_module
|
||||
|
||||
class C5959764_ForceRegion_ForceRegionImpulsesCapsule(EditorSharedTest):
|
||||
from . import C5959764_ForceRegion_ForceRegionImpulsesCapsule as test_module
|
||||
|
||||
class C5340400_RigidBody_ManualMomentOfInertia(EditorSharedTest):
|
||||
from . import C5340400_RigidBody_ManualMomentOfInertia as test_module
|
||||
|
||||
class C4976210_COM_ManualSetting(EditorSharedTest):
|
||||
from . import C4976210_COM_ManualSetting as test_module
|
||||
|
||||
class C4976194_RigidBody_PhysXComponentIsValid(EditorSharedTest):
|
||||
from . import C4976194_RigidBody_PhysXComponentIsValid as test_module
|
||||
|
||||
class C5932045_ForceRegion_Spline(EditorSharedTest):
|
||||
from . import C5932045_ForceRegion_Spline as test_module
|
||||
|
||||
class C4982797_Collider_ColliderOffset(EditorSharedTest):
|
||||
from . import C4982797_Collider_ColliderOffset as test_module
|
||||
|
||||
class C4976200_RigidBody_AngularDampingObjectRotation(EditorSharedTest):
|
||||
from . import C4976200_RigidBody_AngularDampingObjectRotation as test_module
|
||||
|
||||
class C5689529_Verify_Terrain_RigidBody_Collider_Mesh(EditorSharedTest):
|
||||
from . import C5689529_Verify_Terrain_RigidBody_Collider_Mesh as test_module
|
||||
|
||||
class C5959810_ForceRegion_ForceRegionCombinesForces(EditorSharedTest):
|
||||
from . import C5959810_ForceRegion_ForceRegionCombinesForces as test_module
|
||||
|
||||
class C5959765_ForceRegion_AssetGetsImpulsed(EditorSharedTest):
|
||||
from . import C5959765_ForceRegion_AssetGetsImpulsed as test_module
|
||||
|
||||
class C6274125_ScriptCanvas_TriggerEvents(EditorSharedTest):
|
||||
from . 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 . import C6090554_ForceRegion_PointForceNegative as test_module
|
||||
|
||||
class C6090550_ForceRegion_WorldSpaceForceNegative(EditorSharedTest):
|
||||
from . import C6090550_ForceRegion_WorldSpaceForceNegative as test_module
|
||||
|
||||
class C6090552_ForceRegion_LinearDampingNegative(EditorSharedTest):
|
||||
from . import C6090552_ForceRegion_LinearDampingNegative as test_module
|
||||
|
||||
class C5968760_ForceRegion_CheckNetForceChange(EditorSharedTest):
|
||||
from . import C5968760_ForceRegion_CheckNetForceChange as test_module
|
||||
|
||||
class C12712452_ScriptCanvas_CollisionEvents(EditorSharedTest):
|
||||
from . import C12712452_ScriptCanvas_CollisionEvents as test_module
|
||||
|
||||
class C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude(EditorSharedTest):
|
||||
from . import C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude as test_module
|
||||
|
||||
class C4976204_Verify_Start_Asleep_Condition(EditorSharedTest):
|
||||
from . import C4976204_Verify_Start_Asleep_Condition as test_module
|
||||
|
||||
class C6090546_ForceRegion_SliceFileInstantiates(EditorSharedTest):
|
||||
from . import C6090546_ForceRegion_SliceFileInstantiates as test_module
|
||||
|
||||
class C6090551_ForceRegion_LocalSpaceForceNegative(EditorSharedTest):
|
||||
from . import C6090551_ForceRegion_LocalSpaceForceNegative as test_module
|
||||
|
||||
class C6090553_ForceRegion_SimpleDragForceOnRigidBodies(EditorSharedTest):
|
||||
from . import C6090553_ForceRegion_SimpleDragForceOnRigidBodies as test_module
|
||||
|
||||
class C4976209_RigidBody_ComputesCOM(EditorSharedTest):
|
||||
from . import C4976209_RigidBody_ComputesCOM as test_module
|
||||
|
||||
class C4976201_RigidBody_MassIsAssigned(EditorSharedTest):
|
||||
from . import C4976201_RigidBody_MassIsAssigned as test_module
|
||||
|
||||
class C12868580_ForceRegion_SplineModifiedTransform(EditorSharedTest):
|
||||
from . import C12868580_ForceRegion_SplineModifiedTransform as test_module
|
||||
|
||||
class C12712455_ScriptCanvas_ShapeCastVerification(EditorSharedTest):
|
||||
from . import C12712455_ScriptCanvas_ShapeCastVerification as test_module
|
||||
|
||||
class C4976197_RigidBodies_InitialAngularVelocity(EditorSharedTest):
|
||||
from . import C4976197_RigidBodies_InitialAngularVelocity as test_module
|
||||
|
||||
class C6090555_ForceRegion_SplineFollowOnRigidBodies(EditorSharedTest):
|
||||
from . import C6090555_ForceRegion_SplineFollowOnRigidBodies as test_module
|
||||
|
||||
class C6131473_StaticSlice_OnDynamicSliceSpawn(EditorSharedTest):
|
||||
from . import C6131473_StaticSlice_OnDynamicSliceSpawn as test_module
|
||||
|
||||
class C5959808_ForceRegion_PositionOffset(EditorSharedTest):
|
||||
from . 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 . import C13895144_Ragdoll_ChangeLevel as test_module
|
||||
|
||||
class C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody(EditorSharedTest):
|
||||
from . 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 . import C4976202_RigidBody_StopsWhenBelowKineticThreshold as test_module
|
||||
|
||||
class C13351703_COM_NotIncludeTriggerShapes(EditorSharedTest):
|
||||
from . import C13351703_COM_NotIncludeTriggerShapes as test_module
|
||||
|
||||
class C5296614_PhysXMaterial_ColliderShape(EditorSharedTest):
|
||||
from . import C5296614_PhysXMaterial_ColliderShape as test_module
|
||||
|
||||
class C4982595_Collider_TriggerDisablesCollision(EditorSharedTest):
|
||||
from . import C4982595_Collider_TriggerDisablesCollision as test_module
|
||||
|
||||
class C14976307_Gravity_SetGravityWorks(EditorSharedTest):
|
||||
from . import C14976307_Gravity_SetGravityWorks as test_module
|
||||
|
||||
class C4044694_Material_EmptyLibraryUsesDefault(EditorSharedTest):
|
||||
from . import C4044694_Material_EmptyLibraryUsesDefault as test_module
|
||||
|
||||
class C15845879_ForceRegion_HighLinearDampingForce(EditorSharedTest):
|
||||
from . import C15845879_ForceRegion_HighLinearDampingForce as test_module
|
||||
|
||||
class C4976218_RigidBodies_InertiaObjectsNotComputed(EditorSharedTest):
|
||||
from . import C4976218_RigidBodies_InertiaObjectsNotComputed as test_module
|
||||
|
||||
class C14902098_ScriptCanvas_PostPhysicsUpdate(EditorSharedTest):
|
||||
from . 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 . 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 . import C13352089_RigidBodies_MaxAngularVelocity as test_module
|
||||
|
||||
class C18243584_Joints_HingeSoftLimitsConstrained(EditorSharedTest):
|
||||
from . import C18243584_Joints_HingeSoftLimitsConstrained as test_module
|
||||
|
||||
class C18243589_Joints_BallSoftLimitsConstrained(EditorSharedTest):
|
||||
from . import C18243589_Joints_BallSoftLimitsConstrained as test_module
|
||||
|
||||
class C18243591_Joints_BallLeadFollowerCollide(EditorSharedTest):
|
||||
from . import C18243591_Joints_BallLeadFollowerCollide as test_module
|
||||
|
||||
class C19578018_ShapeColliderWithNoShapeComponent(EditorSharedTest):
|
||||
from . import C19578018_ShapeColliderWithNoShapeComponent as test_module
|
||||
|
||||
class C14861500_DefaultSetting_ColliderShape(EditorSharedTest):
|
||||
from . import C14861500_DefaultSetting_ColliderShape as test_module
|
||||
|
||||
class C19723164_ShapeCollider_WontCrashEditor(EditorSharedTest):
|
||||
from . import C19723164_ShapeColliders_WontCrashEditor as test_module
|
||||
|
||||
class C4982800_PhysXColliderShape_CanBeSelected(EditorSharedTest):
|
||||
from . import C4982800_PhysXColliderShape_CanBeSelected as test_module
|
||||
|
||||
class C4982801_PhysXColliderShape_CanBeSelected(EditorSharedTest):
|
||||
from . import C4982801_PhysXColliderShape_CanBeSelected as test_module
|
||||
|
||||
class C4982802_PhysXColliderShape_CanBeSelected(EditorSharedTest):
|
||||
from . import C4982802_PhysXColliderShape_CanBeSelected as test_module
|
||||
|
||||
class C12905528_ForceRegion_WithNonTriggerCollider(EditorSharedTest):
|
||||
from . 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 . import C5932040_ForceRegion_CubeExertsWorldForce as test_module
|
||||
|
||||
class C5932044_ForceRegion_PointForceOnRigidBody(EditorSharedTest):
|
||||
from . import C5932044_ForceRegion_PointForceOnRigidBody as test_module
|
||||
|
||||
class C5959759_RigidBody_ForceRegionSpherePointForce(EditorSharedTest):
|
||||
from . import C5959759_RigidBody_ForceRegionSpherePointForce as test_module
|
||||
|
||||
class C5959809_ForceRegion_RotationalOffset(EditorSharedTest):
|
||||
from . import C5959809_ForceRegion_RotationalOffset as test_module
|
||||
|
||||
class C15096740_Material_LibraryUpdatedCorrectly(EditorSharedTest):
|
||||
from . import C15096740_Material_LibraryUpdatedCorrectly as test_module
|
||||
|
||||
class C4976236_AddPhysxColliderComponent(EditorSharedTest):
|
||||
from . 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 . import C14861502_PhysXCollider_AssetAutoAssigned as test_module
|
||||
|
||||
class C14861501_PhysXCollider_RenderMeshAutoAssigned(EditorSharedTest):
|
||||
from . import C14861501_PhysXCollider_RenderMeshAutoAssigned as test_module
|
||||
|
||||
class C4044695_PhysXCollider_AddMultipleSurfaceFbx(EditorSharedTest):
|
||||
from . import C4044695_PhysXCollider_AddMultipleSurfaceFbx as test_module
|
||||
|
||||
class C14861504_RenderMeshAsset_WithNoPxAsset(EditorSharedTest):
|
||||
from . import C14861504_RenderMeshAsset_WithNoPxAsset as test_module
|
||||
|
||||
class C100000_RigidBody_EnablingGravityWorksPoC(EditorSharedTest):
|
||||
from . import C100000_RigidBody_EnablingGravityWorksPoC as test_module
|
||||
|
||||
class C4982798_Collider_ColliderRotationOffset(EditorSharedTest):
|
||||
from . import C4982798_Collider_ColliderRotationOffset as test_module
|
||||
|
||||
class C15308217_NoCrash_LevelSwitch(EditorSharedTest):
|
||||
from . import C15308217_NoCrash_LevelSwitch as test_module
|
||||
|
||||
class C6090547_ForceRegion_ParentChildForceRegions(EditorSharedTest):
|
||||
from . import C6090547_ForceRegion_ParentChildForceRegions as test_module
|
||||
|
||||
class C19578021_ShapeCollider_CanBeAdded(EditorSharedTest):
|
||||
from . import C19578021_ShapeCollider_CanBeAdded as test_module
|
||||
|
||||
class C15425929_Undo_Redo(EditorSharedTest):
|
||||
from . 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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,75 +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
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : Calculate the reference frame for sub-object selections.
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "SubObjectSelectionReferenceFrameCalculator.h"
|
||||
|
||||
SubObjectSelectionReferenceFrameCalculator::SubObjectSelectionReferenceFrameCalculator(ESubObjElementType selectionType)
|
||||
: m_anySelected(false)
|
||||
, pos(0.0f, 0.0f, 0.0f)
|
||||
, normal(0.0f, 0.0f, 0.0f)
|
||||
, nNormals(0)
|
||||
, selectionType(selectionType)
|
||||
, bUseExplicitFrame(false)
|
||||
, bExplicitAnySelected(false)
|
||||
{
|
||||
}
|
||||
|
||||
void SubObjectSelectionReferenceFrameCalculator::SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame)
|
||||
{
|
||||
this->m_refFrame = refFrame;
|
||||
this->bUseExplicitFrame = true;
|
||||
this->bExplicitAnySelected = bAnySelected;
|
||||
}
|
||||
|
||||
bool SubObjectSelectionReferenceFrameCalculator::GetFrame(Matrix34& refFrame)
|
||||
{
|
||||
if (this->bUseExplicitFrame)
|
||||
{
|
||||
refFrame = this->m_refFrame;
|
||||
return this->bExplicitAnySelected;
|
||||
}
|
||||
else
|
||||
{
|
||||
refFrame.SetIdentity();
|
||||
|
||||
if (this->nNormals > 0)
|
||||
{
|
||||
this->normal = this->normal / static_cast<float>(this->nNormals);
|
||||
if (!this->normal.IsZero())
|
||||
{
|
||||
this->normal.Normalize();
|
||||
}
|
||||
|
||||
// Average position.
|
||||
this->pos = this->pos / static_cast<float>(this->nNormals);
|
||||
refFrame.SetTranslation(this->pos);
|
||||
}
|
||||
|
||||
if (this->m_anySelected)
|
||||
{
|
||||
if (!this->normal.IsZero())
|
||||
{
|
||||
Vec3 xAxis(1, 0, 0), yAxis(0, 1, 0), zAxis(0, 0, 1);
|
||||
if (this->normal.IsEquivalent(zAxis) || normal.IsEquivalent(-zAxis))
|
||||
{
|
||||
zAxis = xAxis;
|
||||
}
|
||||
xAxis = this->normal.Cross(zAxis).GetNormalized();
|
||||
yAxis = xAxis.Cross(this->normal).GetNormalized();
|
||||
refFrame.SetFromVectors(xAxis, yAxis, normal, pos);
|
||||
}
|
||||
}
|
||||
|
||||
return m_anySelected;
|
||||
}
|
||||
}
|
||||
@ -1,42 +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
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : Calculate the reference frame for sub-object selections.
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H
|
||||
#define CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "ISubObjectSelectionReferenceFrameCalculator.h"
|
||||
#include "Objects/SubObjSelection.h"
|
||||
|
||||
class SubObjectSelectionReferenceFrameCalculator
|
||||
: public ISubObjectSelectionReferenceFrameCalculator
|
||||
{
|
||||
public:
|
||||
SubObjectSelectionReferenceFrameCalculator(ESubObjElementType selectionType);
|
||||
|
||||
virtual void SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame);
|
||||
bool GetFrame(Matrix34& refFrame);
|
||||
|
||||
private:
|
||||
bool m_anySelected;
|
||||
Vec3 pos;
|
||||
Vec3 normal;
|
||||
int nNormals;
|
||||
ESubObjElementType selectionType;
|
||||
std::vector<Vec3> positions;
|
||||
Matrix34 m_refFrame;
|
||||
bool bUseExplicitFrame;
|
||||
bool bExplicitAnySelected;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H
|
||||
@ -0,0 +1,286 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include <EditorModularViewportCameraComposer.h>
|
||||
|
||||
#include <AtomToolsFramework/Viewport/ModularViewportCameraControllerRequestBus.h>
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <AzFramework/Render/IntersectorInterface.h>
|
||||
#include <AzToolsFramework/Viewport/ViewportMessages.h>
|
||||
#include <EditorViewportSettings.h>
|
||||
|
||||
namespace SandboxEditor
|
||||
{
|
||||
static AzFramework::TranslateCameraInputChannelIds BuildTranslateCameraInputChannelIds()
|
||||
{
|
||||
AzFramework::TranslateCameraInputChannelIds translateCameraInputChannelIds;
|
||||
translateCameraInputChannelIds.m_leftChannelId = SandboxEditor::CameraTranslateLeftChannelId();
|
||||
translateCameraInputChannelIds.m_rightChannelId = SandboxEditor::CameraTranslateRightChannelId();
|
||||
translateCameraInputChannelIds.m_forwardChannelId = SandboxEditor::CameraTranslateForwardChannelId();
|
||||
translateCameraInputChannelIds.m_backwardChannelId = SandboxEditor::CameraTranslateBackwardChannelId();
|
||||
translateCameraInputChannelIds.m_upChannelId = SandboxEditor::CameraTranslateUpChannelId();
|
||||
translateCameraInputChannelIds.m_downChannelId = SandboxEditor::CameraTranslateDownChannelId();
|
||||
translateCameraInputChannelIds.m_boostChannelId = SandboxEditor::CameraTranslateBoostChannelId();
|
||||
|
||||
return translateCameraInputChannelIds;
|
||||
}
|
||||
|
||||
EditorModularViewportCameraComposer::EditorModularViewportCameraComposer(const AzFramework::ViewportId viewportId)
|
||||
: m_viewportId(viewportId)
|
||||
{
|
||||
EditorModularViewportCameraComposerNotificationBus::Handler::BusConnect(viewportId);
|
||||
}
|
||||
|
||||
EditorModularViewportCameraComposer::~EditorModularViewportCameraComposer()
|
||||
{
|
||||
EditorModularViewportCameraComposerNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
AZStd::shared_ptr<AtomToolsFramework::ModularViewportCameraController> EditorModularViewportCameraComposer::
|
||||
CreateModularViewportCameraController()
|
||||
{
|
||||
SetupCameras();
|
||||
|
||||
auto controller = AZStd::make_shared<AtomToolsFramework::ModularViewportCameraController>();
|
||||
|
||||
controller->SetCameraViewportContextBuilderCallback(
|
||||
[viewportId = m_viewportId](AZStd::unique_ptr<AtomToolsFramework::ModularCameraViewportContext>& cameraViewportContext)
|
||||
{
|
||||
cameraViewportContext = AZStd::make_unique<AtomToolsFramework::ModularCameraViewportContextImpl>(viewportId);
|
||||
});
|
||||
|
||||
controller->SetCameraPriorityBuilderCallback(
|
||||
[](AtomToolsFramework::CameraControllerPriorityFn& cameraControllerPriorityFn)
|
||||
{
|
||||
cameraControllerPriorityFn = AtomToolsFramework::DefaultCameraControllerPriority;
|
||||
});
|
||||
|
||||
controller->SetCameraPropsBuilderCallback(
|
||||
[](AzFramework::CameraProps& cameraProps)
|
||||
{
|
||||
cameraProps.m_rotateSmoothnessFn = []
|
||||
{
|
||||
return SandboxEditor::CameraRotateSmoothness();
|
||||
};
|
||||
|
||||
cameraProps.m_translateSmoothnessFn = []
|
||||
{
|
||||
return SandboxEditor::CameraTranslateSmoothness();
|
||||
};
|
||||
|
||||
cameraProps.m_rotateSmoothingEnabledFn = []
|
||||
{
|
||||
return SandboxEditor::CameraRotateSmoothingEnabled();
|
||||
};
|
||||
|
||||
cameraProps.m_translateSmoothingEnabledFn = []
|
||||
{
|
||||
return SandboxEditor::CameraTranslateSmoothingEnabled();
|
||||
};
|
||||
});
|
||||
|
||||
controller->SetCameraListBuilderCallback(
|
||||
[this](AzFramework::Cameras& cameras)
|
||||
{
|
||||
cameras.AddCamera(m_firstPersonRotateCamera);
|
||||
cameras.AddCamera(m_firstPersonPanCamera);
|
||||
cameras.AddCamera(m_firstPersonTranslateCamera);
|
||||
cameras.AddCamera(m_firstPersonScrollCamera);
|
||||
cameras.AddCamera(m_orbitCamera);
|
||||
});
|
||||
|
||||
return controller;
|
||||
}
|
||||
|
||||
void EditorModularViewportCameraComposer::SetupCameras()
|
||||
{
|
||||
const auto hideCursor = [viewportId = m_viewportId]
|
||||
{
|
||||
if (SandboxEditor::CameraCaptureCursorForLook())
|
||||
{
|
||||
AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event(
|
||||
viewportId, &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::BeginCursorCapture);
|
||||
}
|
||||
};
|
||||
const auto showCursor = [viewportId = m_viewportId]
|
||||
{
|
||||
if (SandboxEditor::CameraCaptureCursorForLook())
|
||||
{
|
||||
AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Event(
|
||||
viewportId, &AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Events::EndCursorCapture);
|
||||
}
|
||||
};
|
||||
|
||||
m_firstPersonRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(SandboxEditor::CameraFreeLookChannelId());
|
||||
|
||||
m_firstPersonRotateCamera->m_rotateSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraRotateSpeed();
|
||||
};
|
||||
|
||||
// default behavior is to hide the cursor but this can be disabled (useful for remote desktop)
|
||||
// note: See CaptureCursorLook in the Settings Registry
|
||||
m_firstPersonRotateCamera->SetActivationBeganFn(hideCursor);
|
||||
m_firstPersonRotateCamera->SetActivationEndedFn(showCursor);
|
||||
|
||||
m_firstPersonPanCamera =
|
||||
AZStd::make_shared<AzFramework::PanCameraInput>(SandboxEditor::CameraFreePanChannelId(), AzFramework::LookPan);
|
||||
|
||||
m_firstPersonPanCamera->m_panSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanSpeed();
|
||||
};
|
||||
|
||||
m_firstPersonPanCamera->m_invertPanXFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanInvertedX();
|
||||
};
|
||||
|
||||
m_firstPersonPanCamera->m_invertPanYFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanInvertedY();
|
||||
};
|
||||
|
||||
const auto translateCameraInputChannelIds = BuildTranslateCameraInputChannelIds();
|
||||
|
||||
m_firstPersonTranslateCamera =
|
||||
AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::LookTranslation, translateCameraInputChannelIds);
|
||||
|
||||
m_firstPersonTranslateCamera->m_translateSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraTranslateSpeed();
|
||||
};
|
||||
|
||||
m_firstPersonTranslateCamera->m_boostMultiplierFn = []
|
||||
{
|
||||
return SandboxEditor::CameraBoostMultiplier();
|
||||
};
|
||||
|
||||
m_firstPersonScrollCamera = AZStd::make_shared<AzFramework::ScrollTranslationCameraInput>();
|
||||
|
||||
m_firstPersonScrollCamera->m_scrollSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraScrollSpeed();
|
||||
};
|
||||
|
||||
m_orbitCamera = AZStd::make_shared<AzFramework::OrbitCameraInput>(SandboxEditor::CameraOrbitChannelId());
|
||||
|
||||
m_orbitCamera->SetLookAtFn(
|
||||
[viewportId = m_viewportId](const AZ::Vector3& position, const AZ::Vector3& direction) -> AZStd::optional<AZ::Vector3>
|
||||
{
|
||||
AZStd::optional<AZ::Vector3> lookAtAfterInterpolation;
|
||||
AtomToolsFramework::ModularViewportCameraControllerRequestBus::EventResult(
|
||||
lookAtAfterInterpolation, viewportId,
|
||||
&AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::LookAtAfterInterpolation);
|
||||
|
||||
// initially attempt to use the last set look at point after an interpolation has finished
|
||||
if (lookAtAfterInterpolation.has_value())
|
||||
{
|
||||
return *lookAtAfterInterpolation;
|
||||
}
|
||||
|
||||
const float RayDistance = 1000.0f;
|
||||
AzFramework::RenderGeometry::RayRequest ray;
|
||||
ray.m_startWorldPosition = position;
|
||||
ray.m_endWorldPosition = position + direction * RayDistance;
|
||||
ray.m_onlyVisible = true;
|
||||
|
||||
AzFramework::RenderGeometry::RayResult renderGeometryIntersectionResult;
|
||||
AzFramework::RenderGeometry::IntersectorBus::EventResult(
|
||||
renderGeometryIntersectionResult, AzToolsFramework::GetEntityContextId(),
|
||||
&AzFramework::RenderGeometry::IntersectorBus::Events::RayIntersect, ray);
|
||||
|
||||
// attempt a ray intersection with any visible mesh and return the intersection position if successful
|
||||
if (renderGeometryIntersectionResult)
|
||||
{
|
||||
return renderGeometryIntersectionResult.m_worldPosition;
|
||||
}
|
||||
|
||||
// if there is no selection or no intersection, fallback to default camera orbit behavior (ground plane
|
||||
// intersection)
|
||||
return {};
|
||||
});
|
||||
|
||||
m_orbitRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(SandboxEditor::CameraOrbitLookChannelId());
|
||||
|
||||
m_orbitRotateCamera->m_rotateSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraRotateSpeed();
|
||||
};
|
||||
|
||||
m_orbitRotateCamera->m_invertYawFn = []
|
||||
{
|
||||
return SandboxEditor::CameraOrbitYawRotationInverted();
|
||||
};
|
||||
|
||||
m_orbitTranslateCamera =
|
||||
AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::OrbitTranslation, translateCameraInputChannelIds);
|
||||
|
||||
m_orbitTranslateCamera->m_translateSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraTranslateSpeed();
|
||||
};
|
||||
|
||||
m_orbitTranslateCamera->m_boostMultiplierFn = []
|
||||
{
|
||||
return SandboxEditor::CameraBoostMultiplier();
|
||||
};
|
||||
|
||||
m_orbitDollyScrollCamera = AZStd::make_shared<AzFramework::OrbitDollyScrollCameraInput>();
|
||||
|
||||
m_orbitDollyScrollCamera->m_scrollSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraScrollSpeed();
|
||||
};
|
||||
|
||||
m_orbitDollyMoveCamera =
|
||||
AZStd::make_shared<AzFramework::OrbitDollyCursorMoveCameraInput>(SandboxEditor::CameraOrbitDollyChannelId());
|
||||
|
||||
m_orbitDollyMoveCamera->m_cursorSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraDollyMotionSpeed();
|
||||
};
|
||||
|
||||
m_orbitPanCamera = AZStd::make_shared<AzFramework::PanCameraInput>(SandboxEditor::CameraOrbitPanChannelId(), AzFramework::OrbitPan);
|
||||
|
||||
m_orbitPanCamera->m_panSpeedFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanSpeed();
|
||||
};
|
||||
|
||||
m_orbitPanCamera->m_invertPanXFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanInvertedX();
|
||||
};
|
||||
|
||||
m_orbitPanCamera->m_invertPanYFn = []
|
||||
{
|
||||
return SandboxEditor::CameraPanInvertedY();
|
||||
};
|
||||
|
||||
m_orbitCamera->m_orbitCameras.AddCamera(m_orbitRotateCamera);
|
||||
m_orbitCamera->m_orbitCameras.AddCamera(m_orbitTranslateCamera);
|
||||
m_orbitCamera->m_orbitCameras.AddCamera(m_orbitDollyScrollCamera);
|
||||
m_orbitCamera->m_orbitCameras.AddCamera(m_orbitDollyMoveCamera);
|
||||
m_orbitCamera->m_orbitCameras.AddCamera(m_orbitPanCamera);
|
||||
}
|
||||
|
||||
void EditorModularViewportCameraComposer::OnEditorModularViewportCameraComposerSettingsChanged()
|
||||
{
|
||||
const auto translateCameraInputChannelIds = BuildTranslateCameraInputChannelIds();
|
||||
m_firstPersonTranslateCamera->SetTranslateCameraInputChannelIds(translateCameraInputChannelIds);
|
||||
m_orbitTranslateCamera->SetTranslateCameraInputChannelIds(translateCameraInputChannelIds);
|
||||
|
||||
m_firstPersonPanCamera->SetPanInputChannelId(SandboxEditor::CameraFreePanChannelId());
|
||||
m_orbitPanCamera->SetPanInputChannelId(SandboxEditor::CameraOrbitPanChannelId());
|
||||
m_firstPersonRotateCamera->SetRotateInputChannelId(SandboxEditor::CameraFreeLookChannelId());
|
||||
m_orbitRotateCamera->SetRotateInputChannelId(SandboxEditor::CameraOrbitLookChannelId());
|
||||
m_orbitCamera->SetOrbitInputChannelId(SandboxEditor::CameraOrbitChannelId());
|
||||
m_orbitDollyMoveCamera->SetDollyInputChannelId(SandboxEditor::CameraOrbitDollyChannelId());
|
||||
}
|
||||
} // namespace SandboxEditor
|
||||
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AtomToolsFramework/Viewport/ModularViewportCameraController.h>
|
||||
#include <AzFramework/Viewport/CameraInput.h>
|
||||
#include <EditorModularViewportCameraComposerBus.h>
|
||||
#include <SandboxAPI.h>
|
||||
|
||||
namespace SandboxEditor
|
||||
{
|
||||
//! Type responsible for building the editor's modular viewport camera controller.
|
||||
class EditorModularViewportCameraComposer : private EditorModularViewportCameraComposerNotificationBus::Handler
|
||||
{
|
||||
public:
|
||||
SANDBOX_API explicit EditorModularViewportCameraComposer(AzFramework::ViewportId viewportId);
|
||||
SANDBOX_API ~EditorModularViewportCameraComposer();
|
||||
|
||||
//! Build a ModularViewportCameraController from the associated camera inputs.
|
||||
SANDBOX_API AZStd::shared_ptr<AtomToolsFramework::ModularViewportCameraController> CreateModularViewportCameraController();
|
||||
|
||||
private:
|
||||
//! Setup all internal camera inputs.
|
||||
void SetupCameras();
|
||||
|
||||
// EditorModularViewportCameraComposerNotificationBus overrides ...
|
||||
void OnEditorModularViewportCameraComposerSettingsChanged() override;
|
||||
|
||||
AZStd::shared_ptr<AzFramework::RotateCameraInput> m_firstPersonRotateCamera;
|
||||
AZStd::shared_ptr<AzFramework::PanCameraInput> m_firstPersonPanCamera;
|
||||
AZStd::shared_ptr<AzFramework::TranslateCameraInput> m_firstPersonTranslateCamera;
|
||||
AZStd::shared_ptr<AzFramework::ScrollTranslationCameraInput> m_firstPersonScrollCamera;
|
||||
AZStd::shared_ptr<AzFramework::OrbitCameraInput> m_orbitCamera;
|
||||
AZStd::shared_ptr<AzFramework::RotateCameraInput> m_orbitRotateCamera;
|
||||
AZStd::shared_ptr<AzFramework::TranslateCameraInput> m_orbitTranslateCamera;
|
||||
AZStd::shared_ptr<AzFramework::OrbitDollyScrollCameraInput> m_orbitDollyScrollCamera;
|
||||
AZStd::shared_ptr<AzFramework::OrbitDollyCursorMoveCameraInput> m_orbitDollyMoveCamera;
|
||||
AZStd::shared_ptr<AzFramework::PanCameraInput> m_orbitPanCamera;
|
||||
|
||||
AzFramework::ViewportId m_viewportId;
|
||||
};
|
||||
} // namespace SandboxEditor
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzFramework/Viewport/ViewportId.h>
|
||||
#include <AzToolsFramework/Viewport/ViewportMessages.h>
|
||||
|
||||
namespace SandboxEditor
|
||||
{
|
||||
//! Notifications for changes to the editor modular viewport camera controller.
|
||||
class EditorModularViewportCameraComposerNotifications
|
||||
{
|
||||
public:
|
||||
//! Notify any listeners when changes have been made to the modular viewport camera settings.
|
||||
//! @note This is used to update any cached input channels when controls are modified.
|
||||
virtual void OnEditorModularViewportCameraComposerSettingsChanged() = 0;
|
||||
|
||||
protected:
|
||||
~EditorModularViewportCameraComposerNotifications() = default;
|
||||
};
|
||||
|
||||
using EditorModularViewportCameraComposerNotificationBus =
|
||||
AZ::EBus<EditorModularViewportCameraComposerNotifications, AzToolsFramework::ViewportInteraction::ViewportEBusTraits>;
|
||||
} // namespace SandboxEditor
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue