Integrating github/staging through commit ab87ed9
parent
ae62a97894
commit
1044dc3da1
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"Type": "JsonSerialization",
|
||||||
|
"Version": 1,
|
||||||
|
"ClassName": "MultiplatformPresetSettings",
|
||||||
|
"ClassData": {
|
||||||
|
"DefaultPreset": {
|
||||||
|
"UUID": "{9E5BBFB4-BDDA-4759-AB74-D047EE25A35D}",
|
||||||
|
"Name": "Test_Linear_to_Auto",
|
||||||
|
"SourceColor": "Linear",
|
||||||
|
"DestColor": "Auto",
|
||||||
|
"FileMasks": [
|
||||||
|
"_linear-to-auto"
|
||||||
|
],
|
||||||
|
"PixelFormat": "R8G8B8X8",
|
||||||
|
"DiscardAlpha": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"Type": "JsonSerialization",
|
||||||
|
"Version": 1,
|
||||||
|
"ClassName": "MultiplatformPresetSettings",
|
||||||
|
"ClassData": {
|
||||||
|
"DefaultPreset": {
|
||||||
|
"UUID": "{31199710-5B61-4A30-99F0-18DF724EC308}",
|
||||||
|
"Name": "Test_Linear_to_Linear",
|
||||||
|
"SourceColor": "Linear",
|
||||||
|
"DestColor": "Linear",
|
||||||
|
"FileMasks": [
|
||||||
|
"_linear-to-linear"
|
||||||
|
],
|
||||||
|
"PixelFormat": "R8G8B8X8",
|
||||||
|
"DiscardAlpha": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"Type": "JsonSerialization",
|
||||||
|
"Version": 1,
|
||||||
|
"ClassName": "MultiplatformPresetSettings",
|
||||||
|
"ClassData": {
|
||||||
|
"DefaultPreset": {
|
||||||
|
"UUID": "{F0E6BE7F-376E-4F1B-9244-70E01C1CABD6}",
|
||||||
|
"Name": "Test_Linear_to_sRGB",
|
||||||
|
"SourceColor": "Linear",
|
||||||
|
"DestColor": "sRGB",
|
||||||
|
"FileMasks": [
|
||||||
|
"_linear-to-srgb"
|
||||||
|
],
|
||||||
|
"PixelFormat": "R8G8B8X8",
|
||||||
|
"DiscardAlpha": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"Type": "JsonSerialization",
|
||||||
|
"Version": 1,
|
||||||
|
"ClassName": "MultiplatformPresetSettings",
|
||||||
|
"ClassData": {
|
||||||
|
"DefaultPreset": {
|
||||||
|
"UUID": "{EE397A40-4430-437F-B0EF-9EC8B6E35176}",
|
||||||
|
"Name": "Test_sRGB_to_Auto",
|
||||||
|
"SourceColor": "sRGB",
|
||||||
|
"DestColor": "Auto",
|
||||||
|
"FileMasks": [
|
||||||
|
"_srgb-to-auto"
|
||||||
|
],
|
||||||
|
"PixelFormat": "R8G8B8X8",
|
||||||
|
"DiscardAlpha": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"Type": "JsonSerialization",
|
||||||
|
"Version": 1,
|
||||||
|
"ClassName": "MultiplatformPresetSettings",
|
||||||
|
"ClassData": {
|
||||||
|
"DefaultPreset": {
|
||||||
|
"UUID": "{2865D7A5-B75D-4D9C-9591-47BD2FF93377}",
|
||||||
|
"Name": "Test_sRGB_to_Linear",
|
||||||
|
"SourceColor": "sRGB",
|
||||||
|
"DestColor": "Linear",
|
||||||
|
"FileMasks": [
|
||||||
|
"_srgb-to-linear"
|
||||||
|
],
|
||||||
|
"PixelFormat": "R8G8B8X8",
|
||||||
|
"DiscardAlpha": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"Type": "JsonSerialization",
|
||||||
|
"Version": 1,
|
||||||
|
"ClassName": "MultiplatformPresetSettings",
|
||||||
|
"ClassData": {
|
||||||
|
"DefaultPreset": {
|
||||||
|
"UUID": "{9FBA54D5-EF6F-4728-AF92-B0176B8308C5}",
|
||||||
|
"Name": "Test_sRGB_to_sRGB",
|
||||||
|
"SourceColor": "sRGB",
|
||||||
|
"DestColor": "sRGB",
|
||||||
|
"FileMasks": [
|
||||||
|
"_srgb-to-srgb"
|
||||||
|
],
|
||||||
|
"PixelFormat": "R8G8B8X8",
|
||||||
|
"DiscardAlpha": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"Type": "JsonSerialization",
|
||||||
|
"Version": 1,
|
||||||
|
"ClassName": "GlobalBuildOptions",
|
||||||
|
"ClassData": {
|
||||||
|
"ShaderCompilerArguments" : {
|
||||||
|
"DefaultMatrixOrder" : "Row",
|
||||||
|
"AzslcAdditionalFreeArguments" : "--strip-unused-srgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
@ -1,78 +0,0 @@
|
|||||||
"""
|
|
||||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
|
||||||
its licensors.
|
|
||||||
|
|
||||||
For complete copyright and license terms please see the LICENSE at the root of this
|
|
||||||
distribution (the "License"). All use of this software is governed by the License,
|
|
||||||
or, if provided, by the license below or the license accompanying this file. Do not
|
|
||||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import azlmbr.object as object
|
|
||||||
import azlmbr.legacy.general as general
|
|
||||||
import azlmbr.editor as editor
|
|
||||||
import azlmbr.bus as bus
|
|
||||||
import azlmbr.entity as entity
|
|
||||||
import azlmbr.math as math
|
|
||||||
import azlmbr.asset as asset
|
|
||||||
|
|
||||||
|
|
||||||
def add_component_with_uuid(entityId, typeId):
|
|
||||||
componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', entityId, [typeId])
|
|
||||||
if (componentOutcome.IsSuccess()):
|
|
||||||
return componentOutcome.GetValue()[0]
|
|
||||||
|
|
||||||
|
|
||||||
def set_component_property(component, path, value):
|
|
||||||
outcome = editor.EditorComponentAPIBus(bus.Broadcast, 'SetComponentProperty', component, path, value)
|
|
||||||
return outcome.IsSuccess()
|
|
||||||
|
|
||||||
|
|
||||||
def get_component_property(component, path):
|
|
||||||
outcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentProperty', component, path)
|
|
||||||
if (outcome.IsSuccess()):
|
|
||||||
return outcome.GetValue()
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
# Open a level
|
|
||||||
print ('Test started')
|
|
||||||
general.open_level_no_prompt('auto_test')
|
|
||||||
|
|
||||||
newEntityId = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId())
|
|
||||||
|
|
||||||
editorDescriptorListComponentId = math.Uuid_CreateString('{3AF9BE58-6D2D-44FB-AB4D-CA1182F6C78F}', 0)
|
|
||||||
descListComponent = add_component_with_uuid(newEntityId, editorDescriptorListComponentId)
|
|
||||||
print ('descListComponent added')
|
|
||||||
|
|
||||||
primitiveCubeId = asset.AssetCatalogRequestBus(bus.Broadcast, 'GetAssetIdByPath', 'objects/default/primitive_cube.cgf', math.Uuid(), False)
|
|
||||||
primitiveSphereId = asset.AssetCatalogRequestBus(bus.Broadcast, 'GetAssetIdByPath', 'objects/default/primitive_sphere.cgf', math.Uuid(), False)
|
|
||||||
primitiveCapsuleId = asset.AssetCatalogRequestBus(bus.Broadcast, 'GetAssetIdByPath', 'objects/default/primitive_capsule.cgf', math.Uuid(), False)
|
|
||||||
primitivePlaneId = asset.AssetCatalogRequestBus(bus.Broadcast, 'GetAssetIdByPath', 'objects/default/primitive_plane.cgf', math.Uuid(), False)
|
|
||||||
print ('fetched asset ids')
|
|
||||||
|
|
||||||
# expand the list of veg descriptors to 4 elements
|
|
||||||
descList = get_component_property(descListComponent, 'Configuration|Embedded Assets')
|
|
||||||
print('Got the veg descriptor list')
|
|
||||||
descElem = descList[0]
|
|
||||||
descList.append(descElem)
|
|
||||||
descList.append(descElem)
|
|
||||||
descList.append(descElem)
|
|
||||||
|
|
||||||
set_component_property(descListComponent, 'Configuration|Embedded Assets', descList)
|
|
||||||
print('Set EditorDescriptorListComponent Embedded Assets as List')
|
|
||||||
set_component_property(descListComponent, 'Configuration|Embedded Assets|[0]|Instance|Mesh Asset', primitiveCubeId)
|
|
||||||
print('Set EditorDescriptorListComponent Embedded Assets 0 Descriptor Mesh Asset ID')
|
|
||||||
set_component_property(descListComponent, 'Configuration|Embedded Assets|[1]|Instance|Mesh Asset', primitiveSphereId)
|
|
||||||
print('Set EditorDescriptorListComponent Embedded Assets 1 Descriptor Mesh Asset ID')
|
|
||||||
set_component_property(descListComponent, 'Configuration|Embedded Assets|[2]|Instance|Mesh Asset', primitiveCapsuleId)
|
|
||||||
print('Set EditorDescriptorListComponent Embedded Assets 2 Descriptor Mesh Asset ID')
|
|
||||||
set_component_property(descListComponent, 'Configuration|Embedded Assets|[3]|Instance|Mesh Asset', primitivePlaneId)
|
|
||||||
print('Set EditorDescriptorListComponent Embedded Assets 3 Descriptor Mesh Asset ID')
|
|
||||||
except:
|
|
||||||
print ('Test failed.')
|
|
||||||
finally:
|
|
||||||
print ('Test done.')
|
|
||||||
general.exit_no_prompt()
|
|
||||||
@ -0,0 +1,87 @@
|
|||||||
|
"""
|
||||||
|
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||||
|
its licensors.
|
||||||
|
|
||||||
|
For complete copyright and license terms please see the LICENSE at the root of this
|
||||||
|
distribution (the "License"). All use of this software is governed by the License,
|
||||||
|
or, if provided, by the license below or the license accompanying this file. Do not
|
||||||
|
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import azlmbr.asset as asset
|
||||||
|
import azlmbr.bus as bus
|
||||||
|
import azlmbr.editor as editor
|
||||||
|
import azlmbr.entity as entity
|
||||||
|
import azlmbr.math as math
|
||||||
|
import azlmbr.paths
|
||||||
|
|
||||||
|
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||||
|
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||||
|
|
||||||
|
|
||||||
|
def add_component_with_uuid(entityId, typeId):
|
||||||
|
componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', entityId, [typeId])
|
||||||
|
if (componentOutcome.IsSuccess()):
|
||||||
|
return componentOutcome.GetValue()[0]
|
||||||
|
|
||||||
|
|
||||||
|
def set_component_property(component, path, value):
|
||||||
|
outcome = editor.EditorComponentAPIBus(bus.Broadcast, 'SetComponentProperty', component, path, value)
|
||||||
|
return outcome.IsSuccess()
|
||||||
|
|
||||||
|
|
||||||
|
def get_component_property(component, path):
|
||||||
|
outcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentProperty', component, path)
|
||||||
|
if (outcome.IsSuccess()):
|
||||||
|
return outcome.GetValue()
|
||||||
|
return None
|
||||||
|
|
||||||
|
class TestComponentUpdateListProperty(EditorTestHelper):
|
||||||
|
def __init__(self):
|
||||||
|
EditorTestHelper.__init__(self, log_prefix="ComponentUpdateListProperty", args=["level"])
|
||||||
|
|
||||||
|
def run_test(self):
|
||||||
|
"""
|
||||||
|
Test configuring an asset descriptor list.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Create a new level
|
||||||
|
self.test_success = self.create_level(
|
||||||
|
self.args["level"],
|
||||||
|
)
|
||||||
|
|
||||||
|
newEntityId = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId())
|
||||||
|
|
||||||
|
editorDescriptorListComponentId = math.Uuid_CreateString('{3AF9BE58-6D2D-44FB-AB4D-CA1182F6C78F}', 0)
|
||||||
|
descListComponent = add_component_with_uuid(newEntityId, editorDescriptorListComponentId)
|
||||||
|
|
||||||
|
primitiveCubeId = asset.AssetCatalogRequestBus(bus.Broadcast, 'GetAssetIdByPath', 'objects/default/primitive_cube.cgf', math.Uuid(), False)
|
||||||
|
primitiveSphereId = asset.AssetCatalogRequestBus(bus.Broadcast, 'GetAssetIdByPath', 'objects/default/primitive_sphere.cgf', math.Uuid(), False)
|
||||||
|
primitiveCapsuleId = asset.AssetCatalogRequestBus(bus.Broadcast, 'GetAssetIdByPath', 'objects/default/primitive_capsule.cgf', math.Uuid(), False)
|
||||||
|
primitivePlaneId = asset.AssetCatalogRequestBus(bus.Broadcast, 'GetAssetIdByPath', 'objects/default/primitive_plane.cgf', math.Uuid(), False)
|
||||||
|
|
||||||
|
# expand the list of veg descriptors to 4 elements
|
||||||
|
descList = get_component_property(descListComponent, 'Configuration|Embedded Assets')
|
||||||
|
descElem = descList[0]
|
||||||
|
descList.append(descElem)
|
||||||
|
descList.append(descElem)
|
||||||
|
descList.append(descElem)
|
||||||
|
|
||||||
|
self.test_success = set_component_property(descListComponent, 'Configuration|Embedded Assets', descList) and self.test_success
|
||||||
|
print('Set EditorDescriptorListComponent Embedded Assets as List')
|
||||||
|
self.test_success = set_component_property(descListComponent, 'Configuration|Embedded Assets|[0]|Instance|Mesh Asset', primitiveCubeId) and self.test_success
|
||||||
|
print('Set EditorDescriptorListComponent Embedded Assets 0 Descriptor Mesh Asset ID')
|
||||||
|
self.test_success = set_component_property(descListComponent, 'Configuration|Embedded Assets|[1]|Instance|Mesh Asset', primitiveSphereId) and self.test_success
|
||||||
|
print('Set EditorDescriptorListComponent Embedded Assets 1 Descriptor Mesh Asset ID')
|
||||||
|
self.test_success = set_component_property(descListComponent, 'Configuration|Embedded Assets|[2]|Instance|Mesh Asset', primitiveCapsuleId) and self.test_success
|
||||||
|
print('Set EditorDescriptorListComponent Embedded Assets 2 Descriptor Mesh Asset ID')
|
||||||
|
self.test_success = set_component_property(descListComponent, 'Configuration|Embedded Assets|[3]|Instance|Mesh Asset', primitivePlaneId) and self.test_success
|
||||||
|
print('Set EditorDescriptorListComponent Embedded Assets 3 Descriptor Mesh Asset ID')
|
||||||
|
|
||||||
|
test = TestComponentUpdateListProperty()
|
||||||
|
test.run()
|
||||||
@ -0,0 +1,262 @@
|
|||||||
|
"""
|
||||||
|
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.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
C13751579: Asset Picker UI/UX
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from PySide2 import QtWidgets, QtTest, QtCore
|
||||||
|
from PySide2.QtCore import Qt
|
||||||
|
|
||||||
|
import azlmbr.asset as asset
|
||||||
|
import azlmbr.bus as bus
|
||||||
|
import azlmbr.legacy.general as general
|
||||||
|
import azlmbr.paths
|
||||||
|
import azlmbr.math as math
|
||||||
|
|
||||||
|
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||||
|
import automatedtesting_shared.hydra_editor_utils as hydra
|
||||||
|
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||||
|
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||||
|
|
||||||
|
|
||||||
|
class AssetPickerUIUXTest(EditorTestHelper):
|
||||||
|
def __init__(self):
|
||||||
|
EditorTestHelper.__init__(self, log_prefix="AssetPicker_UI_UX", args=["level"])
|
||||||
|
|
||||||
|
@pyside_utils.wrap_async
|
||||||
|
async def run_test(self):
|
||||||
|
"""
|
||||||
|
Summary:
|
||||||
|
Verify the functionality of Asset Picker and UI/UX properties
|
||||||
|
|
||||||
|
Expected Behavior:
|
||||||
|
The asset picker opens and is labeled appropriately ("Pick Model Asset" in this instance).
|
||||||
|
The Asset Picker window can be resized and moved around the screen.
|
||||||
|
The file tree expands/retracts appropriately and a scroll bar is present when the menus extend
|
||||||
|
beyond the length of the window.
|
||||||
|
The assets are limited to a valid type for the field selected (mesh assets in this instance)
|
||||||
|
The asset picker is closed and the selected asset is assigned to the mesh component.
|
||||||
|
|
||||||
|
Test Steps:
|
||||||
|
1) Open a new level
|
||||||
|
2) Create entity and add Mesh component
|
||||||
|
3) Access Entity Inspector
|
||||||
|
4) Click Asset Picker (Mesh Asset)
|
||||||
|
a) Collapse all the files initially and verify if scroll bar is not visible
|
||||||
|
b) Expand/Verify Top folder of file path
|
||||||
|
c) Expand/Verify Nested folder of file path
|
||||||
|
d) Verify if the ScrollBar appears after expanding folders
|
||||||
|
e) Collapse Nested and Top Level folders and verify if collapsed
|
||||||
|
f) Verify if the correct files are appearing in the Asset Picker
|
||||||
|
g) Move the widget and verify position
|
||||||
|
h) Resize the widget
|
||||||
|
g) Assign Mesh asset
|
||||||
|
5) Verify if Mesh Asset is assigned via both OK/Enter options
|
||||||
|
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.file_path = ["AutomatedTesting", "Assets", "Objects", "Foliage"]
|
||||||
|
self.incorrect_file_found = False
|
||||||
|
self.mesh_asset = "cedar.azmodel"
|
||||||
|
self.prefix = ""
|
||||||
|
|
||||||
|
def is_asset_assigned(component, interaction_option):
|
||||||
|
path = os.path.join("assets", "objects", "foliage", "cedar.azmodel")
|
||||||
|
expected_asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, 'GetAssetIdByPath', path, math.Uuid(),
|
||||||
|
False)
|
||||||
|
result = hydra.get_component_property_value(component, "Controller|Configuration|Mesh Asset")
|
||||||
|
expected_asset_str = expected_asset_id.invoke("ToString")
|
||||||
|
result_str = result.invoke("ToString")
|
||||||
|
print(f"Asset assigned for {interaction_option} option: {expected_asset_str == result_str}")
|
||||||
|
return expected_asset_str == result_str
|
||||||
|
|
||||||
|
def move_and_resize_widget(widget):
|
||||||
|
# Move the widget and verify position
|
||||||
|
initial_position = widget.pos()
|
||||||
|
x, y = initial_position.x() + 5, initial_position.y() + 5
|
||||||
|
widget.move(x, y)
|
||||||
|
curr_position = widget.pos()
|
||||||
|
move_success = curr_position.x() == x and curr_position.y() == y
|
||||||
|
self.test_success = move_success and self.test_success
|
||||||
|
self.log(f"Widget Move Test: {move_success}")
|
||||||
|
|
||||||
|
# Resize the widget and verify size
|
||||||
|
width, height = (
|
||||||
|
widget.geometry().width() + 10,
|
||||||
|
widget.geometry().height() + 10,
|
||||||
|
)
|
||||||
|
widget.resize(width, height)
|
||||||
|
resize_success = widget.geometry().width() == width and widget.geometry().height() == height
|
||||||
|
self.test_success = resize_success and self.test_success
|
||||||
|
self.log(f"Widget Resize Test: {resize_success}")
|
||||||
|
|
||||||
|
def verify_files_appeared(model, allowed_asset_extensions, parent_index=QtCore.QModelIndex()):
|
||||||
|
indices = [parent_index]
|
||||||
|
while len(indices) > 0:
|
||||||
|
parent_index = indices.pop(0)
|
||||||
|
for row in range(model.rowCount(parent_index)):
|
||||||
|
cur_index = model.index(row, 0, parent_index)
|
||||||
|
cur_data = cur_index.data(Qt.DisplayRole)
|
||||||
|
if (
|
||||||
|
"." in cur_data
|
||||||
|
and (cur_data.lower().split(".")[-1] not in allowed_asset_extensions)
|
||||||
|
and not cur_data[-1] == ")"
|
||||||
|
):
|
||||||
|
print(f"Incorrect file found: {cur_data}")
|
||||||
|
self.incorrect_file_found = True
|
||||||
|
indices = list()
|
||||||
|
break
|
||||||
|
indices.append(cur_index)
|
||||||
|
self.test_success = not self.incorrect_file_found and self.test_success
|
||||||
|
|
||||||
|
def print_message_prefix(message):
|
||||||
|
print(f"{self.prefix}: {message}")
|
||||||
|
|
||||||
|
async def asset_picker(prefix, allowed_asset_extensions, asset, interaction_option):
|
||||||
|
active_modal_widget = await pyside_utils.wait_for_modal_widget()
|
||||||
|
if active_modal_widget and self.prefix == "":
|
||||||
|
self.prefix = prefix
|
||||||
|
dialog = active_modal_widget.findChildren(QtWidgets.QDialog, "AssetPickerDialogClass")[0]
|
||||||
|
print_message_prefix(f"Asset Picker title for Mesh: {dialog.windowTitle()}")
|
||||||
|
tree = dialog.findChildren(QtWidgets.QTreeView, "m_assetBrowserTreeViewWidget")[0]
|
||||||
|
scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer")
|
||||||
|
scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar)
|
||||||
|
|
||||||
|
# a) Collapse all the files initially and verify if scroll bar is not visible
|
||||||
|
tree.collapseAll()
|
||||||
|
await pyside_utils.wait_for_condition(lambda: not scroll_bar.isVisible(), 0.5)
|
||||||
|
print_message_prefix(
|
||||||
|
f"Scroll Bar is not visible before expanding the tree: {not scroll_bar.isVisible()}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Get Model Index of the file paths
|
||||||
|
model_index_1 = pyside_utils.find_child_by_pattern(tree, self.file_path[0])
|
||||||
|
print(model_index_1.model())
|
||||||
|
model_index_2 = pyside_utils.find_child_by_pattern(model_index_1, self.file_path[1])
|
||||||
|
|
||||||
|
# b) Expand/Verify Top folder of file path
|
||||||
|
print_message_prefix(f"Top level folder initially collapsed: {not tree.isExpanded(model_index_1)}")
|
||||||
|
tree.expand(model_index_1)
|
||||||
|
print_message_prefix(f"Top level folder expanded: {tree.isExpanded(model_index_1)}")
|
||||||
|
|
||||||
|
# c) Expand/Verify Nested folder of file path
|
||||||
|
print_message_prefix(f"Nested folder initially collapsed: {not tree.isExpanded(model_index_2)}")
|
||||||
|
tree.expand(model_index_2)
|
||||||
|
print_message_prefix(f"Nested folder expanded: {tree.isExpanded(model_index_2)}")
|
||||||
|
|
||||||
|
# d) Verify if the ScrollBar appears after expanding folders
|
||||||
|
tree.expandAll()
|
||||||
|
await pyside_utils.wait_for_condition(lambda: scroll_bar.isVisible(), 0.5)
|
||||||
|
print_message_prefix(f"Scroll Bar appeared after expanding tree: {scroll_bar.isVisible()}")
|
||||||
|
|
||||||
|
# e) Collapse Nested and Top Level folders and verify if collapsed
|
||||||
|
tree.collapse(model_index_2)
|
||||||
|
print_message_prefix(f"Nested folder collapsed: {not tree.isExpanded(model_index_2)}")
|
||||||
|
tree.collapse(model_index_1)
|
||||||
|
print_message_prefix(f"Top level folder collapsed: {not tree.isExpanded(model_index_1)}")
|
||||||
|
|
||||||
|
# f) Verify if the correct files are appearing in the Asset Picker
|
||||||
|
verify_files_appeared(tree.model(), allowed_asset_extensions)
|
||||||
|
print_message_prefix(f"Expected Assets populated in the file picker: {not self.incorrect_file_found}")
|
||||||
|
|
||||||
|
# While we are here we can also check if we can resize and move the widget
|
||||||
|
move_and_resize_widget(active_modal_widget)
|
||||||
|
|
||||||
|
# g) Assign asset
|
||||||
|
tree.collapseAll()
|
||||||
|
await pyside_utils.wait_for_condition(
|
||||||
|
lambda: len(dialog.findChildren(QtWidgets.QFrame, "m_searchWidget")) > 0, 0.5)
|
||||||
|
search_widget = dialog.findChildren(QtWidgets.QFrame, "m_searchWidget")[0]
|
||||||
|
search_line_edit = search_widget.findChildren(QtWidgets.QLineEdit, "textSearch")[0]
|
||||||
|
search_line_edit.setText(asset)
|
||||||
|
tree.expandAll()
|
||||||
|
asset_model_index = pyside_utils.find_child_by_pattern(tree, asset)
|
||||||
|
await pyside_utils.wait_for_condition(lambda: asset_model_index.isValid(), 2.0)
|
||||||
|
tree.expand(asset_model_index)
|
||||||
|
tree.setCurrentIndex(asset_model_index)
|
||||||
|
if interaction_option == "ok":
|
||||||
|
button_box = dialog.findChild(QtWidgets.QDialogButtonBox, "m_buttonBox")
|
||||||
|
ok_button = button_box.button(QtWidgets.QDialogButtonBox.Ok)
|
||||||
|
await pyside_utils.click_button_async(ok_button)
|
||||||
|
elif interaction_option == "enter":
|
||||||
|
QtTest.QTest.keyClick(tree, Qt.Key_Enter, Qt.NoModifier)
|
||||||
|
self.prefix = ""
|
||||||
|
|
||||||
|
# 1) Open a new level
|
||||||
|
self.test_success = self.create_level(
|
||||||
|
self.args["level"],
|
||||||
|
heightmap_resolution=1024,
|
||||||
|
heightmap_meters_per_pixel=1,
|
||||||
|
terrain_texture_resolution=4096,
|
||||||
|
use_terrain=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
# 2) Create entity and add Mesh component
|
||||||
|
entity_position = math.Vector3(125.0, 136.0, 32.0)
|
||||||
|
entity = hydra.Entity("TestEntity")
|
||||||
|
entity.create_entity(entity_position, ["Mesh"])
|
||||||
|
|
||||||
|
# 3) Access Entity Inspector
|
||||||
|
editor_window = pyside_utils.get_editor_main_window()
|
||||||
|
entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector")
|
||||||
|
component_list_widget = entity_inspector.findChild(QtWidgets.QWidget, "m_componentListContents")
|
||||||
|
|
||||||
|
# 4) Click on Asset Picker (Mesh Asset)
|
||||||
|
general.select_object("TestEntity")
|
||||||
|
general.idle_wait(0.5)
|
||||||
|
mesh_asset = component_list_widget.findChildren(QtWidgets.QFrame, "Mesh Asset")[0]
|
||||||
|
attached_button = mesh_asset.findChildren(QtWidgets.QPushButton, "attached-button")[0]
|
||||||
|
|
||||||
|
# Assign Mesh Asset via OK button
|
||||||
|
pyside_utils.click_button_async(attached_button)
|
||||||
|
await asset_picker("Mesh Asset", ["azmodel", "fbx"], "cedar (ModelAsset)", "ok")
|
||||||
|
|
||||||
|
# 5) Verify if Mesh Asset is assigned
|
||||||
|
try:
|
||||||
|
mesh_success = await pyside_utils.wait_for_condition(lambda: is_asset_assigned(entity.components[0],
|
||||||
|
"ok"))
|
||||||
|
except pyside_utils.EventLoopTimeoutException as err:
|
||||||
|
print(err)
|
||||||
|
mesh_success = False
|
||||||
|
self.test_success = mesh_success and self.test_success
|
||||||
|
|
||||||
|
# Clear Mesh Asset
|
||||||
|
hydra.get_set_test(entity, 0, "Controller|Configuration|Mesh Asset", None)
|
||||||
|
general.select_object("TestEntity")
|
||||||
|
general.idle_wait(0.5)
|
||||||
|
mesh_asset = component_list_widget.findChildren(QtWidgets.QFrame, "Mesh Asset")[0]
|
||||||
|
attached_button = mesh_asset.findChildren(QtWidgets.QPushButton, "attached-button")[0]
|
||||||
|
|
||||||
|
# Assign Mesh Asset via Enter
|
||||||
|
pyside_utils.click_button_async(attached_button)
|
||||||
|
await asset_picker("Mesh Asset", ["azmodel", "fbx"], "cedar (ModelAsset)", "enter")
|
||||||
|
|
||||||
|
# 5) Verify if Mesh Asset is assigned
|
||||||
|
try:
|
||||||
|
mesh_success = await pyside_utils.wait_for_condition(lambda: is_asset_assigned(entity.components[0],
|
||||||
|
"enter"))
|
||||||
|
except pyside_utils.EventLoopTimeoutException as err:
|
||||||
|
print(err)
|
||||||
|
mesh_success = False
|
||||||
|
self.test_success = mesh_success and self.test_success
|
||||||
|
|
||||||
|
|
||||||
|
test = AssetPickerUIUXTest()
|
||||||
|
test.run()
|
||||||
@ -0,0 +1,142 @@
|
|||||||
|
"""
|
||||||
|
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.
|
||||||
|
|
||||||
|
C6376081: Basic Function: Docked/Undocked Tools
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from PySide2 import QtWidgets, QtTest, QtCore
|
||||||
|
|
||||||
|
import azlmbr.legacy.general as general
|
||||||
|
import azlmbr.bus as bus
|
||||||
|
import azlmbr.editor as editor
|
||||||
|
import azlmbr.entity as entity
|
||||||
|
import azlmbr.paths
|
||||||
|
|
||||||
|
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||||
|
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||||
|
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||||
|
|
||||||
|
|
||||||
|
class TestDockingBasicDockedTools(EditorTestHelper):
|
||||||
|
def __init__(self):
|
||||||
|
EditorTestHelper.__init__(self, log_prefix="Docking_BasicDockedTools", args=["level"])
|
||||||
|
|
||||||
|
@pyside_utils.wrap_async
|
||||||
|
async def run_test(self):
|
||||||
|
"""
|
||||||
|
Summary:
|
||||||
|
Test that tools still work as expected when docked together.
|
||||||
|
|
||||||
|
Expected Behavior:
|
||||||
|
Multiple tools can be docked together.
|
||||||
|
Tools function while docked together and the main editor responds appropriately.
|
||||||
|
|
||||||
|
Test Steps:
|
||||||
|
1) Open the tools and dock them together in a floating tabbed widget.
|
||||||
|
2) Perform actions in the docked tools to verify they still work as expected.
|
||||||
|
2.1) Select the Entity Outliner in the floating window.
|
||||||
|
2.2) Select an Entity in the Entity Outliner.
|
||||||
|
2.3) Select the Entity Inspector in the floating window.
|
||||||
|
2.4) Change the name of the selected Entity via the Entity Inspector.
|
||||||
|
2.5) Select the Console inside the floating window.
|
||||||
|
2.6) Send a console command.
|
||||||
|
2.7) Check the Editor to verify all changes were made.
|
||||||
|
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Create a level since we are going to be dealing with an Entity.
|
||||||
|
self.create_level(
|
||||||
|
self.args["level"],
|
||||||
|
heightmap_resolution=1024,
|
||||||
|
heightmap_meters_per_pixel=1,
|
||||||
|
terrain_texture_resolution=4096,
|
||||||
|
use_terrain=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
# Make sure the Entity Outliner, Entity Inspector and Console tools are open
|
||||||
|
general.open_pane("Entity Outliner (PREVIEW)")
|
||||||
|
general.open_pane("Entity Inspector")
|
||||||
|
general.open_pane("Console")
|
||||||
|
|
||||||
|
# Create an Entity to test with
|
||||||
|
entity_original_name = 'MyTestEntity'
|
||||||
|
entity_id = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId())
|
||||||
|
editor.EditorEntityAPIBus(bus.Event, 'SetName', entity_id, entity_original_name)
|
||||||
|
|
||||||
|
editor_window = pyside_utils.get_editor_main_window()
|
||||||
|
entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)")
|
||||||
|
|
||||||
|
# 1) Open the tools and dock them together in a floating tabbed widget.
|
||||||
|
# We drag/drop it over the viewport since it doesn't allow docking, so this will undock it
|
||||||
|
render_overlay = editor_window.findChild(QtWidgets.QWidget, "renderOverlay")
|
||||||
|
pyside_utils.drag_and_drop(entity_outliner, render_overlay)
|
||||||
|
|
||||||
|
# We need to grab a new reference to the Entity Outliner QDockWidget because when it gets moved
|
||||||
|
# to the floating window, its parent changes so the wrapped intance we had becomes invalid
|
||||||
|
entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)")
|
||||||
|
|
||||||
|
# Dock the Entity Inspector tabbed with the floating Entity Outliner
|
||||||
|
entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector")
|
||||||
|
pyside_utils.drag_and_drop(entity_inspector, entity_outliner)
|
||||||
|
|
||||||
|
# We need to grab a new reference to the Entity Inspector QDockWidget because when it gets moved
|
||||||
|
# to the floating window, its parent changes so the wrapped intance we had becomes invalid
|
||||||
|
entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector")
|
||||||
|
|
||||||
|
# Dock the Console tabbed with the floating Entity Inspector
|
||||||
|
console = editor_window.findChild(QtWidgets.QDockWidget, "Console")
|
||||||
|
pyside_utils.drag_and_drop(console, entity_inspector)
|
||||||
|
|
||||||
|
# Check to ensure all the tools are parented to the same QStackedWidget
|
||||||
|
def check_all_panes_tabbed():
|
||||||
|
entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector")
|
||||||
|
entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)")
|
||||||
|
console = editor_window.findChild(QtWidgets.QDockWidget, "Console")
|
||||||
|
entity_inspector_parent = entity_inspector.parentWidget()
|
||||||
|
entity_outliner_parent = entity_outliner.parentWidget()
|
||||||
|
console_parent = console.parentWidget()
|
||||||
|
print(f"Entity Inspector parent = {entity_inspector_parent}, Entity Outliner parent = {entity_outliner_parent}, Console parent = {console_parent}")
|
||||||
|
return isinstance(entity_inspector_parent, QtWidgets.QStackedWidget) and (entity_inspector_parent == entity_outliner_parent) and (entity_outliner_parent == console_parent)
|
||||||
|
|
||||||
|
success = await pyside_utils.wait_for(check_all_panes_tabbed, timeout=3.0)
|
||||||
|
if success:
|
||||||
|
print("The tools are all docked together in a tabbed widget")
|
||||||
|
|
||||||
|
# 2.1,2) Select an Entity in the Entity Outliner.
|
||||||
|
entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector")
|
||||||
|
entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)")
|
||||||
|
console = editor_window.findChild(QtWidgets.QDockWidget, "Console")
|
||||||
|
object_tree = entity_outliner.findChild(QtWidgets.QTreeView, "m_objectTree")
|
||||||
|
test_entity_index = pyside_utils.find_child_by_pattern(object_tree, entity_original_name)
|
||||||
|
object_tree.clearSelection()
|
||||||
|
object_tree.setCurrentIndex(test_entity_index)
|
||||||
|
if object_tree.currentIndex():
|
||||||
|
print("Entity Outliner works when docked, can select an Entity")
|
||||||
|
|
||||||
|
# 2.3,4) Change the name of the selected Entity via the Entity Inspector.
|
||||||
|
entity_inspector_name_field = entity_inspector.findChild(QtWidgets.QLineEdit, "m_entityNameEditor")
|
||||||
|
expected_new_name = "DifferentName"
|
||||||
|
entity_inspector_name_field.setText(expected_new_name)
|
||||||
|
QtTest.QTest.keyClick(entity_inspector_name_field, QtCore.Qt.Key_Enter)
|
||||||
|
entity_new_name = editor.EditorEntityInfoRequestBus(bus.Event, "GetName", entity_id)
|
||||||
|
if entity_new_name == expected_new_name:
|
||||||
|
print(f"Entity Inspector works when docked, Entity name changed to {entity_new_name}")
|
||||||
|
|
||||||
|
# 2.5,6) Send a console command.
|
||||||
|
console_line_edit = console.findChild(QtWidgets.QLineEdit, "lineEdit")
|
||||||
|
console_line_edit.setText("Hello, world!")
|
||||||
|
QtTest.QTest.keyClick(console_line_edit, QtCore.Qt.Key_Enter)
|
||||||
|
|
||||||
|
|
||||||
|
test = TestDockingBasicDockedTools()
|
||||||
|
test.run()
|
||||||
@ -0,0 +1,120 @@
|
|||||||
|
"""
|
||||||
|
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.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
C24064529: Base Edit Menu Options
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import azlmbr.paths
|
||||||
|
|
||||||
|
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||||
|
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||||
|
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||||
|
|
||||||
|
|
||||||
|
class TestEditMenuOptions(EditorTestHelper):
|
||||||
|
def __init__(self):
|
||||||
|
EditorTestHelper.__init__(self, log_prefix="Menus_EditMenuOptions", args=["level"])
|
||||||
|
|
||||||
|
def run_test(self):
|
||||||
|
"""
|
||||||
|
Summary:
|
||||||
|
Interact with Edit Menu options and verify if all the options are working.
|
||||||
|
|
||||||
|
Expected Behavior:
|
||||||
|
The Edit menu functions normally.
|
||||||
|
|
||||||
|
Test Steps:
|
||||||
|
1) Create a temp level
|
||||||
|
2) Interact with Edit Menu options
|
||||||
|
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
edit_menu_options = [
|
||||||
|
("Undo",),
|
||||||
|
("Redo",),
|
||||||
|
("Duplicate",),
|
||||||
|
("Delete",),
|
||||||
|
("Select All",),
|
||||||
|
("Invert Selection",),
|
||||||
|
("Toggle Pivot Location",),
|
||||||
|
("Reset Entity Transform",),
|
||||||
|
("Reset Manipulator",),
|
||||||
|
("Reset Transform (Local)",),
|
||||||
|
("Reset Transform (World)",),
|
||||||
|
("Hide Selection",),
|
||||||
|
("Show All",),
|
||||||
|
("Modify", "Snap", "Snap angle"),
|
||||||
|
("Modify", "Transform Mode", "Move"),
|
||||||
|
("Modify", "Transform Mode", "Rotate"),
|
||||||
|
("Modify", "Transform Mode", "Scale"),
|
||||||
|
("Lock Selection",),
|
||||||
|
("Unlock All Entities",),
|
||||||
|
("Editor Settings", "Global Preferences"),
|
||||||
|
("Editor Settings", "Graphics Settings"),
|
||||||
|
("Editor Settings", "Editor Settings Manager"),
|
||||||
|
("Editor Settings", "Graphics Performance", "PC", "Very High"),
|
||||||
|
("Editor Settings", "Graphics Performance", "PC", "High"),
|
||||||
|
("Editor Settings", "Graphics Performance", "PC", "Medium"),
|
||||||
|
("Editor Settings", "Graphics Performance", "PC", "Low"),
|
||||||
|
("Editor Settings", "Graphics Performance", "OSX Metal", "Very High"),
|
||||||
|
("Editor Settings", "Graphics Performance", "OSX Metal", "High"),
|
||||||
|
("Editor Settings", "Graphics Performance", "OSX Metal", "Medium"),
|
||||||
|
("Editor Settings", "Graphics Performance", "OSX Metal", "Low"),
|
||||||
|
("Editor Settings", "Graphics Performance", "Android", "Very High"),
|
||||||
|
("Editor Settings", "Graphics Performance", "Android", "High"),
|
||||||
|
("Editor Settings", "Graphics Performance", "Android", "Medium"),
|
||||||
|
("Editor Settings", "Graphics Performance", "Android", "Low"),
|
||||||
|
("Editor Settings", "Graphics Performance", "iOS", "Very High"),
|
||||||
|
("Editor Settings", "Graphics Performance", "iOS", "High"),
|
||||||
|
("Editor Settings", "Graphics Performance", "iOS", "Medium"),
|
||||||
|
("Editor Settings", "Graphics Performance", "iOS", "Low"),
|
||||||
|
("Editor Settings", "Keyboard Customization", "Customize Keyboard"),
|
||||||
|
("Editor Settings", "Keyboard Customization", "Export Keyboard Settings"),
|
||||||
|
("Editor Settings", "Keyboard Customization", "Import Keyboard Settings"),
|
||||||
|
]
|
||||||
|
|
||||||
|
# 1) Create and open the temp level
|
||||||
|
self.test_success = self.create_level(
|
||||||
|
self.args["level"],
|
||||||
|
heightmap_resolution=1024,
|
||||||
|
heightmap_meters_per_pixel=1,
|
||||||
|
terrain_texture_resolution=4096,
|
||||||
|
use_terrain=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
def on_action_triggered(action_name):
|
||||||
|
print(f"{action_name} Action triggered")
|
||||||
|
|
||||||
|
# 2) Interact with Edit Menu options
|
||||||
|
try:
|
||||||
|
editor_window = pyside_utils.get_editor_main_window()
|
||||||
|
for option in edit_menu_options:
|
||||||
|
action = pyside_utils.get_action_for_menu_path(editor_window, "Edit", *option)
|
||||||
|
trig_func = lambda: on_action_triggered(action.iconText())
|
||||||
|
action.triggered.connect(trig_func)
|
||||||
|
action.trigger()
|
||||||
|
action.triggered.disconnect(trig_func)
|
||||||
|
except Exception as e:
|
||||||
|
self.test_success = False
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
|
||||||
|
test = TestEditMenuOptions()
|
||||||
|
test.run()
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
"""
|
||||||
|
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.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
C24064528: The File menu options function normally
|
||||||
|
C16780778: The File menu options function normally-New view interaction Model enabled
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import azlmbr.paths
|
||||||
|
|
||||||
|
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||||
|
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||||
|
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||||
|
|
||||||
|
|
||||||
|
class TestFileMenuOptions(EditorTestHelper):
|
||||||
|
def __init__(self):
|
||||||
|
EditorTestHelper.__init__(self, log_prefix="file_menu_options: ", args=["level"])
|
||||||
|
|
||||||
|
def run_test(self):
|
||||||
|
"""
|
||||||
|
Summary:
|
||||||
|
Interact with File Menu options and verify if all the options are working.
|
||||||
|
|
||||||
|
Expected Behavior:
|
||||||
|
The File menu functions normally.
|
||||||
|
|
||||||
|
Test Steps:
|
||||||
|
1) Open level
|
||||||
|
2) Interact with File Menu options
|
||||||
|
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
file_menu_options = [
|
||||||
|
("New Level",),
|
||||||
|
("Open Level",),
|
||||||
|
("Import",),
|
||||||
|
("Save",),
|
||||||
|
("Save As",),
|
||||||
|
("Save Level Statistics",),
|
||||||
|
("Project Settings", "Project Settings Tool"),
|
||||||
|
("Show Log File",),
|
||||||
|
("Resave All Slices",),
|
||||||
|
("Exit",),
|
||||||
|
]
|
||||||
|
|
||||||
|
# 1) Open level
|
||||||
|
self.test_success = self.create_level(
|
||||||
|
self.args["level"],
|
||||||
|
heightmap_resolution=1024,
|
||||||
|
heightmap_meters_per_pixel=1,
|
||||||
|
terrain_texture_resolution=4096,
|
||||||
|
use_terrain=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
def on_action_triggered(action_name):
|
||||||
|
print(f"{action_name} Action triggered")
|
||||||
|
|
||||||
|
# 2) Interact with File Menu options
|
||||||
|
try:
|
||||||
|
editor_window = pyside_utils.get_editor_main_window()
|
||||||
|
for option in file_menu_options:
|
||||||
|
action = pyside_utils.get_action_for_menu_path(editor_window, "File", *option)
|
||||||
|
trig_func = lambda: on_action_triggered(action.iconText())
|
||||||
|
action.triggered.connect(trig_func)
|
||||||
|
action.trigger()
|
||||||
|
action.triggered.disconnect(trig_func)
|
||||||
|
except Exception as e:
|
||||||
|
self.test_success = False
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
|
||||||
|
test = TestFileMenuOptions()
|
||||||
|
test.run()
|
||||||
@ -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.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
C24064534: The View menu options function normally
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import azlmbr.paths
|
||||||
|
|
||||||
|
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||||
|
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||||
|
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||||
|
|
||||||
|
|
||||||
|
class TestViewMenuOptions(EditorTestHelper):
|
||||||
|
def __init__(self):
|
||||||
|
EditorTestHelper.__init__(self, log_prefix="Menus_EditMenuOptions", args=["level"])
|
||||||
|
|
||||||
|
def run_test(self):
|
||||||
|
"""
|
||||||
|
Summary:
|
||||||
|
Interact with View Menu options and verify if all the options are working.
|
||||||
|
|
||||||
|
Expected Behavior:
|
||||||
|
The View menu functions normally.
|
||||||
|
|
||||||
|
Test Steps:
|
||||||
|
1) Create a temp level
|
||||||
|
2) Interact with View Menu options
|
||||||
|
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
view_menu_options = [
|
||||||
|
("Center on Selection",),
|
||||||
|
("Show Quick Access Bar",),
|
||||||
|
("Viewport", "Wireframe"),
|
||||||
|
("Viewport", "Grid Settings"),
|
||||||
|
("Viewport", "Go to Position"),
|
||||||
|
("Viewport", "Center on Selection"),
|
||||||
|
("Viewport", "Go to Location"),
|
||||||
|
("Viewport", "Remember Location"),
|
||||||
|
("Viewport", "Change Move Speed"),
|
||||||
|
("Viewport", "Switch Camera"),
|
||||||
|
("Viewport", "Show/Hide Helpers"),
|
||||||
|
("Refresh Style",),
|
||||||
|
]
|
||||||
|
|
||||||
|
# 1) Create and open the temp level
|
||||||
|
self.test_success = self.create_level(
|
||||||
|
self.args["level"],
|
||||||
|
heightmap_resolution=1024,
|
||||||
|
heightmap_meters_per_pixel=1,
|
||||||
|
terrain_texture_resolution=4096,
|
||||||
|
use_terrain=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
def on_action_triggered(action_name):
|
||||||
|
print(f"{action_name} Action triggered")
|
||||||
|
|
||||||
|
# 2) Interact with View Menu options
|
||||||
|
try:
|
||||||
|
editor_window = pyside_utils.get_editor_main_window()
|
||||||
|
for option in view_menu_options:
|
||||||
|
action = pyside_utils.get_action_for_menu_path(editor_window, "View", *option)
|
||||||
|
trig_func = lambda: on_action_triggered(action.iconText())
|
||||||
|
action.triggered.connect(trig_func)
|
||||||
|
action.trigger()
|
||||||
|
action.triggered.disconnect(trig_func)
|
||||||
|
except Exception as e:
|
||||||
|
self.test_success = False
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
|
||||||
|
test = TestViewMenuOptions()
|
||||||
|
test.run()
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
"""
|
||||||
|
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||||
|
its licensors.
|
||||||
|
|
||||||
|
For complete copyright and license terms please see the LICENSE at the root of this
|
||||||
|
distribution (the "License"). All use of this software is governed by the License,
|
||||||
|
or, if provided, by the license below or the license accompanying this file. Do not
|
||||||
|
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import pytest
|
||||||
|
import winreg
|
||||||
|
import automatedtesting_shared.registry_utils as reg
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
layout = {
|
||||||
|
'path': r'Software\Amazon\Lumberyard\Editor\fancyWindowLayouts',
|
||||||
|
'value': 'last'
|
||||||
|
}
|
||||||
|
restore_camera = {
|
||||||
|
'new': 16384,
|
||||||
|
'path': r'Software\Amazon\Lumberyard\Editor\AutoHide',
|
||||||
|
'value': 'ViewportCameraRestoreOnExitGameMode'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def set_editor_registry_defaults(request):
|
||||||
|
# Records editor settings at start, sets to default, then returns to original at teardown.
|
||||||
|
logger.debug('Executing an Editor settings fixture. If not executing an Editor test, this may be in error.')
|
||||||
|
|
||||||
|
layout['original'] = reg.get_ly_registry_value(layout['path'], layout['value'])
|
||||||
|
restore_camera['original'] = reg.get_ly_registry_value(restore_camera['path'], restore_camera['value'])
|
||||||
|
|
||||||
|
# Deleting current layout value to restore defaults
|
||||||
|
reg.delete_ly_registry_value(layout['path'], layout['value'])
|
||||||
|
|
||||||
|
# Setting restore camera dialog to not display
|
||||||
|
reg.set_ly_registry_value(restore_camera['path'], restore_camera['value'], restore_camera['new'])
|
||||||
|
|
||||||
|
# Revert settings to original values
|
||||||
|
def teardown():
|
||||||
|
reg.set_ly_registry_value(layout['path'], layout['value'], layout['original'], value_type=winreg.REG_BINARY)
|
||||||
|
reg.set_ly_registry_value(restore_camera['path'], restore_camera['value'], restore_camera['original'])
|
||||||
|
|
||||||
|
request.addfinalizer(teardown)
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
"""
|
||||||
|
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.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
C13660195: Asset Browser - File Tree Navigation
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import pytest
|
||||||
|
# Bail on the test if ly_test_tools doesn't exist.
|
||||||
|
pytest.importorskip('ly_test_tools')
|
||||||
|
import ly_test_tools.environment.file_system as file_system
|
||||||
|
import automatedtesting_shared.hydra_test_utils as hydra
|
||||||
|
|
||||||
|
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
|
||||||
|
log_monitor_timeout = 180
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('project', ['AutomatedTesting'])
|
||||||
|
@pytest.mark.parametrize('level', ['tmp_level'])
|
||||||
|
@pytest.mark.usefixtures("automatic_process_killer")
|
||||||
|
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||||
|
class TestAssetBrowser(object):
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def setup_teardown(self, request, workspace, project, level):
|
||||||
|
def teardown():
|
||||||
|
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||||
|
|
||||||
|
request.addfinalizer(teardown)
|
||||||
|
|
||||||
|
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||||
|
|
||||||
|
@pytest.mark.test_case_id("C13660195")
|
||||||
|
@pytest.mark.SUITE_periodic
|
||||||
|
def test_AssetBrowser_TreeNavigation(self, request, editor, level, launcher_platform):
|
||||||
|
expected_lines = [
|
||||||
|
"Collapse/Expand tests: True",
|
||||||
|
"Asset visibility test: True",
|
||||||
|
"Scrollbar visibility test: True",
|
||||||
|
"AssetBrowser_TreeNavigation: result=SUCCESS"
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
hydra.launch_and_validate_results(
|
||||||
|
request,
|
||||||
|
test_directory,
|
||||||
|
editor,
|
||||||
|
"AssetBrowser_TreeNavigation.py",
|
||||||
|
expected_lines,
|
||||||
|
run_python="--runpython",
|
||||||
|
cfg_args=[level],
|
||||||
|
timeout=log_monitor_timeout
|
||||||
|
)
|
||||||
|
|
||||||
|
@pytest.mark.test_case_id("C13660194")
|
||||||
|
@pytest.mark.SUITE_periodic
|
||||||
|
def test_AssetBrowser_SearchFiltering(self, request, editor, level, launcher_platform):
|
||||||
|
expected_lines = [
|
||||||
|
"cedar.fbx asset is filtered in Asset Browser",
|
||||||
|
"Animation file type(s) is present in the file tree: True",
|
||||||
|
"FileTag file type(s) and Animation file type(s) is present in the file tree: True",
|
||||||
|
"FileTag file type(s) is present in the file tree after removing Animation filter: True",
|
||||||
|
]
|
||||||
|
|
||||||
|
unexpected_lines = [
|
||||||
|
"Asset Browser opened: False",
|
||||||
|
"Animation file type(s) is present in the file tree: False",
|
||||||
|
"FileTag file type(s) and Animation file type(s) is present in the file tree: False",
|
||||||
|
"FileTag file type(s) is present in the file tree after removing Animation filter: False",
|
||||||
|
]
|
||||||
|
|
||||||
|
hydra.launch_and_validate_results(
|
||||||
|
request,
|
||||||
|
test_directory,
|
||||||
|
editor,
|
||||||
|
"AssetBrowser_SearchFiltering.py",
|
||||||
|
expected_lines,
|
||||||
|
unexpected_lines=unexpected_lines,
|
||||||
|
cfg_args=[level],
|
||||||
|
auto_test_mode=False,
|
||||||
|
run_python="--runpython",
|
||||||
|
timeout=log_monitor_timeout,
|
||||||
|
)
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
"""
|
||||||
|
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.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
C13751579: Asset Picker UI/UX
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import pytest
|
||||||
|
# Bail on the test if ly_test_tools doesn't exist.
|
||||||
|
pytest.importorskip('ly_test_tools')
|
||||||
|
import ly_test_tools.environment.file_system as file_system
|
||||||
|
import automatedtesting_shared.hydra_test_utils as hydra
|
||||||
|
|
||||||
|
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
|
||||||
|
log_monitor_timeout = 90
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('project', ['AutomatedTesting'])
|
||||||
|
@pytest.mark.parametrize('level', ['tmp_level'])
|
||||||
|
@pytest.mark.usefixtures("automatic_process_killer")
|
||||||
|
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||||
|
class TestAssetPicker(object):
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def setup_teardown(self, request, workspace, project, level):
|
||||||
|
def teardown():
|
||||||
|
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||||
|
|
||||||
|
request.addfinalizer(teardown)
|
||||||
|
|
||||||
|
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||||
|
|
||||||
|
@pytest.mark.test_case_id("C13751579", "C1508814")
|
||||||
|
@pytest.mark.SUITE_periodic
|
||||||
|
def test_AssetPicker_UI_UX(self, request, editor, level, launcher_platform):
|
||||||
|
expected_lines = [
|
||||||
|
"TestEntity Entity successfully created",
|
||||||
|
"Mesh component was added to entity",
|
||||||
|
"Entity has a Mesh component",
|
||||||
|
"Mesh Asset: Asset Picker title for Mesh: Pick ModelAsset",
|
||||||
|
"Mesh Asset: Scroll Bar is not visible before expanding the tree: True",
|
||||||
|
"Mesh Asset: Top level folder initially collapsed: True",
|
||||||
|
"Mesh Asset: Top level folder expanded: True",
|
||||||
|
"Mesh Asset: Nested folder initially collapsed: True",
|
||||||
|
"Mesh Asset: Nested folder expanded: True",
|
||||||
|
"Mesh Asset: Scroll Bar appeared after expanding tree: True",
|
||||||
|
"Mesh Asset: Nested folder collapsed: True",
|
||||||
|
"Mesh Asset: Top level folder collapsed: True",
|
||||||
|
"Mesh Asset: Expected Assets populated in the file picker: True",
|
||||||
|
"Widget Move Test: True",
|
||||||
|
"Widget Resize Test: True",
|
||||||
|
"Asset assigned for ok option: True",
|
||||||
|
"Asset assigned for enter option: True",
|
||||||
|
"AssetPicker_UI_UX: result=SUCCESS"
|
||||||
|
]
|
||||||
|
|
||||||
|
hydra.launch_and_validate_results(
|
||||||
|
request,
|
||||||
|
test_directory,
|
||||||
|
editor,
|
||||||
|
"AssetPicker_UI_UX.py",
|
||||||
|
expected_lines,
|
||||||
|
cfg_args=[level],
|
||||||
|
run_python="--runpython",
|
||||||
|
auto_test_mode=False,
|
||||||
|
timeout=log_monitor_timeout,
|
||||||
|
)
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
"""
|
||||||
|
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.
|
||||||
|
|
||||||
|
C6376081: Basic Function: Docked/Undocked Tools
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import pytest
|
||||||
|
# Bail on the test if ly_test_tools doesn't exist.
|
||||||
|
pytest.importorskip('ly_test_tools')
|
||||||
|
import ly_test_tools.environment.file_system as file_system
|
||||||
|
import automatedtesting_shared.hydra_test_utils as hydra
|
||||||
|
|
||||||
|
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
|
||||||
|
log_monitor_timeout = 180
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('project', ['AutomatedTesting'])
|
||||||
|
@pytest.mark.parametrize('level', ['tmp_level'])
|
||||||
|
@pytest.mark.usefixtures("automatic_process_killer")
|
||||||
|
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||||
|
class TestDocking(object):
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def setup_teardown(self, request, workspace, project, level):
|
||||||
|
def teardown():
|
||||||
|
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||||
|
|
||||||
|
request.addfinalizer(teardown)
|
||||||
|
|
||||||
|
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||||
|
|
||||||
|
@pytest.mark.test_case_id("C6376081")
|
||||||
|
@pytest.mark.SUITE_periodic
|
||||||
|
def test_basic_docked_tools(self, request, editor, level, launcher_platform):
|
||||||
|
expected_lines = [
|
||||||
|
"The tools are all docked together in a tabbed widget",
|
||||||
|
"Entity Outliner works when docked, can select an Entity",
|
||||||
|
"Entity Inspector works when docked, Entity name changed to DifferentName",
|
||||||
|
"Hello, world!" # This line verifies the Console is working while docked
|
||||||
|
]
|
||||||
|
|
||||||
|
hydra.launch_and_validate_results(
|
||||||
|
request,
|
||||||
|
test_directory,
|
||||||
|
editor,
|
||||||
|
"Docking_BasicDockedTools.py",
|
||||||
|
expected_lines,
|
||||||
|
cfg_args=[level],
|
||||||
|
timeout=log_monitor_timeout,
|
||||||
|
)
|
||||||
@ -0,0 +1,143 @@
|
|||||||
|
"""
|
||||||
|
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.
|
||||||
|
|
||||||
|
C16780783: Base Edit Menu Options (New Viewport Interaction Model)
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import pytest
|
||||||
|
# Bail on the test if ly_test_tools doesn't exist.
|
||||||
|
pytest.importorskip('ly_test_tools')
|
||||||
|
import ly_test_tools.environment.file_system as file_system
|
||||||
|
import automatedtesting_shared.hydra_test_utils as hydra
|
||||||
|
|
||||||
|
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
|
||||||
|
log_monitor_timeout = 180
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('project', ['AutomatedTesting'])
|
||||||
|
@pytest.mark.parametrize('level', ['tmp_level'])
|
||||||
|
@pytest.mark.usefixtures("automatic_process_killer")
|
||||||
|
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||||
|
class TestMenus(object):
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def setup_teardown(self, request, workspace, project, level):
|
||||||
|
def teardown():
|
||||||
|
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||||
|
|
||||||
|
request.addfinalizer(teardown)
|
||||||
|
|
||||||
|
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||||
|
|
||||||
|
@pytest.mark.test_case_id("C16780783", "C2174438")
|
||||||
|
@pytest.mark.SUITE_periodic
|
||||||
|
def test_Menus_EditMenuOptions_Work(self, request, editor, level, launcher_platform):
|
||||||
|
expected_lines = [
|
||||||
|
"Undo Action triggered",
|
||||||
|
"Redo Action triggered",
|
||||||
|
"Duplicate Action triggered",
|
||||||
|
"Delete Action triggered",
|
||||||
|
"Select All Action triggered",
|
||||||
|
"Invert Selection Action triggered",
|
||||||
|
"Toggle Pivot Location Action triggered",
|
||||||
|
"Reset Entity Transform",
|
||||||
|
"Reset Manipulator",
|
||||||
|
"Reset Transform (Local) Action triggered",
|
||||||
|
"Reset Transform (World) Action triggered",
|
||||||
|
"Hide Selection Action triggered",
|
||||||
|
"Show All Action triggered",
|
||||||
|
"Snap angle Action triggered",
|
||||||
|
"Move Action triggered",
|
||||||
|
"Rotate Action triggered",
|
||||||
|
"Scale Action triggered",
|
||||||
|
"Lock Selection Action triggered",
|
||||||
|
"Unlock All Entities Action triggered",
|
||||||
|
"Global Preferences Action triggered",
|
||||||
|
"Graphics Settings Action triggered",
|
||||||
|
"Editor Settings Manager Action triggered",
|
||||||
|
"Very High Action triggered",
|
||||||
|
"High Action triggered",
|
||||||
|
"Medium Action triggered",
|
||||||
|
"Low Action triggered",
|
||||||
|
"Customize Keyboard Action triggered",
|
||||||
|
"Export Keyboard Settings Action triggered",
|
||||||
|
"Import Keyboard Settings Action triggered",
|
||||||
|
"Menus_EditMenuOptions: result=SUCCESS"
|
||||||
|
]
|
||||||
|
|
||||||
|
hydra.launch_and_validate_results(
|
||||||
|
request,
|
||||||
|
test_directory,
|
||||||
|
editor,
|
||||||
|
"Menus_EditMenuOptions.py",
|
||||||
|
expected_lines,
|
||||||
|
cfg_args=[level],
|
||||||
|
run_python="--runpython",
|
||||||
|
auto_test_mode=True,
|
||||||
|
timeout=log_monitor_timeout,
|
||||||
|
)
|
||||||
|
|
||||||
|
@pytest.mark.test_case_id("C16780807")
|
||||||
|
@pytest.mark.SUITE_periodic
|
||||||
|
def test_Menus_ViewMenuOptions_Work(self, request, editor, level, launcher_platform):
|
||||||
|
expected_lines = [
|
||||||
|
"Center on Selection Action triggered",
|
||||||
|
"Show Quick Access Bar Action triggered",
|
||||||
|
"Wireframe Action triggered",
|
||||||
|
"Grid Settings Action triggered",
|
||||||
|
"Go to Position Action triggered",
|
||||||
|
"Center on Selection Action triggered",
|
||||||
|
"Go to Location Action triggered",
|
||||||
|
"Remember Location Action triggered",
|
||||||
|
"Change Move Speed Action triggered",
|
||||||
|
"Switch Camera Action triggered",
|
||||||
|
"Show/Hide Helpers Action triggered",
|
||||||
|
"Refresh Style Action triggered",
|
||||||
|
]
|
||||||
|
hydra.launch_and_validate_results(
|
||||||
|
request,
|
||||||
|
test_directory,
|
||||||
|
editor,
|
||||||
|
"Menus_ViewMenuOptions.py",
|
||||||
|
expected_lines,
|
||||||
|
cfg_args=[level],
|
||||||
|
auto_test_mode=True,
|
||||||
|
run_python="--runpython",
|
||||||
|
timeout=log_monitor_timeout,
|
||||||
|
)
|
||||||
|
|
||||||
|
@pytest.mark.test_case_id("C16780778")
|
||||||
|
@pytest.mark.SUITE_periodic
|
||||||
|
def test_Menus_FileMenuOptions_Work(self, request, editor, level, launcher_platform):
|
||||||
|
expected_lines = [
|
||||||
|
"New Level Action triggered",
|
||||||
|
"Open Level Action triggered",
|
||||||
|
"Import Action triggered",
|
||||||
|
"Save Action triggered",
|
||||||
|
"Save As Action triggered",
|
||||||
|
"Save Level Statistics Action triggered",
|
||||||
|
"Project Settings Tool Action triggered",
|
||||||
|
"Show Log File Action triggered",
|
||||||
|
"Resave All Slices Action triggered",
|
||||||
|
"Exit Action triggered",
|
||||||
|
]
|
||||||
|
|
||||||
|
hydra.launch_and_validate_results(
|
||||||
|
request,
|
||||||
|
test_directory,
|
||||||
|
editor,
|
||||||
|
"Menus_FileMenuOptions.py",
|
||||||
|
expected_lines,
|
||||||
|
cfg_args=[level],
|
||||||
|
auto_test_mode=True,
|
||||||
|
run_python="--runpython",
|
||||||
|
timeout=log_monitor_timeout,
|
||||||
|
)
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue