2
0

test_EditFunctionality.py 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. C29278563 - Disabled nodes can be successfully duplicated
  12. C30813586 - Editor remains stable after Undoing deletion of a node on a slice entity
  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 ly_test_tools.environment.file_system as file_system
  19. import automatedtesting_shared.hydra_test_utils as hydra
  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 TestEditFunctionality(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('C29278563')
  33. @pytest.mark.SUITE_periodic
  34. def test_LandscapeCanvas_DuplicateDisabledNodes(self, request, editor, level, launcher_platform):
  35. cfg_args = [level]
  36. expected_lines = [
  37. "Landscape Canvas pane is open",
  38. "New graph created",
  39. "SpawnerAreaNode duplicated with disabled component",
  40. "SpawnerAreaNode duplicated with deleted component",
  41. "MeshBlockerAreaNode duplicated with disabled component",
  42. "MeshBlockerAreaNode duplicated with deleted component",
  43. "BlockerAreaNode duplicated with disabled component",
  44. "BlockerAreaNode duplicated with deleted component",
  45. "FastNoiseGradientNode duplicated with disabled component",
  46. "FastNoiseGradientNode duplicated with deleted component",
  47. "ImageGradientNode duplicated with disabled component",
  48. "ImageGradientNode duplicated with deleted component",
  49. "PerlinNoiseGradientNode duplicated with disabled component",
  50. "PerlinNoiseGradientNode duplicated with deleted component",
  51. "RandomNoiseGradientNode duplicated with disabled component",
  52. "RandomNoiseGradientNode duplicated with deleted component",
  53. "DisabledNodeDuplication: result=SUCCESS"
  54. ]
  55. hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_DisabledNodeDuplication.py',
  56. expected_lines, cfg_args=cfg_args)
  57. @pytest.mark.test_case_id('C30813586')
  58. @pytest.mark.SUITE_periodic
  59. def test_LandscapeCanvas_UndoNodeDelete_SliceEntity(self, request, editor, level, launcher_platform):
  60. cfg_args = [level]
  61. expected_lines = [
  62. "Vegetation Layer Spawner node found on graph",
  63. "Vegetation Layer Spawner node was removed",
  64. "Editor is still responsive",
  65. "UndoNodeDeleteSlice: result=SUCCESS"
  66. ]
  67. unexpected_lines = [
  68. "Vegetation Layer Spawner node not found",
  69. "Vegetation Layer Spawner node was not removed"
  70. ]
  71. hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_UndoNodeDelete_SliceEntity.py',
  72. expected_lines, unexpected_lines=unexpected_lines, cfg_args=cfg_args)