From 71eccf3a6abc4f0c92d645b4cdbd1e30eaf44878 Mon Sep 17 00:00:00 2001 From: darapan Date: Wed, 5 May 2021 04:16:48 -0700 Subject: [PATCH 1/9] "Adding New Test" --- .../PythonTests/scripting/TestSuite_Active.py | 4 + .../scripting/Unpin_VariableManager.py | 133 ++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py index 8c34f29ebf..da67f21db1 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py @@ -31,3 +31,7 @@ class TestAutomation(TestAutomationBase): def test_Resizing_Pane(self, request, workspace, editor, launcher_platform): from . import Resizing_Pane as test_module self._run_test(request, workspace, editor, test_module) + + def test_Unpin_VariableManager(self, request, workspace, editor, launcher_platform): + from . import Unpin_VariableManager as test_module + self._run_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py b/AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py new file mode 100644 index 0000000000..e88236d13e --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py @@ -0,0 +1,133 @@ +""" +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. + +https://testrail.agscollab.com/index.php?/tests/view/92568973 +""" + + +# fmt: off +class Tests(): + open_sc_window = ("Script Canvas window is opened", "Failed to open Script Canvas window") + variable_manager_opened = ("VariableManager is opened successfully", "Failed to open VariableManager") + boolean_pinned = ("Boolean is pinned", "Boolean is not pinned, But it should be unpinned") + boolean_unpinned = ("Boolean is unpinned", "Boolean is not unpinned, But it should be pinned") + boolean_unpinned_after_reopen = ("Boolean is unpinned after reopening create variable menu", "Boolean is not unpinned after reopening create variable menu") +# fmt: on + + +def Unpin_VariableManager(): + """ + Summary: + Unpin variable types in create variable menu. + + Expected Behavior: + The variable unpinned in create variable menu remains unpinned after reopening create variable menu. + + Test Steps: + 1) Open Script Canvas window (Tools > Script Canvas) + 2) Get the SC window object + 3) Open Variable Manager in Script Canvas window + 4) Create new graph + 5) Click on the Create Variable button in the Variable Manager + 6) Unpin Boolean by clicking the "Pin" icon on its left side + 7) Close and Reopen Create Variable menu and make sure Boolean is unpinned after reopening Create Variable menu + 8) Restore default layout and close SC window + + Note: + - This test file must be called from the Lumberyard Editor command terminal + - Any passed and failed tests are written to the Editor.log file. + Parsing the file or running a log_monitor are required to observe the test results. + + :return: None + """ + + from PySide2 import QtWidgets + import azlmbr.legacy.general as general + + import pyside_utils + from utils import TestHelper as helper + from utils import Report + from PySide2.QtCore import Qt + + GENERAL_WAIT = 5.0 # seconds + + def find_pane(window, pane_name): + return window.findChild(QtWidgets.QDockWidget, pane_name) + + def click_menu_option(window, option_text): + action = pyside_utils.find_child_by_pattern(window, {"text": option_text, "type": QtWidgets.QAction}) + action.trigger() + + # 1) Open Script Canvas window (Tools > Script Canvas) + general.idle_enable(True) + general.open_pane("Script Canvas") + is_sc_visible = helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 15.0) + Report.result(Tests.open_sc_window, is_sc_visible) + + # 2) Get the SC window object + editor_window = pyside_utils.get_editor_main_window() + sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas") + sc_main = sc.findChild(QtWidgets.QMainWindow) + + # 3) Open Variable Manager in Script Canvas window + pane = find_pane(sc, "VariableManager") + if not pane.isVisible(): + click_menu_option(sc, "Variable Manager") + pane = find_pane(sc, "VariableManager") + Report.result(Tests.variable_manager_opened, pane.isVisible()) + + # 4) Create new graph + create_new_graph = pyside_utils.find_child_by_pattern( + sc_main, {"objectName": "action_New_Script", "type": QtWidgets.QAction} + ) + create_new_graph.trigger() + + # 5) Click on the Create Variable button in the Variable Manager + variable_manager = sc_main.findChild(QtWidgets.QDockWidget, "VariableManager") + button = variable_manager.findChild(QtWidgets.QPushButton, "addButton") + button.click() + + # 6) Unpin Boolean by clicking the "Pin" icon on its left side + table_view = variable_manager.findChild(QtWidgets.QTableView, "variablePalette") + model_index = pyside_utils.find_child_by_pattern(table_view, "Boolean") + # Make sure Boolean is pinned + result = helper.wait_for_condition( + lambda: model_index.siblingAtColumn(0).data(Qt.DecorationRole) is not None, GENERAL_WAIT + ) + Report.result(Tests.boolean_pinned, result) + # Unpin Boolean and make sure Boolean is unpinned. + pyside_utils.item_view_index_mouse_click(table_view, model_index.siblingAtColumn(0)) + result = helper.wait_for_condition( + lambda: model_index.siblingAtColumn(0).data(Qt.DecorationRole) is None, GENERAL_WAIT + ) + Report.result(Tests.boolean_unpinned, result) + + # 7) Close and Reopen Create Variable menu and make sure Boolean is unpinned after reopening Create Variable menu + button.click() + button.click() + general.idle_wait(1.0) + result = helper.wait_for_condition( + lambda: model_index.siblingAtColumn(0).data(Qt.DecorationRole) is None, GENERAL_WAIT + ) + Report.result(Tests.boolean_unpinned_after_reopen, result) + + # 8) Restore default layout and close SC window + click_menu_option(sc, "Restore Default Layout") + sc.close() + + +if __name__ == "__main__": + import ImportPathHelper as imports + + imports.init() + + from utils import Report + + Report.start_test(Unpin_VariableManager) From c90be6effae4ce570c930c45272d6d3a7b811003 Mon Sep 17 00:00:00 2001 From: darapan Date: Wed, 5 May 2021 04:22:52 -0700 Subject: [PATCH 2/9] "Ran fixup" --- .../Gem/PythonTests/scripting/Unpin_VariableManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py b/AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py index e88236d13e..682084ff68 100644 --- a/AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py @@ -97,7 +97,7 @@ def Unpin_VariableManager(): # 6) Unpin Boolean by clicking the "Pin" icon on its left side table_view = variable_manager.findChild(QtWidgets.QTableView, "variablePalette") model_index = pyside_utils.find_child_by_pattern(table_view, "Boolean") - # Make sure Boolean is pinned + # Make sure Boolean is pinned result = helper.wait_for_condition( lambda: model_index.siblingAtColumn(0).data(Qt.DecorationRole) is not None, GENERAL_WAIT ) From 460863be0aade63c3fa43b35419566309ba8cd2e Mon Sep 17 00:00:00 2001 From: darapan Date: Thu, 6 May 2021 05:06:14 -0700 Subject: [PATCH 3/9] "Resolving merge conflicts" --- .../PythonTests/scripting/TestSuite_Active.py | 229 +++++++++++++++++- 1 file changed, 223 insertions(+), 6 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py index da67f21db1..d87f2986bf 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py @@ -12,26 +12,243 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. import pytest import os import sys +sys.path.append(os.path.dirname(__file__)) +import ImportPathHelper as imports +imports.init() + +import hydra_test_utils as hydra +import ly_test_tools.environment.file_system as file_system from ly_test_tools import LAUNCHERS - -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') - from base import TestAutomationBase +TEST_DIRECTORY = os.path.dirname(__file__) + + @pytest.mark.SUITE_periodic @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) class TestAutomation(TestAutomationBase): - + @pytest.mark.test_case_id("C1702834", "C1702823") + def test_Opening_Closing_Pane(self, request, workspace, editor, launcher_platform): + from . import Opening_Closing_Pane as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("C1702824") def test_Docking_Pane(self, request, workspace, editor, launcher_platform): from . import Docking_Pane as test_module self._run_test(request, workspace, editor, test_module) + @pytest.mark.test_case_id("C1702829") def test_Resizing_Pane(self, request, workspace, editor, launcher_platform): from . import Resizing_Pane as test_module self._run_test(request, workspace, editor, test_module) - def test_Unpin_VariableManager(self, request, workspace, editor, launcher_platform): - from . import Unpin_VariableManager as test_module + @pytest.mark.test_case_id("T92563190") + @pytest.mark.parametrize("level", ["tmp_level"]) + def test_ScriptCanvas_TwoComponents(self, request, workspace, editor, launcher_platform, level): + def teardown(): + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + from . import ScriptCanvas_TwoComponents as test_module self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92562986") + @pytest.mark.parametrize("level", ["tmp_level"]) + def test_ScriptCanvas_ChangingAssets(self, request, workspace, editor, launcher_platform, project, level): + def teardown(): + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + from . import ScriptCanvas_ChangingAssets as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92569079", "T92569081") + def test_Graph_ZoomInZoomOut(self, request, workspace, editor, launcher_platform): + from . import Graph_ZoomInZoomOut as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92568940") + def test_NodePalette_SelectNode(self, request, workspace, editor, launcher_platform): + from . import NodePalette_SelectNode as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92569253") + @pytest.mark.test_case_id("T92569254") + @pytest.mark.parametrize("level", ["tmp_level"]) + def test_OnEntityActivatedDeactivated_PrintMessage(self, request, workspace, editor, launcher_platform, project, level): + def teardown(): + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + from . import OnEntityActivatedDeactivated_PrintMessage as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92562993") + def test_NodePalette_ClearSelection(self, request, workspace, editor, launcher_platform, project): + from . import NodePalette_ClearSelection as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92563191") + @pytest.mark.parametrize("level", ["tmp_level"]) + def test_ScriptCanvas_TwoEntities(self, request, workspace, editor, launcher_platform, project, level): + def teardown(): + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + from . import ScriptCanvas_TwoEntities as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92569013") + def test_AssetEditor_CreateScriptEventFile(self, request, workspace, editor, launcher_platform, project): + def teardown(): + file_system.delete( + [os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True + ) + request.addfinalizer(teardown) + file_system.delete( + [os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True + ) + from . import AssetEditor_CreateScriptEventFile as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92569165", "T92569167", "T92569168", "T92569170") + def test_Toggle_ScriptCanvasTools(self, request, workspace, editor, launcher_platform): + from . import Toggle_ScriptCanvasTools as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92568982") + def test_NodeInspector_RenameVariable(self, request, workspace, editor, launcher_platform, project): + from . import NodeInspector_RenameVariable as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92569137") + def test_Debugging_TargetMultipleGraphs(self, request, workspace, editor, launcher_platform, project): + from . import Debugging_TargetMultipleGraphs as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92568856") + @pytest.mark.parametrize("level", ["tmp_level"]) + def test_Debugging_TargetMultipleEntities(self, request, workspace, editor, launcher_platform, project, level): + def teardown(): + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + from . import Debugging_TargetMultipleEntities as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92569049", "T92569051") + def test_EditMenu_UndoRedo(self, request, workspace, editor, launcher_platform, project): + from . import EditMenu_UndoRedo as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("C1702825", "C1702831") + def test_UnDockedPane_CloseSCWindow(self, request, workspace, editor, launcher_platform): + from . import UnDockedPane_CloseSCWindow as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92562978") + @pytest.mark.parametrize("level", ["tmp_level"]) + def test_Entity_AddScriptCanvasComponent(self, request, workspace, editor, launcher_platform, project, level): + def teardown(): + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + from . import Entity_AddScriptCanvasComponent as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("C1702821", "C1702832") + def test_Pane_RetainOnSCRestart(self, request, workspace, editor, launcher_platform): + from . import Pane_RetainOnSCRestart as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92567321") + @pytest.mark.parametrize("level", ["tmp_level"]) + def test_ScriptEvents_SendReceiveAcrossMultiple(self, request, workspace, editor, launcher_platform, project, level): + def teardown(): + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + from . import ScriptEvents_SendReceiveAcrossMultiple as test_module + self._run_test(request, workspace, editor, test_module) + + @pytest.mark.test_case_id("T92567320") + @pytest.mark.parametrize("level", ["tmp_level"]) + def test_ScriptEvents_SendReceiveSuccessfully(self, request, workspace, editor, launcher_platform, project, level): + def teardown(): + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + from . import ScriptEvents_SendReceiveSuccessfully as test_module + self._run_test(request, workspace, editor, test_module) + +# NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method +# fails because of pyside_utils import +@pytest.mark.SUITE_periodic +@pytest.mark.parametrize("launcher_platform", ["windows_editor"]) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +class TestScriptCanvasTests(object): + """ + The following tests use hydra_test_utils.py to launch the editor and validate the results. + """ + + @pytest.mark.test_case_id("T92569037", "T92569039") + def test_FileMenu_New_Open(self, request, editor, launcher_platform): + expected_lines = [ + "File->New action working as expected: True", + "File->Open action working as expected: True", + ] + hydra.launch_and_validate_results( + request, TEST_DIRECTORY, editor, "FileMenu_New_Open.py", expected_lines, auto_test_mode=False, timeout=60, + ) + + @pytest.mark.test_case_id("T92568942") + def test_AssetEditor_NewScriptEvent(self, request, editor, launcher_platform): + expected_lines = [ + "New Script event action found: True", + "Asset Editor opened: True", + "Asset Editor created with new asset: True", + "New Script event created in Asset Editor: True", + ] + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + editor, + "AssetEditor_NewScriptEvent.py", + expected_lines, + auto_test_mode=False, + timeout=60, + ) + + @pytest.mark.test_case_id("T92563068", "T92563070") + def test_GraphClose_SavePrompt(self, request, editor, launcher_platform): + expected_lines = [ + "New graph created: True", + "Save prompt opened as expected: True", + "Close button worked as expected: True", + ] + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + editor, + "GraphClose_SavePrompt.py", + expected_lines, + auto_test_mode=False, + timeout=60, + ) + + @pytest.mark.test_case_id("T92564789", "T92568873") + def test_VariableManager_CreateDeleteVars(self, request, editor, launcher_platform): + var_types = ["Boolean", "Color", "EntityID", "Number", "String", "Transform", "Vector2", "Vector3", "Vector4"] + expected_lines = [f"Success: {var_type} variable is created" for var_type in var_types] + expected_lines.extend([f"Success: {var_type} variable is deleted" for var_type in var_types]) + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + editor, + "VariableManager_CreateDeleteVars.py", + expected_lines, + auto_test_mode=False, + timeout=60, + ) \ No newline at end of file From 409500635fc8a6b82beca4ae5db88a88a8b1434f Mon Sep 17 00:00:00 2001 From: darapan Date: Thu, 6 May 2021 05:40:11 -0700 Subject: [PATCH 4/9] "Fixing review comments" --- .../PythonTests/scripting/TestSuite_Active.py | 5 +++ ...y => VariableManager_UnpinVariableType.py} | 34 +++++++++---------- 2 files changed, 22 insertions(+), 17 deletions(-) rename AutomatedTesting/Gem/PythonTests/scripting/{Unpin_VariableManager.py => VariableManager_UnpinVariableType.py} (75%) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py index d87f2986bf..7c218b5fa9 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py @@ -183,6 +183,11 @@ class TestAutomation(TestAutomationBase): from . import ScriptEvents_SendReceiveSuccessfully as test_module self._run_test(request, workspace, editor, test_module) + @pytest.mark.test_case_id("T92568973") + def test_VariableManager_UnpinVariableType(self, request, workspace, editor, launcher_platform): + from . import VariableManager_UnpinVariableType as test_module + self._run_test(request, workspace, editor, test_module) + # NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method # fails because of pyside_utils import @pytest.mark.SUITE_periodic diff --git a/AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py b/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py similarity index 75% rename from AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py rename to AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py index 682084ff68..f9fe45dd86 100644 --- a/AutomatedTesting/Gem/PythonTests/scripting/Unpin_VariableManager.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py @@ -8,21 +8,22 @@ or, if provided, by the license below or the license accompanying this file. Do 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. -https://testrail.agscollab.com/index.php?/tests/view/92568973 +Test case ID: T92568973 +Test Case Title: Unpin Variable types in Variable Manager +URLs of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568973 """ # fmt: off class Tests(): - open_sc_window = ("Script Canvas window is opened", "Failed to open Script Canvas window") - variable_manager_opened = ("VariableManager is opened successfully", "Failed to open VariableManager") - boolean_pinned = ("Boolean is pinned", "Boolean is not pinned, But it should be unpinned") - boolean_unpinned = ("Boolean is unpinned", "Boolean is not unpinned, But it should be pinned") - boolean_unpinned_after_reopen = ("Boolean is unpinned after reopening create variable menu", "Boolean is not unpinned after reopening create variable menu") + variable_manager_opened = ("VariableManager is opened successfully", "Failed to open VariableManager") + variable_pinned = ("Variable is pinned", "Variable is not pinned, But it should be unpinned") + variable_unpinned = ("Variable is unpinned", "Variable is not unpinned, But it should be pinned") + variable_unpinned_after_reopen = ("Variable is unpinned after reopening create variable menu", "Variable is not unpinned after reopening create variable menu") # fmt: on -def Unpin_VariableManager(): +def VariableManager_UnpinVariableType(): """ Summary: Unpin variable types in create variable menu. @@ -41,7 +42,7 @@ def Unpin_VariableManager(): 8) Restore default layout and close SC window Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -56,7 +57,7 @@ def Unpin_VariableManager(): from utils import Report from PySide2.QtCore import Qt - GENERAL_WAIT = 5.0 # seconds + GENERAL_WAIT = 1.0 # seconds def find_pane(window, pane_name): return window.findChild(QtWidgets.QDockWidget, pane_name) @@ -68,8 +69,7 @@ def Unpin_VariableManager(): # 1) Open Script Canvas window (Tools > Script Canvas) general.idle_enable(True) general.open_pane("Script Canvas") - is_sc_visible = helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 15.0) - Report.result(Tests.open_sc_window, is_sc_visible) + helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 6.0) # 2) Get the SC window object editor_window = pyside_utils.get_editor_main_window() @@ -101,26 +101,26 @@ def Unpin_VariableManager(): result = helper.wait_for_condition( lambda: model_index.siblingAtColumn(0).data(Qt.DecorationRole) is not None, GENERAL_WAIT ) - Report.result(Tests.boolean_pinned, result) + Report.result(Tests.variable_pinned, result) # Unpin Boolean and make sure Boolean is unpinned. pyside_utils.item_view_index_mouse_click(table_view, model_index.siblingAtColumn(0)) result = helper.wait_for_condition( lambda: model_index.siblingAtColumn(0).data(Qt.DecorationRole) is None, GENERAL_WAIT ) - Report.result(Tests.boolean_unpinned, result) + Report.result(Tests.variable_unpinned, result) # 7) Close and Reopen Create Variable menu and make sure Boolean is unpinned after reopening Create Variable menu button.click() button.click() - general.idle_wait(1.0) + model_index = pyside_utils.find_child_by_pattern(table_view, "Boolean") result = helper.wait_for_condition( lambda: model_index.siblingAtColumn(0).data(Qt.DecorationRole) is None, GENERAL_WAIT ) - Report.result(Tests.boolean_unpinned_after_reopen, result) + Report.result(Tests.variable_unpinned_after_reopen, result) # 8) Restore default layout and close SC window click_menu_option(sc, "Restore Default Layout") - sc.close() + general.close_pane("Script Canvas") if __name__ == "__main__": @@ -130,4 +130,4 @@ if __name__ == "__main__": from utils import Report - Report.start_test(Unpin_VariableManager) + Report.start_test(VariableManager_UnpinVariableType) From 972f4b3c2876b2a039eb735d9d3e971f703854eb Mon Sep 17 00:00:00 2001 From: darapan Date: Thu, 6 May 2021 23:30:54 -0700 Subject: [PATCH 5/9] "Following rules in SPEC-6690" --- .../PythonTests/scripting/TestSuite_Active.py | 51 ++++++++++++++++--- .../VariableManager_UnpinVariableType.py | 4 -- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py index 7c218b5fa9..36dd4f21e3 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py @@ -12,9 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. import pytest import os import sys + sys.path.append(os.path.dirname(__file__)) import ImportPathHelper as imports + imports.init() import hydra_test_utils as hydra @@ -26,22 +28,25 @@ TEST_DIRECTORY = os.path.dirname(__file__) @pytest.mark.SUITE_periodic -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("launcher_platform", ["windows_editor"]) @pytest.mark.parametrize("project", ["AutomatedTesting"]) class TestAutomation(TestAutomationBase): @pytest.mark.test_case_id("C1702834", "C1702823") def test_Opening_Closing_Pane(self, request, workspace, editor, launcher_platform): from . import Opening_Closing_Pane as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("C1702824") def test_Docking_Pane(self, request, workspace, editor, launcher_platform): from . import Docking_Pane as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("C1702829") def test_Resizing_Pane(self, request, workspace, editor, launcher_platform): from . import Resizing_Pane as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92563190") @@ -49,9 +54,11 @@ class TestAutomation(TestAutomationBase): def test_ScriptCanvas_TwoComponents(self, request, workspace, editor, launcher_platform, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptCanvas_TwoComponents as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92562986") @@ -59,35 +66,44 @@ class TestAutomation(TestAutomationBase): def test_ScriptCanvas_ChangingAssets(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptCanvas_ChangingAssets as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569079", "T92569081") def test_Graph_ZoomInZoomOut(self, request, workspace, editor, launcher_platform): from . import Graph_ZoomInZoomOut as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92568940") def test_NodePalette_SelectNode(self, request, workspace, editor, launcher_platform): from . import NodePalette_SelectNode as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569253") @pytest.mark.test_case_id("T92569254") @pytest.mark.parametrize("level", ["tmp_level"]) - def test_OnEntityActivatedDeactivated_PrintMessage(self, request, workspace, editor, launcher_platform, project, level): + def test_OnEntityActivatedDeactivated_PrintMessage( + self, request, workspace, editor, launcher_platform, project, level + ): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import OnEntityActivatedDeactivated_PrintMessage as test_module + self._run_test(request, workspace, editor, test_module) - + @pytest.mark.test_case_id("T92562993") def test_NodePalette_ClearSelection(self, request, workspace, editor, launcher_platform, project): from . import NodePalette_ClearSelection as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92563191") @@ -95,9 +111,11 @@ class TestAutomation(TestAutomationBase): def test_ScriptCanvas_TwoEntities(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptCanvas_TwoEntities as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569013") @@ -106,26 +124,31 @@ class TestAutomation(TestAutomationBase): file_system.delete( [os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True ) + request.addfinalizer(teardown) file_system.delete( [os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True ) from . import AssetEditor_CreateScriptEventFile as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569165", "T92569167", "T92569168", "T92569170") def test_Toggle_ScriptCanvasTools(self, request, workspace, editor, launcher_platform): from . import Toggle_ScriptCanvasTools as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92568982") def test_NodeInspector_RenameVariable(self, request, workspace, editor, launcher_platform, project): from . import NodeInspector_RenameVariable as test_module + self._run_test(request, workspace, editor, test_module) - + @pytest.mark.test_case_id("T92569137") def test_Debugging_TargetMultipleGraphs(self, request, workspace, editor, launcher_platform, project): from . import Debugging_TargetMultipleGraphs as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92568856") @@ -133,19 +156,23 @@ class TestAutomation(TestAutomationBase): def test_Debugging_TargetMultipleEntities(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import Debugging_TargetMultipleEntities as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569049", "T92569051") def test_EditMenu_UndoRedo(self, request, workspace, editor, launcher_platform, project): from . import EditMenu_UndoRedo as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("C1702825", "C1702831") def test_UnDockedPane_CloseSCWindow(self, request, workspace, editor, launcher_platform): from . import UnDockedPane_CloseSCWindow as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92562978") @@ -153,24 +180,31 @@ class TestAutomation(TestAutomationBase): def test_Entity_AddScriptCanvasComponent(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import Entity_AddScriptCanvasComponent as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("C1702821", "C1702832") def test_Pane_RetainOnSCRestart(self, request, workspace, editor, launcher_platform): from . import Pane_RetainOnSCRestart as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92567321") @pytest.mark.parametrize("level", ["tmp_level"]) - def test_ScriptEvents_SendReceiveAcrossMultiple(self, request, workspace, editor, launcher_platform, project, level): + def test_ScriptEvents_SendReceiveAcrossMultiple( + self, request, workspace, editor, launcher_platform, project, level + ): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptEvents_SendReceiveAcrossMultiple as test_module + self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92567320") @@ -178,16 +212,19 @@ class TestAutomation(TestAutomationBase): def test_ScriptEvents_SendReceiveSuccessfully(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptEvents_SendReceiveSuccessfully as test_module + self._run_test(request, workspace, editor, test_module) - @pytest.mark.test_case_id("T92568973") def test_VariableManager_UnpinVariableType(self, request, workspace, editor, launcher_platform): from . import VariableManager_UnpinVariableType as test_module + self._run_test(request, workspace, editor, test_module) + # NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method # fails because of pyside_utils import @pytest.mark.SUITE_periodic @@ -256,4 +293,4 @@ class TestScriptCanvasTests(object): expected_lines, auto_test_mode=False, timeout=60, - ) \ No newline at end of file + ) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py b/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py index f9fe45dd86..5d097de2f8 100644 --- a/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py @@ -7,10 +7,6 @@ distribution (the "License"). All use of this software is governed by the Licens 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. - -Test case ID: T92568973 -Test Case Title: Unpin Variable types in Variable Manager -URLs of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568973 """ From 786cd9fcb78a474221f2dbc49e765ea02afc7f10 Mon Sep 17 00:00:00 2001 From: darapan Date: Thu, 6 May 2021 23:35:19 -0700 Subject: [PATCH 6/9] "" --- .../PythonTests/scripting/TestSuite_Active.py | 52 +++---------------- 1 file changed, 7 insertions(+), 45 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py index 36dd4f21e3..7bfcca97df 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py @@ -12,11 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. import pytest import os import sys - sys.path.append(os.path.dirname(__file__)) import ImportPathHelper as imports - imports.init() import hydra_test_utils as hydra @@ -28,25 +26,22 @@ TEST_DIRECTORY = os.path.dirname(__file__) @pytest.mark.SUITE_periodic -@pytest.mark.parametrize("launcher_platform", ["windows_editor"]) +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) class TestAutomation(TestAutomationBase): @pytest.mark.test_case_id("C1702834", "C1702823") def test_Opening_Closing_Pane(self, request, workspace, editor, launcher_platform): from . import Opening_Closing_Pane as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("C1702824") def test_Docking_Pane(self, request, workspace, editor, launcher_platform): from . import Docking_Pane as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("C1702829") def test_Resizing_Pane(self, request, workspace, editor, launcher_platform): from . import Resizing_Pane as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92563190") @@ -54,11 +49,9 @@ class TestAutomation(TestAutomationBase): def test_ScriptCanvas_TwoComponents(self, request, workspace, editor, launcher_platform, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) - request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptCanvas_TwoComponents as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92562986") @@ -66,44 +59,35 @@ class TestAutomation(TestAutomationBase): def test_ScriptCanvas_ChangingAssets(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) - request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptCanvas_ChangingAssets as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569079", "T92569081") def test_Graph_ZoomInZoomOut(self, request, workspace, editor, launcher_platform): from . import Graph_ZoomInZoomOut as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92568940") def test_NodePalette_SelectNode(self, request, workspace, editor, launcher_platform): from . import NodePalette_SelectNode as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569253") @pytest.mark.test_case_id("T92569254") @pytest.mark.parametrize("level", ["tmp_level"]) - def test_OnEntityActivatedDeactivated_PrintMessage( - self, request, workspace, editor, launcher_platform, project, level - ): + def test_OnEntityActivatedDeactivated_PrintMessage(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) - request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import OnEntityActivatedDeactivated_PrintMessage as test_module - self._run_test(request, workspace, editor, test_module) - + @pytest.mark.test_case_id("T92562993") def test_NodePalette_ClearSelection(self, request, workspace, editor, launcher_platform, project): from . import NodePalette_ClearSelection as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92563191") @@ -111,11 +95,9 @@ class TestAutomation(TestAutomationBase): def test_ScriptCanvas_TwoEntities(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) - request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptCanvas_TwoEntities as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569013") @@ -124,31 +106,26 @@ class TestAutomation(TestAutomationBase): file_system.delete( [os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True ) - request.addfinalizer(teardown) file_system.delete( [os.path.join(workspace.paths.project(), "ScriptCanvas", "test_file.scriptevent")], True, True ) from . import AssetEditor_CreateScriptEventFile as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569165", "T92569167", "T92569168", "T92569170") def test_Toggle_ScriptCanvasTools(self, request, workspace, editor, launcher_platform): from . import Toggle_ScriptCanvasTools as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92568982") def test_NodeInspector_RenameVariable(self, request, workspace, editor, launcher_platform, project): from . import NodeInspector_RenameVariable as test_module - self._run_test(request, workspace, editor, test_module) - + @pytest.mark.test_case_id("T92569137") def test_Debugging_TargetMultipleGraphs(self, request, workspace, editor, launcher_platform, project): from . import Debugging_TargetMultipleGraphs as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92568856") @@ -156,23 +133,19 @@ class TestAutomation(TestAutomationBase): def test_Debugging_TargetMultipleEntities(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) - request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import Debugging_TargetMultipleEntities as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92569049", "T92569051") def test_EditMenu_UndoRedo(self, request, workspace, editor, launcher_platform, project): from . import EditMenu_UndoRedo as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("C1702825", "C1702831") def test_UnDockedPane_CloseSCWindow(self, request, workspace, editor, launcher_platform): from . import UnDockedPane_CloseSCWindow as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92562978") @@ -180,31 +153,24 @@ class TestAutomation(TestAutomationBase): def test_Entity_AddScriptCanvasComponent(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) - request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import Entity_AddScriptCanvasComponent as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("C1702821", "C1702832") def test_Pane_RetainOnSCRestart(self, request, workspace, editor, launcher_platform): from . import Pane_RetainOnSCRestart as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92567321") @pytest.mark.parametrize("level", ["tmp_level"]) - def test_ScriptEvents_SendReceiveAcrossMultiple( - self, request, workspace, editor, launcher_platform, project, level - ): + def test_ScriptEvents_SendReceiveAcrossMultiple(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) - request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptEvents_SendReceiveAcrossMultiple as test_module - self._run_test(request, workspace, editor, test_module) @pytest.mark.test_case_id("T92567320") @@ -212,19 +178,15 @@ class TestAutomation(TestAutomationBase): def test_ScriptEvents_SendReceiveSuccessfully(self, request, workspace, editor, launcher_platform, project, level): def teardown(): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) - request.addfinalizer(teardown) file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptEvents_SendReceiveSuccessfully as test_module - self._run_test(request, workspace, editor, test_module) - + def test_VariableManager_UnpinVariableType(self, request, workspace, editor, launcher_platform): from . import VariableManager_UnpinVariableType as test_module - self._run_test(request, workspace, editor, test_module) - # NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method # fails because of pyside_utils import @pytest.mark.SUITE_periodic @@ -293,4 +255,4 @@ class TestScriptCanvasTests(object): expected_lines, auto_test_mode=False, timeout=60, - ) + ) \ No newline at end of file From f21d3da9eee54f5a6720abdf01449e710c4a92d5 Mon Sep 17 00:00:00 2001 From: darapan Date: Tue, 11 May 2021 01:30:39 -0700 Subject: [PATCH 7/9] "Fixing review Comments" --- .../PythonTests/scripting/TestSuite_Active.py | 4 ++-- ...ariableManager_UnpinVariableType_Works.py} | 20 ++++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) rename AutomatedTesting/Gem/PythonTests/scripting/{VariableManager_UnpinVariableType.py => VariableManager_UnpinVariableType_Works.py} (91%) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py index 7bfcca97df..cad6431fef 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py @@ -183,8 +183,8 @@ class TestAutomation(TestAutomationBase): from . import ScriptEvents_SendReceiveSuccessfully as test_module self._run_test(request, workspace, editor, test_module) - def test_VariableManager_UnpinVariableType(self, request, workspace, editor, launcher_platform): - from . import VariableManager_UnpinVariableType as test_module + def test_VariableManager_UnpinVariableType_Works(self, request, workspace, editor, launcher_platform): + from . import VariableManager_UnpinVariableType_Works as test_module self._run_test(request, workspace, editor, test_module) # NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method diff --git a/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py b/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType_Works.py similarity index 91% rename from AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py rename to AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType_Works.py index 5d097de2f8..7076f60385 100644 --- a/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/VariableManager_UnpinVariableType_Works.py @@ -1,7 +1,6 @@ """ 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 @@ -19,14 +18,12 @@ class Tests(): # fmt: on -def VariableManager_UnpinVariableType(): +def VariableManager_UnpinVariableType_Works(): """ Summary: Unpin variable types in create variable menu. - Expected Behavior: The variable unpinned in create variable menu remains unpinned after reopening create variable menu. - Test Steps: 1) Open Script Canvas window (Tools > Script Canvas) 2) Get the SC window object @@ -36,12 +33,10 @@ def VariableManager_UnpinVariableType(): 6) Unpin Boolean by clicking the "Pin" icon on its left side 7) Close and Reopen Create Variable menu and make sure Boolean is unpinned after reopening Create Variable menu 8) Restore default layout and close SC window - Note: - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. - :return: None """ @@ -94,15 +89,12 @@ def VariableManager_UnpinVariableType(): table_view = variable_manager.findChild(QtWidgets.QTableView, "variablePalette") model_index = pyside_utils.find_child_by_pattern(table_view, "Boolean") # Make sure Boolean is pinned - result = helper.wait_for_condition( - lambda: model_index.siblingAtColumn(0).data(Qt.DecorationRole) is not None, GENERAL_WAIT - ) + is_boolean = model_index.siblingAtColumn(0) + result = helper.wait_for_condition(lambda: is_boolean.data(Qt.DecorationRole) is not None, GENERAL_WAIT) Report.result(Tests.variable_pinned, result) # Unpin Boolean and make sure Boolean is unpinned. - pyside_utils.item_view_index_mouse_click(table_view, model_index.siblingAtColumn(0)) - result = helper.wait_for_condition( - lambda: model_index.siblingAtColumn(0).data(Qt.DecorationRole) is None, GENERAL_WAIT - ) + pyside_utils.item_view_index_mouse_click(table_view, is_boolean) + result = helper.wait_for_condition(lambda: is_boolean.data(Qt.DecorationRole) is None, GENERAL_WAIT) Report.result(Tests.variable_unpinned, result) # 7) Close and Reopen Create Variable menu and make sure Boolean is unpinned after reopening Create Variable menu @@ -126,4 +118,4 @@ if __name__ == "__main__": from utils import Report - Report.start_test(VariableManager_UnpinVariableType) + Report.start_test(VariableManager_UnpinVariableType_Works) From a82d22a71841d07a1bb110305fc81e63c850c05d Mon Sep 17 00:00:00 2001 From: darapan Date: Tue, 11 May 2021 01:39:14 -0700 Subject: [PATCH 8/9] "Resolving merge conflicts" --- .../PythonTests/scripting/TestSuite_Active.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py index cad6431fef..963693b54c 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py @@ -182,9 +182,22 @@ class TestAutomation(TestAutomationBase): file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) from . import ScriptEvents_SendReceiveSuccessfully as test_module self._run_test(request, workspace, editor, test_module) + + @pytest.mark.parametrize("level", ["tmp_level"]) + def test_ScriptEvents_ReturnSetType_Successfully(self, request, workspace, editor, launcher_platform, project, level): + def teardown(): + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + request.addfinalizer(teardown) + file_system.delete([os.path.join(workspace.paths.project(), "Levels", level)], True, True) + from . import ScriptEvents_ReturnSetType_Successfully as test_module + self._run_test(request, workspace, editor, test_module) + + def test_NodeCategory_ExpandOnClick(self, request, workspace, editor, launcher_platform): + from . import NodeCategory_ExpandOnClick as test_module + self._run_test(request, workspace, editor, test_module) - def test_VariableManager_UnpinVariableType_Works(self, request, workspace, editor, launcher_platform): - from . import VariableManager_UnpinVariableType_Works as test_module + def test_NodePalette_SearchText_Deletion(self, request, workspace, editor, launcher_platform): + from . import NodePalette_SearchText_Deletion as test_module self._run_test(request, workspace, editor, test_module) # NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method @@ -255,4 +268,4 @@ class TestScriptCanvasTests(object): expected_lines, auto_test_mode=False, timeout=60, - ) \ No newline at end of file + ) From 805f447d41276f09c98c3cb013ac3a31009b921a Mon Sep 17 00:00:00 2001 From: darapan Date: Tue, 11 May 2021 01:41:52 -0700 Subject: [PATCH 9/9] "Resolving merge conflicts" --- .../Gem/PythonTests/scripting/TestSuite_Active.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py index 963693b54c..dda75f0a0c 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py @@ -200,6 +200,10 @@ class TestAutomation(TestAutomationBase): from . import NodePalette_SearchText_Deletion as test_module self._run_test(request, workspace, editor, test_module) + def test_VariableManager_UnpinVariableType_Works(self, request, workspace, editor, launcher_platform): + from . import VariableManager_UnpinVariableType_Works as test_module + self._run_test(request, workspace, editor, test_module) + # NOTE: We had to use hydra_test_utils.py, as TestAutomationBase run_test method # fails because of pyside_utils import @pytest.mark.SUITE_periodic