Merge branch 'main' into Prefab/Automation/Tests
This commit is contained in:
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C18977329
|
||||
# Test Case Title : Add cloth simulation to a Mesh
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18977329
|
||||
|
||||
# fmt: off
|
||||
class Tests:
|
||||
|
||||
-1
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C18977330
|
||||
# Test Case Title : Add cloth simulation to an Actor
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18977330
|
||||
|
||||
# fmt: off
|
||||
class Tests:
|
||||
|
||||
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C28798177
|
||||
# Test Case Title : White Box Tool Component can be added to an Entity
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/28798177
|
||||
|
||||
|
||||
# fmt:off
|
||||
|
||||
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C28798205
|
||||
# Test Case Title : From the White Box Component Card the White Box Mesh can be set to be invisible in Game View
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/28798205
|
||||
|
||||
|
||||
# fmt:off
|
||||
|
||||
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# Test case ID : C29279329
|
||||
# Test Case Title : White Box mesh shape can be changed with the Default Shape dropdown on the Component
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/29279329
|
||||
|
||||
|
||||
# fmt:off
|
||||
|
||||
+12
-20
@@ -82,42 +82,34 @@ class TestDistanceBetweenFilterComponentOverrides(EditorTestHelper):
|
||||
editor.EditorComponentAPIBus(bus.Broadcast, "SetComponentProperty", veg_system_settings_component,
|
||||
'Configuration|Area System Settings|Sector Point Density', 16)
|
||||
|
||||
# Add a Vegetation Debugger component to allow area refreshes
|
||||
hydra.add_level_component("Vegetation Debugger")
|
||||
|
||||
# 5) Add a Vegetation Distance Between Filter, toggle overrides on both the component and descriptor,
|
||||
# and verify initial instance counts are accurate
|
||||
spawner_entity.add_component("Vegetation Distance Between Filter")
|
||||
spawner_entity.get_set_test(3, "Configuration|Allow Per-Item Overrides", True)
|
||||
spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]|Distance Between Filter (Radius)|Override Enabled", True)
|
||||
general.run_console('veg_debugClearAllAreas')
|
||||
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 2), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 2), 5.0) and \
|
||||
self.test_success
|
||||
num_expected = 16 * 16
|
||||
initial_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected), 5.0)
|
||||
self.test_success = self.test_success and initial_success
|
||||
|
||||
# 6) Change Radius Min to 1.0, refresh, and verify instance counts are accurate
|
||||
spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]|Distance Between Filter (Radius)|Radius Min", 1.0)
|
||||
general.run_console('veg_debugClearAllAreas')
|
||||
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 1), 5.0) and \
|
||||
self.test_success
|
||||
point_a_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0)
|
||||
point_b_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0)
|
||||
point_c_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 1), 5.0)
|
||||
self.test_success = self.test_success and point_a_success and point_b_success and point_c_success
|
||||
|
||||
# 7) Change Radius Min to 2.0, refresh, and verify instance counts are accurate
|
||||
spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]|Distance Between Filter (Radius)|Radius Min", 2.0)
|
||||
general.run_console('veg_debugClearAllAreas')
|
||||
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 0), 5.0) and \
|
||||
self.test_success
|
||||
point_a_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0)
|
||||
point_b_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0)
|
||||
point_c_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 0), 5.0)
|
||||
self.test_success = self.test_success and point_a_success and point_b_success and point_c_success
|
||||
|
||||
# 8) Change Radius Min to 16.0, refresh, and verify instance counts are accurate, only a single instance should plant
|
||||
spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]|Distance Between Filter (Radius)|Radius Min", 16.0)
|
||||
general.run_console('veg_debugClearAllAreas')
|
||||
num_expected_instances = 1
|
||||
final_check_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected_instances), 5.0)
|
||||
self.test_success = final_check_success and self.test_success
|
||||
self.test_success = self.test_success and final_check_success
|
||||
|
||||
|
||||
test = TestDistanceBetweenFilterComponentOverrides()
|
||||
|
||||
+12
-18
@@ -80,35 +80,29 @@ class TestDistanceBetweenFilterComponent(EditorTestHelper):
|
||||
editor.EditorComponentAPIBus(bus.Broadcast, "SetComponentProperty", veg_system_settings_component,
|
||||
'Configuration|Area System Settings|Sector Point Density', 16)
|
||||
|
||||
# Add a Vegetation Debugger component to allow area refreshes
|
||||
hydra.add_level_component("Vegetation Debugger")
|
||||
|
||||
# 5) Add a Vegetation Distance Between Filter and verify initial instance counts are accurate
|
||||
spawner_entity.add_component("Vegetation Distance Between Filter")
|
||||
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 2), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 2), 5.0) and \
|
||||
self.test_success
|
||||
num_expected = 16 * 16
|
||||
num_expected = 16 * 16
|
||||
initial_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected), 5.0)
|
||||
self.test_success = self.test_success and initial_success
|
||||
|
||||
# 6) Change Radius Min to 1.0, refresh, and verify instance counts are accurate
|
||||
spawner_entity.get_set_test(3, "Configuration|Radius Min", 1.0)
|
||||
general.run_console('veg_debugClearAllAreas')
|
||||
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 1), 5.0) and \
|
||||
self.test_success
|
||||
point_a_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0)
|
||||
point_b_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0)
|
||||
point_c_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 1), 5.0)
|
||||
self.test_success = self.test_success and point_a_success and point_b_success and point_c_success
|
||||
|
||||
# 7) Change Radius Min to 2.0, refresh, and verify instance counts are accurate
|
||||
spawner_entity.get_set_test(3, "Configuration|Radius Min", 2.0)
|
||||
general.run_console('veg_debugClearAllAreas')
|
||||
self.test_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0) and \
|
||||
self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 0), 5.0) and \
|
||||
self.test_success
|
||||
point_a_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_a, 0.5, 1), 5.0)
|
||||
point_b_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_b, 0.5, 0), 5.0)
|
||||
point_c_success = self.wait_for_condition(lambda: dynveg.validate_instance_count(instance_query_point_c, 0.5, 0), 5.0)
|
||||
self.test_success = self.test_success and point_a_success and point_b_success and point_c_success
|
||||
|
||||
# 8) Change Radius Min to 16.0, refresh, and verify instance counts are accurate
|
||||
spawner_entity.get_set_test(3, "Configuration|Radius Min", 16.0)
|
||||
general.run_console('veg_debugClearAllAreas')
|
||||
num_expected_instances = 1
|
||||
final_check_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected_instances), 5.0)
|
||||
self.test_success = final_check_success and self.test_success
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ def C14976308_ScriptCanvas_SetKinematicTargetTransform():
|
||||
the script deactivates Signal, Sphere's transform will update to that of Transform_Target.
|
||||
NOTE: There is a known bug (LY-107723) which causes the rotation to update to a value that is not sufficiently close
|
||||
to the expected result when using Set Kinematic Target which will cause the test to fail:
|
||||
https://jira.agscollab.com/browse/LY-107723
|
||||
LY-107723
|
||||
|
||||
Test Steps:
|
||||
1) Open level and enter game mode
|
||||
|
||||
@@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# Test case ID : C3510644
|
||||
# Test Case Title : Check that the collision layer and collision group of the terrain can be changed
|
||||
# and the collision behavior of the terrain changes accordingly
|
||||
# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/3510644
|
||||
|
||||
|
||||
# fmt: off
|
||||
|
||||
@@ -239,7 +239,7 @@ def C6321601_Force_HighValuesDirectionAxes():
|
||||
force_notification_handler.add_callback("OnCalculateNetForce", on_calc_net_force)
|
||||
|
||||
# Wait for 3 secs, because there is a known bug identified and filed in
|
||||
# JIRA https://jira.agscollab.com/browse/LY-107677
|
||||
# JIRA LY-107677
|
||||
# The error "[Error] Huge object being added to a COctreeNode, name: 'MeshComponentRenderNode', objBox:"
|
||||
# will show (if occured) in about 3 sec into the game mode.
|
||||
helper.wait_for_condition(has_physx_error, 3.0)
|
||||
|
||||
@@ -50,7 +50,7 @@ class TestAutomation(TestAutomationBase):
|
||||
unexpected_lines = ["Assert"]
|
||||
self._run_test(request, workspace, editor, test_module, expected_lines, unexpected_lines)
|
||||
|
||||
# BUG: https://jira.agscollab.com/browse/LY-107723")
|
||||
# BUG: LY-107723")
|
||||
def test_C14976308_ScriptCanvas_SetKinematicTargetTransform(self, request, workspace, editor):
|
||||
from . import C14976308_ScriptCanvas_SetKinematicTargetTransform as test_module
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
'''
|
||||
This unittest might have to be refactored once changes to Physmaterial_Editor.py are made.
|
||||
These changes will occur after the but, reverence below is resloved.
|
||||
Bug: https://jira.agscollab.com/browse/LY-107392
|
||||
Bug: LY-107392
|
||||
'''
|
||||
class Tests:
|
||||
opening_bad_file = ("Bad file could not be opened", "Bad file was opened")
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569013
|
||||
Test Case Title: Script Event file can be created
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569013
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
Test case ID: T92568942
|
||||
Test Case Title: Clicking the "+" button and selecting "New Script Event" opens the
|
||||
Asset Editor with a new Script Event asset
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568942
|
||||
"""
|
||||
|
||||
from PySide2 import QtWidgets
|
||||
|
||||
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92568856
|
||||
Test Case Title: Multiple Entities can be targeted in the Debugger tool
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568856
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569137
|
||||
Test Case Title: Multiple Graphs can be targeted in the Debugger tool
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569137
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702824
|
||||
Test Case Title: Docking
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702824
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -11,10 +11,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569049
|
||||
Test Case Title: Edit > Undo undoes the last action
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569049
|
||||
Test case ID: T92569051
|
||||
Test Case Title: Edit > Redo redoes the last undone action
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569051
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92562978
|
||||
Test Case Title: Script Canvas Component can be added to an entity
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92562978
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -11,10 +11,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569037
|
||||
Test Case Title: File > New Script creates a new script
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569037
|
||||
Test case ID: T92569039
|
||||
Test Case Title: File > Open opens the Open... dialog
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569039
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
@@ -11,11 +11,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92563070
|
||||
Test Case Title: Graphs can be closed by clicking X on the Graph name tab
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92563070
|
||||
Test case ID: T92563068
|
||||
Test Case Title: Save Prompt: User is prompted to save a graph on close after
|
||||
creating a new graph
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92563068
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
@@ -11,10 +11,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569079
|
||||
Test Case Title: View > Zoom In zooms the graph in
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569079
|
||||
Test case ID: T92569081
|
||||
Test Case Title: View > Zoom In zooms the graph out
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569081
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92562988
|
||||
Test Case Title: Left-click/double click expands and collapses node categories
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92562988
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92568982
|
||||
Test Case Title: Renaming variables in the Node Inspector
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568982
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92562993
|
||||
Test Case Title: Clicking the X button on the Search Box clears the currently entered string
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92562993
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
set_search_string = ("Search string is set", "Search string is not set")
|
||||
search_string_deleted = ("Search string deleted as expected", "Search string not deleted")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def NodePalette_SearchText_Deletion():
|
||||
"""
|
||||
Summary:
|
||||
We enter some string in the Node Palette Search box, select that text and delete it.
|
||||
|
||||
Expected Behavior:
|
||||
After RightClick->Delete the text in the Searchbox should be deleted.
|
||||
|
||||
Test Steps:
|
||||
1) Open Script Canvas window (Tools > Script Canvas)
|
||||
2) Get the SC window object
|
||||
3) Open Node Manager if not opened already
|
||||
4) Set some string in the Search box
|
||||
5) Verify if the test string is set
|
||||
6) Delete search string using right click and verify if it is cleared
|
||||
|
||||
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
|
||||
"""
|
||||
|
||||
from PySide2 import QtWidgets, QtTest, QtCore
|
||||
|
||||
from utils import TestHelper as helper
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
import pyside_utils
|
||||
|
||||
TEST_STRING = "TestString"
|
||||
|
||||
# 1) Open Script Canvas window (Tools > Script Canvas)
|
||||
general.idle_enable(True)
|
||||
general.open_pane("Script Canvas")
|
||||
helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 3.0)
|
||||
|
||||
# 2) Get the SC window object
|
||||
editor_window = pyside_utils.get_editor_main_window()
|
||||
sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas")
|
||||
|
||||
# 3) Open Node Manager if not opened already
|
||||
if sc.findChild(QtWidgets.QDockWidget, "NodePalette") is None:
|
||||
action = pyside_utils.find_child_by_pattern(sc, {"text": "Node Palette", "type": QtWidgets.QAction})
|
||||
action.trigger()
|
||||
node_palette = sc.findChild(QtWidgets.QDockWidget, "NodePalette")
|
||||
search_frame = node_palette.findChild(QtWidgets.QFrame, "searchFrame")
|
||||
|
||||
# 4) Set some string in the Search box
|
||||
search_box = search_frame.findChild(QtWidgets.QLineEdit, "searchFilter")
|
||||
search_box.setText(TEST_STRING)
|
||||
|
||||
# 5) Verify if the test string is set
|
||||
result = helper.wait_for_condition(lambda: search_box.text() == TEST_STRING, 1.0)
|
||||
Report.result(Tests.set_search_string, result)
|
||||
|
||||
# 6) Delete search string using right click and verify if it is cleared
|
||||
QtTest.QTest.keyClick(search_box, QtCore.Qt.Key_A, QtCore.Qt.ControlModifier)
|
||||
pyside_utils.trigger_context_menu_entry(search_box, "Delete")
|
||||
result = helper.wait_for_condition(lambda: search_box.text() == "", 2.0)
|
||||
Report.result(Tests.search_string_deleted, result)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
from utils import Report
|
||||
|
||||
Report.start_test(NodePalette_SearchText_Deletion)
|
||||
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92568940
|
||||
Test Case Title: Categories and Nodes can be selected
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568940
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
node_duplicated = ("Successfully duplicated node", "Failed to duplicate the node")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def Node_HappyPath_DuplicateNode():
|
||||
"""
|
||||
Summary:
|
||||
Duplicating node in graph
|
||||
|
||||
Expected Behavior:
|
||||
Upon selecting a node and pressing Ctrl+D, the node will be duplicated
|
||||
|
||||
Test Steps:
|
||||
1) Open Script Canvas window (Tools > Script Canvas)
|
||||
2) Open a new graph
|
||||
3) Add node to graph
|
||||
4) Duplicate node
|
||||
5) Verify the node was duplicated6) Verify the node was duplicated
|
||||
|
||||
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
|
||||
"""
|
||||
from PySide2 import QtWidgets, QtTest
|
||||
from PySide2.QtCore import Qt
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
import editor_python_test_tools.pyside_utils as pyside_utils
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
WAIT_FRAMES = 200
|
||||
|
||||
NODE_NAME = "Print"
|
||||
NODE_CATEGORY = "Debug"
|
||||
EXPECTED_STRING = f"{NODE_NAME} - {NODE_CATEGORY} (2 Selected)"
|
||||
|
||||
def command_line_input(command_str):
|
||||
cmd_action = pyside_utils.find_child_by_pattern(
|
||||
sc_main, {"objectName": "action_ViewCommandLine", "type": QtWidgets.QAction}
|
||||
)
|
||||
cmd_action.trigger()
|
||||
textbox = sc.findChild(QtWidgets.QLineEdit, "commandText")
|
||||
QtTest.QTest.keyClicks(textbox, command_str)
|
||||
QtTest.QTest.keyClick(textbox, Qt.Key_Enter, Qt.NoModifier)
|
||||
|
||||
def grab_title_text():
|
||||
scroll_area = node_inspector.findChild(QtWidgets.QScrollArea, "")
|
||||
QtTest.QTest.keyClick(graph, "a", Qt.ControlModifier, WAIT_FRAMES)
|
||||
background = scroll_area.findChild(QtWidgets.QFrame, "Background")
|
||||
title = background.findChild(QtWidgets.QLabel, "Title")
|
||||
text = title.findChild(QtWidgets.QLabel, "Title")
|
||||
return text.text()
|
||||
|
||||
# 1) Open Script Canvas window (Tools > Script Canvas)
|
||||
general.idle_enable(True)
|
||||
general.open_pane("Script Canvas")
|
||||
helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 5.0)
|
||||
|
||||
# 2) Open a new graph
|
||||
editor_window = pyside_utils.get_editor_main_window()
|
||||
sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas")
|
||||
sc_main = sc.findChild(QtWidgets.QMainWindow)
|
||||
create_new_graph = pyside_utils.find_child_by_pattern(
|
||||
sc_main, {"objectName": "action_New_Script", "type": QtWidgets.QAction}
|
||||
)
|
||||
if sc.findChild(QtWidgets.QDockWidget, "NodeInspector") is None:
|
||||
action = pyside_utils.find_child_by_pattern(sc, {"text": "Node Inspector", "type": QtWidgets.QAction})
|
||||
action.trigger()
|
||||
node_inspector = sc.findChild(QtWidgets.QDockWidget, "NodeInspector")
|
||||
create_new_graph.trigger()
|
||||
|
||||
# 3) Add node
|
||||
command_line_input("add_node Print")
|
||||
|
||||
# 4) Duplicate node
|
||||
graph_view = sc.findChild(QtWidgets.QFrame, "graphicsViewFrame")
|
||||
graph = graph_view.findChild(QtWidgets.QWidget, "")
|
||||
# There are currently no utilities available to directly duplicate the node,
|
||||
# therefore the node is selected using CTRL+A on the graph to select
|
||||
# it and then CTRL+D to duplicate
|
||||
sc_main.activateWindow()
|
||||
QtTest.QTest.keyClick(graph, "a", Qt.ControlModifier, WAIT_FRAMES)
|
||||
QtTest.QTest.keyClick(graph, "d", Qt.ControlModifier, WAIT_FRAMES)
|
||||
|
||||
# 5) Verify the node was duplicated
|
||||
# As direct interaction with node is not available the text on the label
|
||||
# inside the Node Inspector is validated showing two nodes exist
|
||||
after_dup = grab_title_text()
|
||||
Report.result(Tests.node_duplicated, after_dup == EXPECTED_STRING)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
Report.start_test(Node_HappyPath_DuplicateNode)
|
||||
-1
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92569253 // T92569254
|
||||
Test Case Title: On Entity Activated // On Entity Deactivated
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92569253 // https://testrail.agscollab.com/index.php?/tests/view/92569254
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702834 // C1702823
|
||||
Test Case Title: Opening pane // Closing pane
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702834 and
|
||||
https://testrail.agscollab.com/index.php?/cases/view/1702823
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702821 // C1702832
|
||||
Test Case Title: Retain visibility, size and location upon Script Canvas restart
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702821 and
|
||||
https://testrail.agscollab.com/index.php?/cases/view/1702832
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702829
|
||||
Test Case Title: Resizing pane
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702829
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
Test case ID: T92562986
|
||||
Test Case Title: Changing the assigned Script Canvas Asset on an entity properly updates
|
||||
level functionality
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92562986
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92563190
|
||||
Test Case Title: A single Entity with two Script Canvas components works properly
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92563190
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92563191
|
||||
Test Case Title: Two Entities can use the same Graph asset successfully at RunTime
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92563191
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92567321
|
||||
Test Case Title: Script Events: Can send and receive a script event across multiple entities successfully
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92567321
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92567320
|
||||
Test Case Title: Script Events: Can send and receive a script event successfully
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92567320
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ class TestAutomation(TestAutomationBase):
|
||||
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
|
||||
@@ -122,7 +122,7 @@ class TestAutomation(TestAutomationBase):
|
||||
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
|
||||
@@ -196,6 +196,18 @@ class TestAutomation(TestAutomationBase):
|
||||
from . import NodeCategory_ExpandOnClick as test_module
|
||||
self._run_test(request, workspace, editor, 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)
|
||||
|
||||
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)
|
||||
|
||||
def test_Node_HappyPath_DuplicateNode(self, request, workspace, editor, launcher_platform):
|
||||
from . import Node_HappyPath_DuplicateNode 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
|
||||
|
||||
@@ -13,11 +13,6 @@ Test Case Title: Tools > Node Palette toggles the Node Palette
|
||||
Tools > Node Inspector toggles the Node Inspector
|
||||
Tools > Bookmarks toggles the Bookmarks
|
||||
Tools > Variable Manager toggles the Variable Manager
|
||||
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/92569165
|
||||
https://testrail.agscollab.com/index.php?/cases/view/92569167
|
||||
https://testrail.agscollab.com/index.php?/cases/view/92569168
|
||||
https://testrail.agscollab.com/index.php?/cases/view/92569170
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: C1702825 // C1702831
|
||||
Test Case Title: Undocking // Closing script canvas with the pane floating
|
||||
URLs of the test case: https://testrail.agscollab.com/index.php?/cases/view/1702825 &
|
||||
https://testrail.agscollab.com/index.php?/cases/view/1702831
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -10,10 +10,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test case ID: T92564789
|
||||
Test Case Title: Each Variable type can be created
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92564789
|
||||
Test case ID: T92568873
|
||||
Test Case Title: Each Variable type can be deleted
|
||||
URL of the test case: https://testrail.agscollab.com/index.php?/tests/view/92568873
|
||||
"""
|
||||
|
||||
|
||||
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
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 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
|
||||
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 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
|
||||
"""
|
||||
|
||||
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 = 1.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")
|
||||
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()
|
||||
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
|
||||
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, 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
|
||||
button.click()
|
||||
button.click()
|
||||
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.variable_unpinned_after_reopen, result)
|
||||
|
||||
# 8) Restore default layout and close SC window
|
||||
click_menu_option(sc, "Restore Default Layout")
|
||||
general.close_pane("Script Canvas")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
|
||||
from utils import Report
|
||||
|
||||
Report.start_test(VariableManager_UnpinVariableType_Works)
|
||||
Reference in New Issue
Block a user