Files
o3de/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PositionModifier.py
T
jckand 10361f0ae4 - LYN-3275: Marking several tests xfail due to Mesh planting issues with nullrenderer
- LYN-3273: Marking several tests xfail due to Mesh Blocker issues with nullrenderer
2021-04-23 15:47:20 -05:00

82 lines
3.2 KiB
Python
Executable File

"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
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 TestPositionModifier(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("C4874099", "C4814461")
@pytest.mark.SUITE_periodic
def test_PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets(self, request, editor, level,
launcher_platform):
expected_lines = [
"'Instance Spawner' created",
"Vegetation Position Modifier component was added to entity",
"'Planting Surface' created",
"Entity has a Constant Gradient component",
"PositionModifierComponentAndOverrides_InstanceOffset: result=SUCCESS",
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets.py",
expected_lines,
cfg_args=[level]
)
@pytest.mark.test_case_id("C4874100")
@pytest.mark.SUITE_sandbox
@pytest.mark.xfail # LYN-3275
def test_PositionModifier_AutoSnapToSurfaceWorks(self, request, editor, level, launcher_platform):
expected_lines = [
"'Instance Spawner' created",
"'Planting Surface' created",
"Instance Spawner Configuration|Position X|Range Min: SUCCESS",
"Instance Spawner Configuration|Position X|Range Max: SUCCESS",
"PositionModifier_AutoSnapToSurface: result=SUCCESS"
]
hydra.launch_and_validate_results(
request,
test_directory,
editor,
"PositionModifier_AutoSnapToSurfaceWorks.py",
expected_lines,
cfg_args=[level]
)