test_SlopeAlignmentModifier.py 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. """
  2. All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
  3. its licensors.
  4. For complete copyright and license terms please see the LICENSE at the root of this
  5. distribution (the "License"). All use of this software is governed by the License,
  6. or, if provided, by the license below or the license accompanying this file. Do not
  7. remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. """
  10. """
  11. C4896941 - Surface Alignment functions as expected
  12. C4814459 - Surface Alignment overrides function as expected
  13. """
  14. import os
  15. import pytest
  16. # Bail on the test if ly_test_tools doesn't exist.
  17. pytest.importorskip("ly_test_tools")
  18. import automatedtesting_shared.hydra_test_utils as hydra
  19. import ly_test_tools.environment.file_system as file_system
  20. test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
  21. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  22. @pytest.mark.parametrize("level", ["tmp_level"])
  23. @pytest.mark.usefixtures("automatic_process_killer")
  24. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  25. class TestSlopeAlignmentModifier(object):
  26. @pytest.fixture(autouse=True)
  27. def setup_teardown(self, request, workspace, project, level):
  28. def teardown():
  29. file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
  30. request.addfinalizer(teardown)
  31. file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
  32. @pytest.mark.test_case_id("C4896941")
  33. @pytest.mark.SUITE_periodic
  34. @pytest.mark.skip # ATOM-14299
  35. def test_SlopeAlignmentModifier_InstanceSurfaceAlignment(self, request, editor, level, launcher_platform):
  36. expected_lines = [
  37. "Vegetation Slope Alignment Modifier component was added to entity",
  38. "Instance Spawner Configuration|Alignment Coefficient Min: SUCCESS",
  39. "Constant Gradient component was added to entity",
  40. "Instance Spawner Configuration|Gradient|Gradient Entity Id: SUCCESS",
  41. "SlopeAlignmentModifier: result=SUCCESS"
  42. ]
  43. hydra.launch_and_validate_results(
  44. request,
  45. test_directory,
  46. editor,
  47. "SlopeAlignmentModifier_InstanceSurfaceAlignment.py",
  48. expected_lines,
  49. cfg_args=[level]
  50. )
  51. @pytest.mark.test_case_id("C4814459")
  52. @pytest.mark.SUITE_periodic
  53. @pytest.mark.skip # ATOM-14299
  54. def test_SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(self, request, editor, level, launcher_platform):
  55. expected_lines = [
  56. "Instance Spawner Configuration|Allow Per-Item Overrides: SUCCESS",
  57. "Instance Spawner Configuration|Embedded Assets|[0]|Surface Slope Alignment|Override Enabled: SUCCESS",
  58. "Instance Spawner Configuration|Embedded Assets|[0]|Surface Slope Alignment|Max: SUCCESS",
  59. "Instance Spawner Configuration|Embedded Assets|[0]|Surface Slope Alignment|Min: SUCCESS",
  60. "SlopeAlignmentModifierOverrides: result=SUCCESS"
  61. ]
  62. hydra.launch_and_validate_results(
  63. request,
  64. test_directory,
  65. editor,
  66. "SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment.py",
  67. expected_lines,
  68. cfg_args=[level]
  69. )