Merge remote-tracking branch 'upstream/development' into Atom/santora/UseLibPng
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>monroegm-disable-blank-issue-2
commit
3d3324cc2b
@ -0,0 +1,36 @@
|
||||
---
|
||||
name: Nightly Build Error bug report
|
||||
about: Create a report when the nightly build process fails
|
||||
title: 'Nightly Build Failure'
|
||||
labels: 'needs-triage,needs-sig,kind/bug,kind/nightlybuildfailure'
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Failure type**
|
||||
Build | Asset Processing | Test Tools | Infrastructure | Test
|
||||
|
||||
**To Reproduce Test Failures**
|
||||
- Paste the command line that reproduces the test failure
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Logs**
|
||||
Attach the Jenkins logs that are relevant to the failure
|
||||
|
||||
**Desktop/Device (please complete the following information):**
|
||||
- Device: [e.g. PC, Mac, iPhone, Samsung]
|
||||
- OS: [e.g. Windows, macOS, iOS, Android]
|
||||
- Version [e.g. 10, Bug Sur, Oreo]
|
||||
- CPU [e.g. Intel I9-9900k , Ryzen 5900x, ]
|
||||
- GPU [AMD 6800 XT, NVidia RTX 3090]
|
||||
- Memory [e.g. 16GB]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@ -0,0 +1,9 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
ly_install_directory(DIRECTORIES .)
|
||||
@ -1,6 +0,0 @@
|
||||
e_StatoscopeScreenshotCapturePeriod = 1
|
||||
|
||||
e_StatoscopeDataGroups = Oulm
|
||||
sys_pakLogInvalidFileAccess = 1
|
||||
e_StatoscopeWriteTimeout = 10
|
||||
e_StatoscopeConnectTimeout = 10
|
||||
@ -1,33 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from ActorSplitsAfterDamage import Tests
|
||||
|
||||
def ActorSplitsAfterCapsuleDamage():
|
||||
from ActorSplitsAfterDamage import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def CapsuleDamage(target_id, position0):
|
||||
position1 = azlmbr.object.construct('Vector3', position0.x + 1.0, position0.y, position0.z)
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Capsule Damage", target_id,
|
||||
position0, position1,
|
||||
Constants.DAMAGE_MIN_RADIUS,
|
||||
Constants.DAMAGE_MAX_RADIUS, Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(CapsuleDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(ActorSplitsAfterCapsuleDamage)
|
||||
@ -1,110 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
|
||||
find_moving = ("Moving entity found", "Moving entity not found")
|
||||
find_destructable = ("Destructable entity found", "Destructable entity not found")
|
||||
find_root_actor = ("Root actor of destructable entity found", "Root actor of destructable entity not found")
|
||||
collisions = ("Collision occurred between entities", "Collision did not occur between entities")
|
||||
root_actor_destroyed = ("Root actor destroyed", "Root actor was not destroyed")
|
||||
child_actors_created = ("Child actors created", "Child actors were not created")
|
||||
exit_game_mode = ("Exited game mode", "Couldn't exit game mode")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def ActorSplitsAfterCollision():
|
||||
|
||||
"""
|
||||
Summary:
|
||||
Open a Project that already has 1 rigid sphere entity and 1 destructable entity and verify collision and damage
|
||||
to destructable entity.
|
||||
|
||||
Level Description:
|
||||
Moving Sphere and Destructable entities are created in level with same collision layer and same collision group.
|
||||
Moving Sphere entity is placed above the Destructable entity.
|
||||
|
||||
Expected Behavior:
|
||||
Moving Sphere has to collide with Destructable entity under the effect of gravity. Destructable entity root actor
|
||||
should be destroyed and 2 child actors should be created to replace it.
|
||||
|
||||
Test Steps:
|
||||
1) Open level and Enter game mode
|
||||
2) Retrieve and validate Entities
|
||||
3) Get the entity representing root actor of destructable entity
|
||||
4) Check moving sphere collides with root actor of destructable entity due to gravity
|
||||
5) Check root actor is destroyed
|
||||
6) Check child actors of root actor are created
|
||||
7) Exit game mode
|
||||
8) Close the editor
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
import azlmbr.bus
|
||||
|
||||
from BlastUtils import CollisionHandler
|
||||
from BlastUtils import BlastNotificationHandler
|
||||
|
||||
# Constants
|
||||
TIMEOUT = 2.0
|
||||
|
||||
helper.init_idle()
|
||||
|
||||
# 1) Open level and Enter game mode
|
||||
helper.open_level("Blast", "Blast_ActorSplitsAfterCollision")
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 2) Retrieve and validate Entities
|
||||
moving_id = general.find_game_entity("Sphere_Moving")
|
||||
Report.critical_result(Tests.find_moving, moving_id.IsValid())
|
||||
|
||||
destructable_id = general.find_game_entity("Destructable_Box")
|
||||
Report.critical_result(Tests.find_destructable, destructable_id.IsValid())
|
||||
|
||||
# 3) Get the entity representing root actor of destructable entity
|
||||
destructable_initial_actors = azlmbr.destruction.BlastFamilyComponentRequestBus(azlmbr.bus.Event, "Get Actors Data", destructable_id)
|
||||
Report.critical_result(Tests.find_root_actor, len(destructable_initial_actors) == 1)
|
||||
destructable_initial_actor_id = destructable_initial_actors[0].EntityId
|
||||
|
||||
collision = CollisionHandler(destructable_initial_actor_id, moving_id)
|
||||
family_handler = BlastNotificationHandler(destructable_id)
|
||||
|
||||
# 4) Check moving sphere collides with root actor of destructable entity due to gravity
|
||||
helper.wait_for_condition(lambda: collision.collision_happened, TIMEOUT)
|
||||
Report.result(Tests.collisions, collision.collision_happened)
|
||||
|
||||
# 5) Check root actor is destroyed
|
||||
helper.wait_for_condition(lambda: family_handler.actors_destroyed == 1, TIMEOUT)
|
||||
Report.result(Tests.root_actor_destroyed, family_handler.actors_destroyed == 1)
|
||||
|
||||
# 6) Check child actors of root actor are created
|
||||
helper.wait_for_condition(lambda: family_handler.actors_created == 2, TIMEOUT)
|
||||
Report.result(Tests.child_actors_created, family_handler.actors_created == 2)
|
||||
|
||||
# 7) Exit game mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 8) Close the editor
|
||||
helper.close_editor()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(ActorSplitsAfterCollision)
|
||||
@ -1,93 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
|
||||
find_destructable = ("Destructable entity found", "Destructable entity not found")
|
||||
find_root_actor = ("Root actor of destructable entity found", "Root actor of destructable entity not found")
|
||||
root_actor_destroyed = ("Root actor destroyed", "Root actor was not destroyed")
|
||||
child_actors_created = ("Child actors created", "Child actors were not created")
|
||||
exit_game_mode = ("Exited game mode", "Couldn't exit game mode")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def base_run(damage_func):
|
||||
|
||||
"""
|
||||
Summary:
|
||||
Open a Project that already has 1 destructable entity and verify damage destructs it.
|
||||
|
||||
Level Description:
|
||||
Destructable entity is in a level.
|
||||
|
||||
Expected Behavior:
|
||||
Damage is applied to destructable entity. Destructable entity root actor
|
||||
should be destroyed and 2 child actors should be created to replace it.
|
||||
|
||||
Test Steps:
|
||||
1) Open level and Enter game mode
|
||||
2) Retrieve and validate Entities
|
||||
3) Get the entity representing root actor of destructable entity
|
||||
4) Apply damage to the destructable entity
|
||||
5) Check root actor is destroyed
|
||||
6) Check child actors of root actor are created
|
||||
7) Exit game mode
|
||||
8) Close the editor
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
import azlmbr.bus
|
||||
|
||||
from BlastUtils import BlastNotificationHandler
|
||||
|
||||
# Constants
|
||||
TIMEOUT = 2.0
|
||||
|
||||
helper.init_idle()
|
||||
|
||||
# 1) Open level and Enter game mode
|
||||
helper.open_level("Blast", "Blast_ActorSplitsAfterDamage")
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 2) Retrieve and validate Entities
|
||||
destructable_id = general.find_game_entity("Destructable_Box")
|
||||
Report.critical_result(Tests.find_destructable, destructable_id.IsValid())
|
||||
|
||||
# 3) Get the entity representing root actor of destructable entity
|
||||
destructable_initial_actors = azlmbr.destruction.BlastFamilyComponentRequestBus(azlmbr.bus.Event, "Get Actors Data", destructable_id)
|
||||
Report.critical_result(Tests.find_root_actor, len(destructable_initial_actors) == 1)
|
||||
destructable_initial_actor_id = destructable_initial_actors[0].EntityId
|
||||
initial_actor_position = azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldTranslation", destructable_initial_actor_id)
|
||||
|
||||
# 4) Apply damage to the destructable entity
|
||||
damage_func(destructable_id, initial_actor_position)
|
||||
|
||||
family_handler = BlastNotificationHandler(destructable_id)
|
||||
|
||||
# 5) Check root actor is destroyed
|
||||
helper.wait_for_condition(lambda: family_handler.actors_destroyed == 1, TIMEOUT)
|
||||
Report.result(Tests.root_actor_destroyed, family_handler.actors_destroyed == 1)
|
||||
|
||||
# 6) Check child actors of root actor are created
|
||||
helper.wait_for_condition(lambda: family_handler.actors_created == 2, TIMEOUT)
|
||||
Report.result(Tests.child_actors_created, family_handler.actors_created == 2)
|
||||
|
||||
# 7) Exit game mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 8) Close the editor
|
||||
helper.close_editor()
|
||||
@ -1,31 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from ActorSplitsAfterDamage import Tests
|
||||
|
||||
def ActorSplitsAfterImpactSpreadDamage():
|
||||
from ActorSplitsAfterDamage import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def ImpactSpreadDamage(target_id, position):
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Impact Spread Damage", target_id,
|
||||
position, Constants.DAMAGE_MIN_RADIUS,
|
||||
Constants.DAMAGE_MAX_RADIUS, Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(ImpactSpreadDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(ActorSplitsAfterImpactSpreadDamage)
|
||||
@ -1,31 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from ActorSplitsAfterDamage import Tests
|
||||
|
||||
def ActorSplitsAfterRadialDamage():
|
||||
from ActorSplitsAfterDamage import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def RadialDamage(target_id, position):
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Radial Damage", target_id,
|
||||
position, Constants.DAMAGE_MIN_RADIUS,
|
||||
Constants.DAMAGE_MAX_RADIUS, Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(RadialDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(ActorSplitsAfterRadialDamage)
|
||||
@ -1,32 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from ActorSplitsAfterDamage import Tests
|
||||
|
||||
def ActorSplitsAfterShearDamage():
|
||||
from ActorSplitsAfterDamage import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def ShearDamage(target_id, position):
|
||||
normal = azlmbr.object.construct('Vector3', 1.0, 0.0, 0.0)
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Shear Damage", target_id,
|
||||
position, normal, Constants.DAMAGE_MIN_RADIUS,
|
||||
Constants.DAMAGE_MAX_RADIUS, Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(ShearDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(ActorSplitsAfterShearDamage)
|
||||
@ -1,31 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from ActorSplitsAfterDamage import Tests
|
||||
|
||||
def ActorSplitsAfterStressDamage():
|
||||
from ActorSplitsAfterDamage import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def StressDamage(target_id, position):
|
||||
force = azlmbr.object.construct('Vector3', 0.0, 0.0, -100.0) # Should be enough to break `brittle` objects
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Stress Damage", target_id,
|
||||
position, force)
|
||||
|
||||
internal_run(StressDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(ActorSplitsAfterStressDamage)
|
||||
@ -1,35 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from ActorSplitsAfterDamage import Tests
|
||||
|
||||
def ActorSplitsAfterTriangleDamage():
|
||||
from ActorSplitsAfterDamage import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def TriangleDamage(target_id, position):
|
||||
# Some points that form a triangle that contains the given position
|
||||
position0 = azlmbr.object.construct('Vector3', position.x, position.y + 1.0, position.z)
|
||||
position1 = azlmbr.object.construct('Vector3', position.x + 1.0, position.y - 1.0, position.z)
|
||||
position2 = azlmbr.object.construct('Vector3', position.x - 1.0, position.y - 1.0, position.z)
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Triangle Damage", target_id,
|
||||
position0, position1, position2,
|
||||
Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(TriangleDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(ActorSplitsAfterTriangleDamage)
|
||||
@ -1,11 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def init():
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
@ -1,50 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
|
||||
"""
|
||||
|
||||
# This suite consists of all test cases that are passing and have been verified.
|
||||
|
||||
import pytest
|
||||
import os
|
||||
import sys
|
||||
|
||||
from ly_test_tools import LAUNCHERS
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
|
||||
from base import TestAutomationBase
|
||||
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def test_ActorSplitsAfterCollision(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterCollision as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterRadialDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterRadialDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterCapsuleDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterCapsuleDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterImpactSpreadDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterImpactSpreadDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterShearDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterShearDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterTriangleDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterTriangleDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterStressDamage(self, request, workspace, editor, launcher_platform):
|
||||
from . import ActorSplitsAfterStressDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
@ -0,0 +1,50 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
|
||||
"""
|
||||
|
||||
# This suite consists of all test cases that are passing and have been verified.
|
||||
|
||||
import pytest
|
||||
import os
|
||||
import sys
|
||||
|
||||
from ly_test_tools import LAUNCHERS
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
|
||||
from base import TestAutomationBase
|
||||
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def test_ActorSplitsAfterCollision(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterCollision as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterRadialDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterRadialDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterCapsuleDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterCapsuleDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterImpactSpreadDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterImpactSpreadDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterShearDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterShearDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterTriangleDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterTriangleDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_ActorSplitsAfterStressDamage(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import Blast_ActorSplitsAfterStressDamage as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
@ -0,0 +1,89 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
|
||||
find_destructable = ("Destructable entity found", "Destructable entity not found")
|
||||
find_root_actor = ("Root actor of destructable entity found", "Root actor of destructable entity not found")
|
||||
root_actor_destroyed = ("Root actor destroyed", "Root actor was not destroyed")
|
||||
child_actors_created = ("Child actors created", "Child actors were not created")
|
||||
exit_game_mode = ("Exited game mode", "Couldn't exit game mode")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def base_run(damage_func):
|
||||
|
||||
"""
|
||||
Summary:
|
||||
Open a Project that already has 1 destructable entity and verify damage destructs it.
|
||||
|
||||
Level Description:
|
||||
Destructable entity is in a level.
|
||||
|
||||
Expected Behavior:
|
||||
Damage is applied to destructable entity. Destructable entity root actor
|
||||
should be destroyed and 2 child actors should be created to replace it.
|
||||
|
||||
Test Steps:
|
||||
1) Open level and Enter game mode
|
||||
2) Retrieve and validate Entities
|
||||
3) Get the entity representing root actor of destructable entity
|
||||
4) Apply damage to the destructable entity
|
||||
5) Check root actor is destroyed
|
||||
6) Check child actors of root actor are created
|
||||
7) Exit game mode
|
||||
8) Close the editor
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
import azlmbr.bus
|
||||
|
||||
from BlastUtils import BlastNotificationHandler
|
||||
|
||||
# Constants
|
||||
TIMEOUT = 2.0
|
||||
|
||||
helper.init_idle()
|
||||
|
||||
# 1) Open level and Enter game mode
|
||||
helper.open_level("Blast", "Blast_ActorSplitsAfterDamage")
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 2) Retrieve and validate Entities
|
||||
destructable_id = general.find_game_entity("Destructable_Box")
|
||||
Report.critical_result(Tests.find_destructable, destructable_id.IsValid())
|
||||
|
||||
# 3) Get the entity representing root actor of destructable entity
|
||||
destructable_initial_actors = azlmbr.destruction.BlastFamilyComponentRequestBus(azlmbr.bus.Event, "Get Actors Data", destructable_id)
|
||||
Report.critical_result(Tests.find_root_actor, len(destructable_initial_actors) == 1)
|
||||
destructable_initial_actor_id = destructable_initial_actors[0].EntityId
|
||||
initial_actor_position = azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldTranslation", destructable_initial_actor_id)
|
||||
|
||||
# 4) Apply damage to the destructable entity
|
||||
damage_func(destructable_id, initial_actor_position)
|
||||
|
||||
family_handler = BlastNotificationHandler(destructable_id)
|
||||
|
||||
# 5) Check root actor is destroyed
|
||||
helper.wait_for_condition(lambda: family_handler.actors_destroyed == 1, TIMEOUT)
|
||||
Report.result(Tests.root_actor_destroyed, family_handler.actors_destroyed == 1)
|
||||
|
||||
# 6) Check child actors of root actor are created
|
||||
helper.wait_for_condition(lambda: family_handler.actors_created == 2, TIMEOUT)
|
||||
Report.result(Tests.child_actors_created, family_handler.actors_created == 2)
|
||||
|
||||
# 7) Exit game mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 8) Close the editor
|
||||
helper.close_editor()
|
||||
@ -0,0 +1,28 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
def Blast_ActorSplitsAfterCapsuleDamage():
|
||||
from BaseDamageTest import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def CapsuleDamage(target_id, position0):
|
||||
position1 = azlmbr.object.construct('Vector3', position0.x + 1.0, position0.y, position0.z)
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Capsule Damage", target_id,
|
||||
position0, position1,
|
||||
Constants.DAMAGE_MIN_RADIUS,
|
||||
Constants.DAMAGE_MAX_RADIUS, Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(CapsuleDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Blast_ActorSplitsAfterCapsuleDamage)
|
||||
@ -0,0 +1,103 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
|
||||
find_moving = ("Moving entity found", "Moving entity not found")
|
||||
find_destructable = ("Destructable entity found", "Destructable entity not found")
|
||||
find_root_actor = ("Root actor of destructable entity found", "Root actor of destructable entity not found")
|
||||
collisions = ("Collision occurred between entities", "Collision did not occur between entities")
|
||||
root_actor_destroyed = ("Root actor destroyed", "Root actor was not destroyed")
|
||||
child_actors_created = ("Child actors created", "Child actors were not created")
|
||||
exit_game_mode = ("Exited game mode", "Couldn't exit game mode")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def Blast_ActorSplitsAfterCollision():
|
||||
|
||||
"""
|
||||
Summary:
|
||||
Open a Project that already has 1 rigid sphere entity and 1 destructable entity and verify collision and damage
|
||||
to destructable entity.
|
||||
|
||||
Level Description:
|
||||
Moving Sphere and Destructable entities are created in level with same collision layer and same collision group.
|
||||
Moving Sphere entity is placed above the Destructable entity.
|
||||
|
||||
Expected Behavior:
|
||||
Moving Sphere has to collide with Destructable entity under the effect of gravity. Destructable entity root actor
|
||||
should be destroyed and 2 child actors should be created to replace it.
|
||||
|
||||
Test Steps:
|
||||
1) Open level and Enter game mode
|
||||
2) Retrieve and validate Entities
|
||||
3) Get the entity representing root actor of destructable entity
|
||||
4) Check moving sphere collides with root actor of destructable entity due to gravity
|
||||
5) Check root actor is destroyed
|
||||
6) Check child actors of root actor are created
|
||||
7) Exit game mode
|
||||
8) Close the editor
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
import azlmbr.bus
|
||||
|
||||
from BlastUtils import CollisionHandler
|
||||
from BlastUtils import BlastNotificationHandler
|
||||
|
||||
# Constants
|
||||
TIMEOUT = 2.0
|
||||
|
||||
helper.init_idle()
|
||||
|
||||
# 1) Open level and Enter game mode
|
||||
helper.open_level("Blast", "Blast_ActorSplitsAfterCollision")
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 2) Retrieve and validate Entities
|
||||
moving_id = general.find_game_entity("Sphere_Moving")
|
||||
Report.critical_result(Tests.find_moving, moving_id.IsValid())
|
||||
|
||||
destructable_id = general.find_game_entity("Destructable_Box")
|
||||
Report.critical_result(Tests.find_destructable, destructable_id.IsValid())
|
||||
|
||||
# 3) Get the entity representing root actor of destructable entity
|
||||
destructable_initial_actors = azlmbr.destruction.BlastFamilyComponentRequestBus(azlmbr.bus.Event, "Get Actors Data", destructable_id)
|
||||
Report.critical_result(Tests.find_root_actor, len(destructable_initial_actors) == 1)
|
||||
destructable_initial_actor_id = destructable_initial_actors[0].EntityId
|
||||
|
||||
collision = CollisionHandler(destructable_initial_actor_id, moving_id)
|
||||
family_handler = BlastNotificationHandler(destructable_id)
|
||||
|
||||
# 4) Check moving sphere collides with root actor of destructable entity due to gravity
|
||||
helper.wait_for_condition(lambda: collision.collision_happened, TIMEOUT)
|
||||
Report.result(Tests.collisions, collision.collision_happened)
|
||||
|
||||
# 5) Check root actor is destroyed
|
||||
helper.wait_for_condition(lambda: family_handler.actors_destroyed == 1, TIMEOUT)
|
||||
Report.result(Tests.root_actor_destroyed, family_handler.actors_destroyed == 1)
|
||||
|
||||
# 6) Check child actors of root actor are created
|
||||
helper.wait_for_condition(lambda: family_handler.actors_created == 2, TIMEOUT)
|
||||
Report.result(Tests.child_actors_created, family_handler.actors_created == 2)
|
||||
|
||||
# 7) Exit game mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 8) Close the editor
|
||||
helper.close_editor()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Blast_ActorSplitsAfterCollision)
|
||||
@ -0,0 +1,26 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
def Blast_ActorSplitsAfterImpactSpreadDamage():
|
||||
from BaseDamageTest import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def ImpactSpreadDamage(target_id, position):
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Impact Spread Damage", target_id,
|
||||
position, Constants.DAMAGE_MIN_RADIUS,
|
||||
Constants.DAMAGE_MAX_RADIUS, Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(ImpactSpreadDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Blast_ActorSplitsAfterImpactSpreadDamage)
|
||||
@ -0,0 +1,26 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
def Blast_ActorSplitsAfterRadialDamage():
|
||||
from BaseDamageTest import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def RadialDamage(target_id, position):
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Radial Damage", target_id,
|
||||
position, Constants.DAMAGE_MIN_RADIUS,
|
||||
Constants.DAMAGE_MAX_RADIUS, Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(RadialDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Blast_ActorSplitsAfterRadialDamage)
|
||||
@ -0,0 +1,27 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
def Blast_ActorSplitsAfterShearDamage():
|
||||
from BaseDamageTest import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def ShearDamage(target_id, position):
|
||||
normal = azlmbr.object.construct('Vector3', 1.0, 0.0, 0.0)
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Shear Damage", target_id,
|
||||
position, normal, Constants.DAMAGE_MIN_RADIUS,
|
||||
Constants.DAMAGE_MAX_RADIUS, Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(ShearDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Blast_ActorSplitsAfterShearDamage)
|
||||
@ -0,0 +1,26 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
def Blast_ActorSplitsAfterStressDamage():
|
||||
from BaseDamageTest import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def StressDamage(target_id, position):
|
||||
force = azlmbr.object.construct('Vector3', 0.0, 0.0, -100.0) # Should be enough to break `brittle` objects
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Stress Damage", target_id,
|
||||
position, force)
|
||||
|
||||
internal_run(StressDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Blast_ActorSplitsAfterStressDamage)
|
||||
@ -0,0 +1,30 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
def Blast_ActorSplitsAfterTriangleDamage():
|
||||
from BaseDamageTest import base_run as internal_run
|
||||
from BlastUtils import Constants
|
||||
|
||||
def TriangleDamage(target_id, position):
|
||||
# Some points that form a triangle that contains the given position
|
||||
position0 = azlmbr.object.construct('Vector3', position.x, position.y + 1.0, position.z)
|
||||
position1 = azlmbr.object.construct('Vector3', position.x + 1.0, position.y - 1.0, position.z)
|
||||
position2 = azlmbr.object.construct('Vector3', position.x - 1.0, position.y - 1.0, position.z)
|
||||
azlmbr.destruction.BlastFamilyDamageRequestBus(azlmbr.bus.Event, "Triangle Damage", target_id,
|
||||
position0, position1, position2,
|
||||
Constants.DAMAGE_AMOUNT)
|
||||
|
||||
internal_run(TriangleDamage)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(Blast_ActorSplitsAfterTriangleDamage)
|
||||
@ -0,0 +1,47 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# Built-in Imports
|
||||
from __future__ import annotations
|
||||
|
||||
# Open 3D Engine Imports
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.asset as azasset
|
||||
import azlmbr.math as math
|
||||
|
||||
|
||||
class Asset:
|
||||
"""
|
||||
Used to find Asset Id by its path and path of asset by its Id
|
||||
If a component has any asset property, then this class object can be called as:
|
||||
asset_id = editor_python_test_tools.editor_entity_utils.EditorComponent.get_component_property_value(<arguments>)
|
||||
asset = asset_utils.Asset(asset_id)
|
||||
"""
|
||||
def __init__(self, id: azasset.AssetId):
|
||||
self.id: azasset.AssetId = id
|
||||
|
||||
# Creation functions
|
||||
@classmethod
|
||||
def find_asset_by_path(cls, path: str, RegisterType: bool = False) -> Asset:
|
||||
"""
|
||||
:param path: Absolute file path of the asset
|
||||
:param RegisterType: Whether to register the asset if it's not in the database,
|
||||
default to false for the general case
|
||||
:return: Asset object associated with file path
|
||||
"""
|
||||
asset_id = azasset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", path, math.Uuid(), RegisterType)
|
||||
assert asset_id.is_valid(), f"Couldn't find Asset with path: {path}"
|
||||
asset = cls(asset_id)
|
||||
return asset
|
||||
|
||||
# Methods
|
||||
def get_path(self) -> str:
|
||||
"""
|
||||
:return: Absolute file path of Asset
|
||||
"""
|
||||
assert self.id.is_valid(), "Invalid Asset Id"
|
||||
return azasset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetPathById", self.id)
|
||||
@ -1,90 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# Test case ID : C18977329
|
||||
# Test Case Title : Add cloth simulation to a Mesh
|
||||
|
||||
# fmt: off
|
||||
class Tests:
|
||||
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
|
||||
no_errors_and_warnings_found = ("No errors and warnings found", "Found errors and warnings")
|
||||
exit_game_mode = ("Exited game mode", "Failed to exit game mode")
|
||||
# fmt: on
|
||||
|
||||
def C18977329_NvCloth_AddClothSimulationToMesh():
|
||||
"""
|
||||
Summary:
|
||||
Load level with Entity having Mesh and Cloth components already setup. Verify that editor remains stable in Game mode.
|
||||
|
||||
Expected Behavior:
|
||||
The Editor is stable there are no warnings or errors.
|
||||
|
||||
Test Steps:
|
||||
1) Load the level
|
||||
2) Start the Tracer to catch any errors and warnings
|
||||
3) Enter game mode
|
||||
4) Wait in game mode some frames to let cloth simulation run
|
||||
5) Verify there are no errors and warnings in the logs
|
||||
6) Exit game mode
|
||||
7) Close the editor
|
||||
|
||||
Note:
|
||||
At the time of writing this test it was not possible to set a component property
|
||||
with a dropdown, which is necessary to setup a Cloth component. Because of this limitation
|
||||
the components of this test are not setup by the script and a level was provided instead.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
# Helper file Imports
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
from editor_python_test_tools.utils import Tracer
|
||||
|
||||
# Constants
|
||||
FRAMES_IN_GAME_MODE = 200
|
||||
|
||||
helper.init_idle()
|
||||
# 1) Load the level
|
||||
helper.open_level("NvCloth", "C18977329_NvCloth_AddClothSimulationToMesh")
|
||||
|
||||
# 2) Start the Tracer to catch any errors and warnings
|
||||
with Tracer() as section_tracer:
|
||||
# 3) Enter game mode
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 4) Wait in game mode some frames to let cloth simulation run
|
||||
general.idle_wait_frames(FRAMES_IN_GAME_MODE)
|
||||
|
||||
# 5) Verify there are no errors and warnings in the logs
|
||||
success_condition = not (section_tracer.has_errors or section_tracer.has_warnings)
|
||||
Report.result(Tests.no_errors_and_warnings_found, success_condition)
|
||||
if not success_condition:
|
||||
if section_tracer.has_warnings:
|
||||
Report.info(f"Warnings found: {section_tracer.warnings}")
|
||||
if section_tracer.has_errors:
|
||||
Report.info(f"Errors found: {section_tracer.errors}")
|
||||
Report.failure(Tests.no_errors_and_warnings_found)
|
||||
|
||||
# 6) Exit game mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 7) Close the editor
|
||||
helper.close_editor()
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C18977329_NvCloth_AddClothSimulationToMesh)
|
||||
@ -1,90 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# Test case ID : C18977330
|
||||
# Test Case Title : Add cloth simulation to an Actor
|
||||
|
||||
# fmt: off
|
||||
class Tests:
|
||||
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
|
||||
no_errors_and_warnings_found = ("No errors and warnings found", "Found errors and warnings")
|
||||
exit_game_mode = ("Exited game mode", "Failed to exit game mode")
|
||||
# fmt: on
|
||||
|
||||
def C18977330_NvCloth_AddClothSimulationToActor():
|
||||
"""
|
||||
Summary:
|
||||
Load level with Entity having Actor and Cloth components already setup. Verify that editor remains stable in Game mode.
|
||||
|
||||
Expected Behavior:
|
||||
The Editor is stable there are no warnings or errors.
|
||||
|
||||
Test Steps:
|
||||
1) Load the level
|
||||
2) Start the Tracer to catch any errors and warnings
|
||||
3) Enter game mode
|
||||
4) Wait in game mode some frames to let cloth simulation run
|
||||
5) Verify there are no errors and warnings in the logs
|
||||
6) Exit game mode
|
||||
7) Close the editor
|
||||
|
||||
Note:
|
||||
At the time of writing this test it was not possible to set a component property
|
||||
with a dropdown, which is necessary to setup a Cloth component. Because of this limitation
|
||||
the components of this test are not setup by the script and a level was provided instead.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
# Helper file Imports
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
from editor_python_test_tools.utils import Tracer
|
||||
|
||||
# Constants
|
||||
FRAMES_IN_GAME_MODE = 200
|
||||
|
||||
helper.init_idle()
|
||||
# 1) Load the level
|
||||
helper.open_level("NvCloth", "C18977330_NvCloth_AddClothSimulationToActor")
|
||||
|
||||
# 2) Start the Tracer to catch any errors and warnings
|
||||
with Tracer() as section_tracer:
|
||||
# 3) Enter game mode
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 4) Wait in game mode some frames to let cloth simulation run
|
||||
general.idle_wait_frames(FRAMES_IN_GAME_MODE)
|
||||
|
||||
# 5) Verify there are no errors and warnings in the logs
|
||||
success_condition = not (section_tracer.has_errors or section_tracer.has_warnings)
|
||||
Report.result(Tests.no_errors_and_warnings_found, success_condition)
|
||||
if not success_condition:
|
||||
if section_tracer.has_warnings:
|
||||
Report.info(f"Warnings found: {section_tracer.warnings}")
|
||||
if section_tracer.has_errors:
|
||||
Report.info(f"Errors found: {section_tracer.errors}")
|
||||
Report.failure(Tests.no_errors_and_warnings_found)
|
||||
|
||||
# 6) Exit game mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 7) Close the editor
|
||||
helper.close_editor()
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C18977330_NvCloth_AddClothSimulationToActor)
|
||||
@ -1,11 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def init():
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
@ -1,33 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
|
||||
"""
|
||||
|
||||
# This suite consists of all test cases that are passing and have been verified.
|
||||
|
||||
import pytest
|
||||
import os
|
||||
import sys
|
||||
|
||||
from ly_test_tools import LAUNCHERS
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
|
||||
from base import TestAutomationBase
|
||||
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
|
||||
use_null_renderer = False # Use default renderer (needs gpu)
|
||||
extra_cmdline_args = []
|
||||
|
||||
def test_C18977329_NvCloth_AddClothSimulationToMesh(self, request, workspace, editor, launcher_platform):
|
||||
from . import C18977329_NvCloth_AddClothSimulationToMesh as test_module
|
||||
self._run_test(request, workspace, editor, test_module, self.extra_cmdline_args, self.use_null_renderer)
|
||||
|
||||
def test_C18977330_NvCloth_AddClothSimulationToActor(self, request, workspace, editor, launcher_platform):
|
||||
from . import C18977330_NvCloth_AddClothSimulationToActor as test_module
|
||||
self._run_test(request, workspace, editor, test_module, self.extra_cmdline_args, self.use_null_renderer)
|
||||
@ -0,0 +1,32 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
|
||||
"""
|
||||
|
||||
# This suite consists of all test cases that are passing and have been verified.
|
||||
|
||||
import pytest
|
||||
import os
|
||||
import sys
|
||||
|
||||
from ly_test_tools import LAUNCHERS
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
|
||||
from base import TestAutomationBase
|
||||
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
|
||||
use_null_renderer = False # Use default renderer (needs gpu)
|
||||
|
||||
def test_NvCloth_AddClothSimulationToMesh(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import NvCloth_AddClothSimulationToMesh as test_module
|
||||
self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer)
|
||||
|
||||
def test_NvCloth_AddClothSimulationToActor(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import NvCloth_AddClothSimulationToActor as test_module
|
||||
self._run_test(request, workspace, editor, test_module, use_null_renderer = self.use_null_renderer)
|
||||
@ -0,0 +1,84 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# Test case ID : C18977330
|
||||
# Test Case Title : Add cloth simulation to an Actor
|
||||
|
||||
# fmt: off
|
||||
class Tests:
|
||||
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
|
||||
no_errors_and_warnings_found = ("No errors and warnings found", "Found errors and warnings")
|
||||
exit_game_mode = ("Exited game mode", "Failed to exit game mode")
|
||||
# fmt: on
|
||||
|
||||
def NvCloth_AddClothSimulationToActor():
|
||||
"""
|
||||
Summary:
|
||||
Load level with Entity having Actor and Cloth components already setup. Verify that editor remains stable in Game mode.
|
||||
|
||||
Expected Behavior:
|
||||
The Editor is stable there are no warnings or errors.
|
||||
|
||||
Test Steps:
|
||||
1) Load the level
|
||||
2) Start the Tracer to catch any errors and warnings
|
||||
3) Enter game mode
|
||||
4) Wait in game mode some frames to let cloth simulation run
|
||||
5) Verify there are no errors and warnings in the logs
|
||||
6) Exit game mode
|
||||
7) Close the editor
|
||||
|
||||
Note:
|
||||
At the time of writing this test it was not possible to set a component property
|
||||
with a dropdown, which is necessary to setup a Cloth component. Because of this limitation
|
||||
the components of this test are not setup by the script and a level was provided instead.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
from editor_python_test_tools.utils import Tracer
|
||||
|
||||
# Constants
|
||||
FRAMES_IN_GAME_MODE = 200
|
||||
|
||||
helper.init_idle()
|
||||
# 1) Load the level
|
||||
helper.open_level("NvCloth", "NvCloth_AddClothSimulationToActor")
|
||||
|
||||
# 2) Start the Tracer to catch any errors and warnings
|
||||
with Tracer() as section_tracer:
|
||||
# 3) Enter game mode
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 4) Wait in game mode some frames to let cloth simulation run
|
||||
general.idle_wait_frames(FRAMES_IN_GAME_MODE)
|
||||
|
||||
# 5) Verify there are no errors and warnings in the logs
|
||||
success_condition = not (section_tracer.has_errors or section_tracer.has_warnings)
|
||||
Report.result(Tests.no_errors_and_warnings_found, success_condition)
|
||||
if not success_condition:
|
||||
if section_tracer.has_warnings:
|
||||
Report.info(f"Warnings found: {section_tracer.warnings}")
|
||||
if section_tracer.has_errors:
|
||||
Report.info(f"Errors found: {section_tracer.errors}")
|
||||
Report.failure(Tests.no_errors_and_warnings_found)
|
||||
|
||||
# 6) Exit game mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 7) Close the editor
|
||||
helper.close_editor()
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(NvCloth_AddClothSimulationToActor)
|
||||
@ -0,0 +1,84 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
# Test case ID : C18977329
|
||||
# Test Case Title : Add cloth simulation to a Mesh
|
||||
|
||||
# fmt: off
|
||||
class Tests:
|
||||
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
|
||||
no_errors_and_warnings_found = ("No errors and warnings found", "Found errors and warnings")
|
||||
exit_game_mode = ("Exited game mode", "Failed to exit game mode")
|
||||
# fmt: on
|
||||
|
||||
def NvCloth_AddClothSimulationToMesh():
|
||||
"""
|
||||
Summary:
|
||||
Load level with Entity having Mesh and Cloth components already setup. Verify that editor remains stable in Game mode.
|
||||
|
||||
Expected Behavior:
|
||||
The Editor is stable there are no warnings or errors.
|
||||
|
||||
Test Steps:
|
||||
1) Load the level
|
||||
2) Start the Tracer to catch any errors and warnings
|
||||
3) Enter game mode
|
||||
4) Wait in game mode some frames to let cloth simulation run
|
||||
5) Verify there are no errors and warnings in the logs
|
||||
6) Exit game mode
|
||||
7) Close the editor
|
||||
|
||||
Note:
|
||||
At the time of writing this test it was not possible to set a component property
|
||||
with a dropdown, which is necessary to setup a Cloth component. Because of this limitation
|
||||
the components of this test are not setup by the script and a level was provided instead.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
from editor_python_test_tools.utils import Tracer
|
||||
|
||||
# Constants
|
||||
FRAMES_IN_GAME_MODE = 200
|
||||
|
||||
helper.init_idle()
|
||||
# 1) Load the level
|
||||
helper.open_level("NvCloth", "NvCloth_AddClothSimulationToMesh")
|
||||
|
||||
# 2) Start the Tracer to catch any errors and warnings
|
||||
with Tracer() as section_tracer:
|
||||
# 3) Enter game mode
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 4) Wait in game mode some frames to let cloth simulation run
|
||||
general.idle_wait_frames(FRAMES_IN_GAME_MODE)
|
||||
|
||||
# 5) Verify there are no errors and warnings in the logs
|
||||
success_condition = not (section_tracer.has_errors or section_tracer.has_warnings)
|
||||
Report.result(Tests.no_errors_and_warnings_found, success_condition)
|
||||
if not success_condition:
|
||||
if section_tracer.has_warnings:
|
||||
Report.info(f"Warnings found: {section_tracer.warnings}")
|
||||
if section_tracer.has_errors:
|
||||
Report.info(f"Errors found: {section_tracer.errors}")
|
||||
Report.failure(Tests.no_errors_and_warnings_found)
|
||||
|
||||
# 6) Exit game mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 7) Close the editor
|
||||
helper.close_editor()
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(NvCloth_AddClothSimulationToMesh)
|
||||
@ -1,60 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
|
||||
# Test case ID : C28798177
|
||||
# Test Case Title : White Box Tool Component can be added to an Entity
|
||||
|
||||
|
||||
# fmt:off
|
||||
class Tests():
|
||||
white_box_entity_created = ("White box entity created", "Failed to create white box entity")
|
||||
white_box_component_enabled = ("White box component enabled", "Failed to enable white box component")
|
||||
# fmt:on
|
||||
|
||||
|
||||
def C28798177_WhiteBox_AddComponentToEntity():
|
||||
import os
|
||||
import sys
|
||||
from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.editor as editor
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
# open level
|
||||
helper.init_idle()
|
||||
general.open_level("EmptyLevel")
|
||||
|
||||
# create white box entity and attach component
|
||||
white_box_entity = init.create_white_box_entity()
|
||||
white_box_mesh_component = init.create_white_box_component(white_box_entity)
|
||||
init.create_white_box_handle(white_box_mesh_component)
|
||||
|
||||
# verify results
|
||||
entity_id = general.find_editor_entity('WhiteBox')
|
||||
Report.result(Tests.white_box_entity_created, entity_id.IsValid())
|
||||
|
||||
component_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', white_box_mesh_component)
|
||||
Report.result(Tests.white_box_component_enabled, component_enabled)
|
||||
|
||||
# close editor
|
||||
helper.close_editor()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C28798177_WhiteBox_AddComponentToEntity)
|
||||
@ -1,70 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
# fmt:off
|
||||
class Tests():
|
||||
white_box_initially_visible = ("White box initially invisible", "White box not initially invisible")
|
||||
white_box_set_to_invisible = ("White box set to invisible", "Failed to set white box to invisible")
|
||||
# fmt:on
|
||||
|
||||
|
||||
def C28798205_WhiteBox_SetInvisible():
|
||||
# note: This automated test does not fully replicate the test case in Test Rail as it's
|
||||
# not currently possible using the Hydra API to get an EntityComponentIdPair at runtime,
|
||||
# in future game_mode will be activated and a runtime White Box Component queried
|
||||
import os
|
||||
import sys
|
||||
from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init
|
||||
import ImportPathHelper as imports
|
||||
import editor_python_test_tools.hydra_editor_utils as hydra
|
||||
imports.init()
|
||||
|
||||
import azlmbr.whitebox.api as api
|
||||
import azlmbr.whitebox
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.editor as editor
|
||||
import azlmbr.entity as entity
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
# open level
|
||||
helper.init_idle()
|
||||
general.open_level("EmptyLevel")
|
||||
|
||||
white_box_entity_name = 'WhiteBox-Visibility'
|
||||
white_box_visibility_path = 'White Box Material|Visible'
|
||||
|
||||
# create white box entity and attach component
|
||||
white_box_entity = init.create_white_box_entity(white_box_entity_name)
|
||||
white_box_mesh_component = init.create_white_box_component(white_box_entity)
|
||||
|
||||
# verify preconditions
|
||||
visible_property = hydra.get_component_property_value(white_box_mesh_component, white_box_visibility_path)
|
||||
Report.result(Tests.white_box_initially_visible, visible_property)
|
||||
|
||||
# verify setting visibility
|
||||
editor.EditorComponentAPIBus(bus.Broadcast, "SetComponentProperty", white_box_mesh_component, white_box_visibility_path, False)
|
||||
visible_property = hydra.get_component_property_value(white_box_mesh_component, white_box_visibility_path)
|
||||
Report.result(Tests.white_box_set_to_invisible, not visible_property)
|
||||
|
||||
helper.close_editor()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C28798205_WhiteBox_SetInvisible)
|
||||
@ -1,109 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
|
||||
# Test case ID : C29279329
|
||||
# Test Case Title : White Box mesh shape can be changed with the Default Shape dropdown on the Component
|
||||
|
||||
|
||||
# fmt:off
|
||||
class Tests():
|
||||
default_shape_cube = ("Default shape set to cube", "Default shape is not set to cube")
|
||||
default_shape_tetrahedron = ("Default shape changed to tetrahedron", "Failed to change default shape to tetrahedron")
|
||||
default_shape_icosahedron = ("Default shape changed to icosahedron", "Failed to change default shape to icosahedron")
|
||||
default_shape_cylinder = ("Default shape changed to cylinder", "Failed to change default shape to cylinder")
|
||||
default_shape_sphere = ("Default shape changed to sphere", "Failed to change default shape to sphere")
|
||||
# fmt:on
|
||||
|
||||
critical_shape_check = ("Default shape has more than 0 sides", "default shape has 0 sides")
|
||||
|
||||
def C29279329_WhiteBox_SetDefaultShape():
|
||||
import os
|
||||
import sys
|
||||
from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
import azlmbr.whitebox.api as api
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
def check_shape_result(success_fail_tuple, condition):
|
||||
result = Report.result(success_fail_tuple, condition)
|
||||
if not result:
|
||||
face_count = white_box_handle.MeshFaceCount()
|
||||
Report.critical_result(critical_shape_check, face_count > 0)
|
||||
Report.info(f"Face count = {face_count}")
|
||||
|
||||
shape_types = azlmbr.globals.property
|
||||
|
||||
# expected results
|
||||
expected_results = {
|
||||
shape_types.CUBE: 12,
|
||||
shape_types.TETRAHEDRON: 4,
|
||||
shape_types.ICOSAHEDRON: 20,
|
||||
shape_types.CYLINDER: 64,
|
||||
shape_types.SPHERE: 320
|
||||
}
|
||||
|
||||
# open level
|
||||
helper.init_idle()
|
||||
general.open_level("EmptyLevel")
|
||||
|
||||
# create white box entity and attach component
|
||||
white_box_entity = init.create_white_box_entity()
|
||||
white_box_mesh_component = init.create_white_box_component(white_box_entity)
|
||||
white_box_handle = init.create_white_box_handle(white_box_mesh_component)
|
||||
|
||||
# verify results
|
||||
# cube
|
||||
check_shape_result(
|
||||
Tests.default_shape_cube,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.CUBE))
|
||||
|
||||
# tetrahedron
|
||||
azlmbr.whitebox.request.bus.EditorWhiteBoxComponentRequestBus(
|
||||
bus.Event, 'SetDefaultShape', white_box_mesh_component, shape_types.TETRAHEDRON)
|
||||
check_shape_result(
|
||||
Tests.default_shape_tetrahedron,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.TETRAHEDRON))
|
||||
|
||||
# icosahedron
|
||||
azlmbr.whitebox.request.bus.EditorWhiteBoxComponentRequestBus(
|
||||
bus.Event, 'SetDefaultShape', white_box_mesh_component, shape_types.ICOSAHEDRON)
|
||||
check_shape_result(
|
||||
Tests.default_shape_icosahedron,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.ICOSAHEDRON))
|
||||
|
||||
# cylinder
|
||||
azlmbr.whitebox.request.bus.EditorWhiteBoxComponentRequestBus(
|
||||
bus.Event, 'SetDefaultShape', white_box_mesh_component, shape_types.CYLINDER)
|
||||
check_shape_result(
|
||||
Tests.default_shape_cylinder,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.CYLINDER))
|
||||
|
||||
# sphere
|
||||
azlmbr.whitebox.request.bus.EditorWhiteBoxComponentRequestBus(
|
||||
bus.Event, 'SetDefaultShape', white_box_mesh_component, shape_types.SPHERE)
|
||||
check_shape_result(
|
||||
Tests.default_shape_sphere,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.SPHERE))
|
||||
|
||||
# close editor
|
||||
helper.close_editor()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C29279329_WhiteBox_SetDefaultShape)
|
||||
@ -1,350 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
|
||||
"""
|
||||
|
||||
# Imports
|
||||
import os
|
||||
import shutil
|
||||
import json
|
||||
import logging
|
||||
import ly_test_tools.environment.file_system as fs
|
||||
|
||||
|
||||
class FileManagement:
|
||||
"""
|
||||
File Management static class: Handles file backup and restoration.
|
||||
Organizes backing up files into a single directory and
|
||||
mapping the back up files to their original files.
|
||||
|
||||
Features accessible via the exposed decorator functions.
|
||||
"""
|
||||
|
||||
# Static variables
|
||||
MAX_BACKUPS = 10000 # Arbitrary number to cap same-file-name name generating
|
||||
backup_folder_name = ".backup"
|
||||
backup_folder_path = os.path.join(os.path.split(__file__)[0], backup_folder_name) # CWD plus backup folder name
|
||||
file_map_name = "_filebackup_map.json" # JSON file to store original to back up file mappings
|
||||
|
||||
@staticmethod
|
||||
def _load_file_map():
|
||||
# type: () -> {str: str}
|
||||
"""
|
||||
Loads the FileManagement's json file map.
|
||||
The returned dictionary has key: value sets such that:
|
||||
keys: full path to an original file currently being backed up
|
||||
values: name of the original file's backup file. Uses a numbering system for
|
||||
storing multiple file names that are identical but located in different directories.
|
||||
If there is no current json file or the file cannot be parsed, an empty dictionary is returned.
|
||||
:return: Dictionary to map original file's to their back up file names.
|
||||
"""
|
||||
json_file_path = os.path.join(FileManagement.backup_folder_path, FileManagement.file_map_name)
|
||||
if os.path.exists(json_file_path):
|
||||
try:
|
||||
with open(json_file_path, "r") as f:
|
||||
return json.load(f)
|
||||
except ValueError:
|
||||
logging.info("Decoding JSON file {} failed. Empty dictionary used".format(json_file_path))
|
||||
return {}
|
||||
|
||||
@staticmethod
|
||||
def _save_file_map(file_map):
|
||||
# type: ({str: str}) -> None
|
||||
"""
|
||||
Saves the [file_map] dictionary as a json file.
|
||||
If [file_map] is empty, deletes the json file.
|
||||
:param file_map: A dictionary mapping original file paths to their back up file names.
|
||||
:return: None
|
||||
"""
|
||||
file_path = os.path.join(FileManagement.backup_folder_path, FileManagement.file_map_name)
|
||||
if os.path.exists(file_path):
|
||||
fs.unlock_file(file_path)
|
||||
if len(file_map) > 0:
|
||||
with open(file_path, "w") as f:
|
||||
json.dump(file_map, f)
|
||||
fs.lock_file(file_path)
|
||||
else:
|
||||
fs.delete([file_path], True, False)
|
||||
|
||||
@staticmethod
|
||||
def _next_available_name(file_name, file_map):
|
||||
# type: (str, {str: str}) -> str or None
|
||||
"""
|
||||
Generates the next available backup file name using a FILE_NAME_x.ext naming convention
|
||||
where x is a number. Returns None if we've maxed out the numbering system.
|
||||
:param file_name: The base file to generate a back up file name for.
|
||||
:param file_map: The file_map for the FileManagement system
|
||||
:return: str
|
||||
"""
|
||||
suffix, extension = file_name.split(".", 1)
|
||||
for i in range(FileManagement.MAX_BACKUPS):
|
||||
potential_name = suffix + "_" + str(i) + "." + extension
|
||||
if potential_name not in file_map.values():
|
||||
return potential_name
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def _backup_file(file_name, file_path):
|
||||
# type: (str, str) -> None
|
||||
"""
|
||||
Backs up the [file_name] located at [file_path] into the FileManagement's backup folder.
|
||||
Leaves the backup file locked from writing privileges.
|
||||
:param file_name: The file's name that will be backed up
|
||||
:param file_path: The path to the file to back up
|
||||
:return: None
|
||||
"""
|
||||
file_map = FileManagement._load_file_map()
|
||||
backup_path = FileManagement.backup_folder_path
|
||||
backup_file_name = "{}.bak".format(file_name)
|
||||
backup_file = os.path.join(backup_path, backup_file_name)
|
||||
# If backup directory DNE, make one
|
||||
if not os.path.exists(backup_path):
|
||||
os.mkdir(backup_path)
|
||||
# If "traditional" backup file exists, delete it (myFile.txt.bak)
|
||||
if os.path.exists(backup_file):
|
||||
fs.delete([backup_file], True, False)
|
||||
# Find my next storage name (myFile_1.txt.bak)
|
||||
backup_storage_file_name = FileManagement._next_available_name(backup_file_name, file_map)
|
||||
if backup_storage_file_name is None:
|
||||
# If _next_available_name returns None, we have backed up MAX_BACKUPS of files name [file_name]
|
||||
raise Exception(
|
||||
"FileManagement class ran out of backups per name. Max: {}".format(FileManagement.MAX_BACKUPS)
|
||||
)
|
||||
backup_storage_file = os.path.join(backup_path, backup_storage_file_name)
|
||||
if os.path.exists(backup_storage_file):
|
||||
# This file should not exists, but if it does it's about to get clobbered!
|
||||
fs.unlock_file(backup_storage_file)
|
||||
# Create "traditional" backup file (myFile.txt.bak)
|
||||
fs.create_backup(os.path.join(file_path, file_name), backup_path)
|
||||
# Copy "traditional" backup file into storage backup (myFile_1.txt.bak)
|
||||
FileManagement._copy_file(backup_file_name, backup_path, backup_storage_file_name, backup_path)
|
||||
fs.lock_file(backup_storage_file)
|
||||
# Delete "traditional" back up file
|
||||
fs.unlock_file(backup_file)
|
||||
fs.delete([backup_file], True, False)
|
||||
# Update file map with new file
|
||||
file_map[os.path.join(file_path, file_name)] = backup_storage_file_name
|
||||
FileManagement._save_file_map(file_map)
|
||||
# Unlock original file to get it ready to be edited by the test
|
||||
fs.unlock_file(os.path.join(file_path, file_name))
|
||||
|
||||
@staticmethod
|
||||
def _restore_file(file_name, file_path):
|
||||
# type: (str, str) -> None
|
||||
"""
|
||||
Restores the [file_name] located at [file_path] which is backed up in FileManagement's backup folder.
|
||||
Locks [file_name] from writing privileges when done restoring.
|
||||
:param file_name: The Original file that was backed up, and now restored
|
||||
:param file_path: The location of the original file that was backed up
|
||||
:return: None
|
||||
"""
|
||||
file_map = FileManagement._load_file_map()
|
||||
backup_path = FileManagement.backup_folder_path
|
||||
src_file = os.path.join(file_path, file_name)
|
||||
if src_file in file_map:
|
||||
backup_file = os.path.join(backup_path, file_map[src_file])
|
||||
if os.path.exists(backup_file):
|
||||
fs.unlock_file(backup_file)
|
||||
fs.unlock_file(src_file)
|
||||
# Make temporary copy of backed up file to restore from
|
||||
temp_file = "{}.bak".format(file_name)
|
||||
FileManagement._copy_file(file_map[src_file], backup_path, temp_file, backup_path)
|
||||
fs.restore_backup(src_file, backup_path)
|
||||
fs.lock_file(src_file)
|
||||
# Delete backup file
|
||||
fs.delete([os.path.join(backup_path, temp_file)], True, False)
|
||||
fs.delete([backup_file], True, False)
|
||||
# Remove from file map
|
||||
del file_map[src_file]
|
||||
FileManagement._save_file_map(file_map)
|
||||
if not os.listdir(backup_path):
|
||||
# Delete backup folder if it's empty now
|
||||
os.rmdir(backup_path)
|
||||
|
||||
@staticmethod
|
||||
def _find_files(file_names, root_dir, search_subdirs=False):
|
||||
# type: ([str], str, bool) -> {str:str}
|
||||
"""
|
||||
Searches the [root_dir] directory tree for each of the file names in [file_names]. Returns a dictionary
|
||||
where keys = the entries in file_names, and their values are the paths they were found at.
|
||||
Raises a runtime warning if not exactly one copy of each file is found.
|
||||
:param file_names: A list of file_names to look for
|
||||
:param root_dir: The root directory to begin the search
|
||||
collect all file paths matching that file_name
|
||||
:param search_subdirs: Optional boolean flag for searching sub-directories of [parent_path]
|
||||
:return: A dictionary where keys are file names, and values are the file's path.
|
||||
"""
|
||||
file_list = {}
|
||||
found_count = 0
|
||||
for file_name in file_names:
|
||||
file_list[file_name] = None
|
||||
if search_subdirs:
|
||||
# Search parent path for all file name arguments
|
||||
for dir_path, _, dir_files in os.walk(root_dir):
|
||||
for dir_file in dir_files:
|
||||
if dir_file in file_list.keys():
|
||||
if file_list[dir_file] is None:
|
||||
file_list[dir_file] = dir_path
|
||||
found_count += 1
|
||||
else:
|
||||
# Found multiple files with same name. Raise warning.
|
||||
raise RuntimeWarning("Found multiple files with the name {}.".format(dir_file))
|
||||
else:
|
||||
for dir_file in os.listdir(root_dir):
|
||||
if os.path.isfile(os.path.join(root_dir, dir_file)) and dir_file in file_names:
|
||||
file_list[dir_file] = root_dir
|
||||
not_found = [file_name for file_name in file_names if file_list[file_name] is None]
|
||||
if not_found:
|
||||
raise RuntimeWarning("Could not find the following files: {}".format(not_found))
|
||||
|
||||
return file_list
|
||||
|
||||
@staticmethod
|
||||
def _copy_file(src_file, src_path, target_file, target_path):
|
||||
# type: (str, str, str, str) -> None
|
||||
"""
|
||||
Copies the [src_file] at located in [src_path] to the [target_file] located at [target_path].
|
||||
Leaves the [target_file] unlocked for reading and writing privileges
|
||||
:param src_file: The source file to copy (file name)
|
||||
:param src_path: The source file's path
|
||||
:param target_file: The target file to copy into (file name)
|
||||
:param target_path: The target file's path
|
||||
:return: None
|
||||
"""
|
||||
target_file_path = os.path.join(target_path, target_file)
|
||||
src_file_path = os.path.join(src_path, src_file)
|
||||
if os.path.exists(target_file_path):
|
||||
fs.unlock_file(target_file_path)
|
||||
shutil.copyfile(src_file_path, target_file_path)
|
||||
|
||||
@staticmethod
|
||||
def file_revert(file_name, parent_path=None, search_subdirs=False):
|
||||
# type: (str, str, bool) -> function
|
||||
"""
|
||||
Function decorator:
|
||||
Convenience version of file_revert_list for passing a single file
|
||||
Calls file_revert_list on a list one [file_name]
|
||||
:param file_name: The name of a file to backup (not path)
|
||||
:param parent_path: The root directory to search for the [file_names] (relative to the dev folder).
|
||||
Defaults to the project folder described by the inner function's workspace fixture
|
||||
:param search_subdirs: A boolean option for searching sub-directories for the files in [file_names]
|
||||
:return: function as per the function decorator pattern
|
||||
"""
|
||||
return FileManagement.file_revert_list([file_name], parent_path, search_subdirs)
|
||||
|
||||
@staticmethod
|
||||
def file_revert_list(file_names, parent_path=None, search_subdirs=False):
|
||||
# type: ([str], str, bool) -> function
|
||||
"""
|
||||
Function decorator:
|
||||
Collects file names specified in [file_names] in the [parent_path] directory.
|
||||
Backs up these files before executing the parameter to the "wrap" function.
|
||||
If the search_subdirs flag is True, searches all subdirectories of [parent_path] for files.
|
||||
:param file_names: A list of file names (not paths)
|
||||
:param parent_path: The root directory to search for the [file_names] (relative to the dev folder).
|
||||
Defaults to the project folder described by the inner function's workspace fixture
|
||||
:param search_subdirs: A boolean option for searching sub-directories for the files in [file_names]
|
||||
:return: function as per the function decorator pattern
|
||||
"""
|
||||
|
||||
def wrap(func):
|
||||
# type: (function) -> function
|
||||
def inner(self, request, workspace, editor, launcher_platform):
|
||||
# type: (...) -> None
|
||||
"""
|
||||
Inner function to wrap around decorated function. Function being decorated must match this
|
||||
functions parameter order.
|
||||
"""
|
||||
root_path = parent_path
|
||||
if root_path is not None:
|
||||
root_path = os.path.join(workspace.paths.engine_root(), root_path)
|
||||
else:
|
||||
# Default to project folder (AutomatedTesting)
|
||||
root_path = workspace.paths.project()
|
||||
|
||||
# Try to locate files
|
||||
try:
|
||||
file_list = FileManagement._find_files(file_names, root_path, search_subdirs)
|
||||
except RuntimeWarning as w:
|
||||
assert False, (
|
||||
w.message
|
||||
+ " Please check use of search_subdirs; make sure you are using the correct parent directory."
|
||||
)
|
||||
|
||||
# Restore from backups
|
||||
for file_name, file_path in file_list.items():
|
||||
FileManagement._restore_file(file_name, file_path)
|
||||
|
||||
# Create backups for each discovered path for each specified filename
|
||||
for file_name, file_path in file_list.items():
|
||||
FileManagement._backup_file(file_name, file_path)
|
||||
|
||||
try:
|
||||
# Run the test
|
||||
func(self, request, workspace, editor, launcher_platform)
|
||||
finally:
|
||||
# Restore backups for each discovered path for each specified filename if they exist
|
||||
for file_name, file_path in file_list.items():
|
||||
FileManagement._restore_file(file_name, file_path)
|
||||
|
||||
return inner
|
||||
|
||||
return wrap
|
||||
|
||||
@staticmethod
|
||||
def file_override(target_file, src_file, parent_path=None, search_subdirs=False):
|
||||
# type: (str, str, str, bool) -> function
|
||||
"""
|
||||
Function decorator:
|
||||
Searches for [target_file] and [src_file] in [parent_path](relative to the project dev folder)
|
||||
and performs backup and file swapping. [target_file] is backed up and replaced with [src_file] before the
|
||||
decorated function executes.
|
||||
After the decorated function is executed [target_file] is restored to the state before being swapped.
|
||||
If [parent_path] is not specified, the project folder described by the current workspace will be used.
|
||||
If the search_subdirs flag is True, searches all subdirectories of [parent_path] for files.
|
||||
:param target_file: The name of the file being backed up and swapped into
|
||||
:param src_file: The name of the file to swap into [target_file]
|
||||
:param parent_path: The root directory to search for the [file_names] (relative to the dev folder).
|
||||
Defaults to the project folder described by the inner function's workspace fixture
|
||||
:param search_subdirs: A boolean option for searching sub-directories for the files in [file_names]
|
||||
:return: The decorated function
|
||||
"""
|
||||
|
||||
def wrap(func):
|
||||
def inner(self, request, workspace, editor, launcher_platform):
|
||||
"""
|
||||
Inner function to wrap around decorated function. Function being decorated must match this
|
||||
functions parameter order.
|
||||
"""
|
||||
root_path = parent_path
|
||||
if root_path is not None:
|
||||
root_path = os.path.join(workspace.paths.engine_root(), root_path)
|
||||
else:
|
||||
# Default to project folder (AutomatedTesting)
|
||||
root_path = workspace.paths.project()
|
||||
|
||||
# Try to locate both target and source files
|
||||
try:
|
||||
file_list = FileManagement._find_files([target_file, src_file], root_path, search_subdirs)
|
||||
except RuntimeWarning as w:
|
||||
assert False, (
|
||||
w.message
|
||||
+ " Please check use of search_subdirs; make sure you are using the correct parent directory."
|
||||
)
|
||||
|
||||
FileManagement._restore_file(target_file, file_list[target_file])
|
||||
FileManagement._backup_file(target_file, file_list[target_file])
|
||||
FileManagement._copy_file(src_file, file_list[src_file], target_file, file_list[target_file])
|
||||
|
||||
try:
|
||||
# Run Test
|
||||
func(self, request, workspace, editor, launcher_platform)
|
||||
finally:
|
||||
FileManagement._restore_file(target_file, file_list[target_file])
|
||||
|
||||
return inner
|
||||
|
||||
return wrap
|
||||
@ -1,11 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
def init():
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
@ -1,36 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
|
||||
"""
|
||||
|
||||
# This suite consists of all test cases that are passing and have been verified.
|
||||
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
from .FileManagement import FileManagement as fm
|
||||
from ly_test_tools import LAUNCHERS
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
|
||||
from base import TestAutomationBase
|
||||
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def test_C28798177_WhiteBox_AddComponentToEntity(self, request, workspace, editor, launcher_platform):
|
||||
from . import C28798177_WhiteBox_AddComponentToEntity as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_C29279329_WhiteBox_SetDefaultShape(self, request, workspace, editor, launcher_platform):
|
||||
from . import C29279329_WhiteBox_SetDefaultShape as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_C28798205_WhiteBox_SetInvisible(self, request, workspace, editor, launcher_platform):
|
||||
from . import C28798205_WhiteBox_SetInvisible as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
@ -0,0 +1,35 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
|
||||
"""
|
||||
|
||||
# This suite consists of all test cases that are passing and have been verified.
|
||||
|
||||
import pytest
|
||||
import sys
|
||||
import os
|
||||
|
||||
from ly_test_tools import LAUNCHERS
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
|
||||
from base import TestAutomationBase
|
||||
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def test_WhiteBox_AddComponentToEntity(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import WhiteBox_AddComponentToEntity as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_WhiteBox_SetDefaultShape(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import WhiteBox_SetDefaultShape as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_WhiteBox_SetInvisible(self, request, workspace, editor, launcher_platform):
|
||||
from .tests import WhiteBox_SetInvisible as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
@ -0,0 +1,55 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
|
||||
# Test case ID : C28798177
|
||||
# Test Case Title : White Box Tool Component can be added to an Entity
|
||||
|
||||
|
||||
# fmt:off
|
||||
class Tests():
|
||||
white_box_entity_created = ("White box entity created", "Failed to create white box entity")
|
||||
white_box_component_enabled = ("White box component enabled", "Failed to enable white box component")
|
||||
# fmt:on
|
||||
|
||||
|
||||
def C28798177_WhiteBox_AddComponentToEntity():
|
||||
import os
|
||||
import sys
|
||||
from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init
|
||||
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.editor as editor
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
# open level
|
||||
helper.init_idle()
|
||||
general.open_level("EmptyLevel")
|
||||
|
||||
# create white box entity and attach component
|
||||
white_box_entity = init.create_white_box_entity()
|
||||
white_box_mesh_component = init.create_white_box_component(white_box_entity)
|
||||
init.create_white_box_handle(white_box_mesh_component)
|
||||
|
||||
# verify results
|
||||
entity_id = general.find_editor_entity('WhiteBox')
|
||||
Report.result(Tests.white_box_entity_created, entity_id.IsValid())
|
||||
|
||||
component_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', white_box_mesh_component)
|
||||
Report.result(Tests.white_box_component_enabled, component_enabled)
|
||||
|
||||
# close editor
|
||||
helper.close_editor()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C28798177_WhiteBox_AddComponentToEntity)
|
||||
@ -0,0 +1,104 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
|
||||
# Test case ID : C29279329
|
||||
# Test Case Title : White Box mesh shape can be changed with the Default Shape dropdown on the Component
|
||||
|
||||
|
||||
# fmt:off
|
||||
class Tests():
|
||||
default_shape_cube = ("Default shape set to cube", "Default shape is not set to cube")
|
||||
default_shape_tetrahedron = ("Default shape changed to tetrahedron", "Failed to change default shape to tetrahedron")
|
||||
default_shape_icosahedron = ("Default shape changed to icosahedron", "Failed to change default shape to icosahedron")
|
||||
default_shape_cylinder = ("Default shape changed to cylinder", "Failed to change default shape to cylinder")
|
||||
default_shape_sphere = ("Default shape changed to sphere", "Failed to change default shape to sphere")
|
||||
# fmt:on
|
||||
|
||||
critical_shape_check = ("Default shape has more than 0 sides", "default shape has 0 sides")
|
||||
|
||||
def C29279329_WhiteBox_SetDefaultShape():
|
||||
import os
|
||||
import sys
|
||||
from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init
|
||||
|
||||
import azlmbr.whitebox.api as api
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
def check_shape_result(success_fail_tuple, condition):
|
||||
result = Report.result(success_fail_tuple, condition)
|
||||
if not result:
|
||||
face_count = white_box_handle.MeshFaceCount()
|
||||
Report.critical_result(critical_shape_check, face_count > 0)
|
||||
Report.info(f"Face count = {face_count}")
|
||||
|
||||
shape_types = azlmbr.globals.property
|
||||
|
||||
# expected results
|
||||
expected_results = {
|
||||
shape_types.CUBE: 12,
|
||||
shape_types.TETRAHEDRON: 4,
|
||||
shape_types.ICOSAHEDRON: 20,
|
||||
shape_types.CYLINDER: 64,
|
||||
shape_types.SPHERE: 320
|
||||
}
|
||||
|
||||
# open level
|
||||
helper.init_idle()
|
||||
general.open_level("EmptyLevel")
|
||||
|
||||
# create white box entity and attach component
|
||||
white_box_entity = init.create_white_box_entity()
|
||||
white_box_mesh_component = init.create_white_box_component(white_box_entity)
|
||||
white_box_handle = init.create_white_box_handle(white_box_mesh_component)
|
||||
|
||||
# verify results
|
||||
# cube
|
||||
check_shape_result(
|
||||
Tests.default_shape_cube,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.CUBE))
|
||||
|
||||
# tetrahedron
|
||||
azlmbr.whitebox.request.bus.EditorWhiteBoxComponentRequestBus(
|
||||
bus.Event, 'SetDefaultShape', white_box_mesh_component, shape_types.TETRAHEDRON)
|
||||
check_shape_result(
|
||||
Tests.default_shape_tetrahedron,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.TETRAHEDRON))
|
||||
|
||||
# icosahedron
|
||||
azlmbr.whitebox.request.bus.EditorWhiteBoxComponentRequestBus(
|
||||
bus.Event, 'SetDefaultShape', white_box_mesh_component, shape_types.ICOSAHEDRON)
|
||||
check_shape_result(
|
||||
Tests.default_shape_icosahedron,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.ICOSAHEDRON))
|
||||
|
||||
# cylinder
|
||||
azlmbr.whitebox.request.bus.EditorWhiteBoxComponentRequestBus(
|
||||
bus.Event, 'SetDefaultShape', white_box_mesh_component, shape_types.CYLINDER)
|
||||
check_shape_result(
|
||||
Tests.default_shape_cylinder,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.CYLINDER))
|
||||
|
||||
# sphere
|
||||
azlmbr.whitebox.request.bus.EditorWhiteBoxComponentRequestBus(
|
||||
bus.Event, 'SetDefaultShape', white_box_mesh_component, shape_types.SPHERE)
|
||||
check_shape_result(
|
||||
Tests.default_shape_sphere,
|
||||
white_box_handle.MeshFaceCount() == expected_results.get(shape_types.SPHERE))
|
||||
|
||||
# close editor
|
||||
helper.close_editor()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C29279329_WhiteBox_SetDefaultShape)
|
||||
@ -0,0 +1,65 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
# fmt:off
|
||||
class Tests():
|
||||
white_box_initially_visible = ("White box initially invisible", "White box not initially invisible")
|
||||
white_box_set_to_invisible = ("White box set to invisible", "Failed to set white box to invisible")
|
||||
# fmt:on
|
||||
|
||||
|
||||
def C28798205_WhiteBox_SetInvisible():
|
||||
# note: This automated test does not fully replicate the test case in Test Rail as it's
|
||||
# not currently possible using the Hydra API to get an EntityComponentIdPair at runtime,
|
||||
# in future game_mode will be activated and a runtime White Box Component queried
|
||||
import os
|
||||
import sys
|
||||
from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init
|
||||
import editor_python_test_tools.hydra_editor_utils as hydra
|
||||
|
||||
import azlmbr.whitebox.api as api
|
||||
import azlmbr.whitebox
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.editor as editor
|
||||
import azlmbr.entity as entity
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
|
||||
# open level
|
||||
helper.init_idle()
|
||||
general.open_level("EmptyLevel")
|
||||
|
||||
white_box_entity_name = 'WhiteBox-Visibility'
|
||||
white_box_visibility_path = 'White Box Material|Visible'
|
||||
|
||||
# create white box entity and attach component
|
||||
white_box_entity = init.create_white_box_entity(white_box_entity_name)
|
||||
white_box_mesh_component = init.create_white_box_component(white_box_entity)
|
||||
|
||||
# verify preconditions
|
||||
visible_property = hydra.get_component_property_value(white_box_mesh_component, white_box_visibility_path)
|
||||
Report.result(Tests.white_box_initially_visible, visible_property)
|
||||
|
||||
# verify setting visibility
|
||||
editor.EditorComponentAPIBus(bus.Broadcast, "SetComponentProperty", white_box_mesh_component, white_box_visibility_path, False)
|
||||
visible_property = hydra.get_component_property_value(white_box_mesh_component, white_box_visibility_path)
|
||||
Report.result(Tests.white_box_set_to_invisible, not visible_property)
|
||||
|
||||
helper.close_editor()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(C28798205_WhiteBox_SetInvisible)
|
||||
@ -0,0 +1,43 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
from base import TestAutomationBase
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def remove_test_level(request, workspace, project):
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True)
|
||||
|
||||
def teardown():
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True)
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform,
|
||||
remove_test_level):
|
||||
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False)
|
||||
|
||||
@pytest.mark.REQUIRES_gpu
|
||||
def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform,
|
||||
remove_test_level):
|
||||
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False,
|
||||
use_null_renderer=False)
|
||||
@ -0,0 +1,75 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
|
||||
|
||||
|
||||
@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.")
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomationNoAutoTestMode(EditorTestSuite):
|
||||
|
||||
# Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests
|
||||
# interact with modal dialogs
|
||||
global_extra_cmdline_args = []
|
||||
|
||||
class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest):
|
||||
# Custom teardown to remove slice asset created during test
|
||||
def teardown(self, request, workspace, editor, editor_test_results, launcher_platform):
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")],
|
||||
True, True)
|
||||
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
|
||||
|
||||
@pytest.mark.REQUIRES_gpu
|
||||
class test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(EditorSingleTest):
|
||||
# Disable null renderer
|
||||
use_null_renderer = False
|
||||
|
||||
# Custom teardown to remove slice asset created during test
|
||||
def teardown(self, request, workspace, editor, editor_test_results, launcher_platform):
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")],
|
||||
True, True)
|
||||
from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module
|
||||
|
||||
class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest):
|
||||
from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
|
||||
|
||||
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
|
||||
class test_AssetPicker_UI_UX(EditorSharedTest):
|
||||
from .EditorScripts import AssetPicker_UI_UX as test_module
|
||||
|
||||
|
||||
@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.")
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomationAutoTestMode(EditorTestSuite):
|
||||
|
||||
# Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
|
||||
global_extra_cmdline_args = ["-autotest_mode"]
|
||||
|
||||
class test_AssetBrowser_TreeNavigation(EditorSharedTest):
|
||||
from .EditorScripts import AssetBrowser_TreeNavigation as test_module
|
||||
|
||||
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
|
||||
class test_AssetBrowser_SearchFiltering(EditorSharedTest):
|
||||
from .EditorScripts import AssetBrowser_SearchFiltering as test_module
|
||||
|
||||
class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest):
|
||||
from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module
|
||||
|
||||
class test_Menus_ViewMenuOptions_Work(EditorSharedTest):
|
||||
from .EditorScripts import Menus_ViewMenuOptions as test_module
|
||||
|
||||
@pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208")
|
||||
class test_Menus_FileMenuOptions_Work(EditorSharedTest):
|
||||
from .EditorScripts import Menus_FileMenuOptions as test_module
|
||||
@ -0,0 +1,62 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
from base import TestAutomationBase
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def remove_test_level(request, workspace, project):
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True)
|
||||
|
||||
def teardown():
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True)
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AssetBrowser_TreeNavigation as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
|
||||
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
|
||||
def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AssetBrowser_SearchFiltering as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
|
||||
@pytest.mark.skip(reason="Crashes Editor: ATOM-15493")
|
||||
def test_AssetPicker_UI_UX(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import AssetPicker_UI_UX as test_module
|
||||
self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False)
|
||||
|
||||
def test_ComponentCRUD_Add_Delete_Components(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
|
||||
def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False)
|
||||
|
||||
def test_Menus_ViewMenuOptions_Work(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Menus_ViewMenuOptions as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
|
||||
@pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208")
|
||||
def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Menus_FileMenuOptions as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
@ -0,0 +1,27 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
from base import TestAutomationBase
|
||||
|
||||
|
||||
@pytest.mark.SUITE_sandbox
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Menus_EditMenuOptions as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
|
||||
def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform):
|
||||
from .EditorScripts import Docking_BasicDockedTools as test_module
|
||||
self._run_test(request, workspace, editor, test_module, batch_mode=False)
|
||||
@ -0,0 +1,26 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
|
||||
|
||||
|
||||
@pytest.mark.SUITE_sandbox
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomationAutoTestMode(EditorTestSuite):
|
||||
|
||||
# Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions
|
||||
global_extra_cmdline_args = ["-autotest_mode"]
|
||||
|
||||
class test_Docking_BasicDockedTools(EditorSharedTest):
|
||||
from .EditorScripts import Docking_BasicDockedTools as test_module
|
||||
|
||||
class test_Menus_EditMenuOptions_Work(EditorSharedTest):
|
||||
from .EditorScripts import Menus_EditMenuOptions as test_module
|
||||
@ -1,89 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
"""
|
||||
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 editor_python_test_tools.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,
|
||||
)
|
||||
@ -1,74 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
"""
|
||||
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 editor_python_test_tools.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
|
||||
@pytest.mark.xfail # ATOM-15493
|
||||
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,
|
||||
)
|
||||
@ -1,96 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
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 ly_test_tools._internal.pytest_plugin as internal_plugin
|
||||
import editor_python_test_tools.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 TestBasicEditorWorkflows(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("C6351273", "C6384955", "C16929880", "C15167490", "C15167491")
|
||||
@pytest.mark.SUITE_main
|
||||
def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, editor, level, launcher_platform):
|
||||
|
||||
# Skip test if running against Debug build
|
||||
if "debug" in internal_plugin.build_directory:
|
||||
pytest.skip("Does not execute against debug builds.")
|
||||
|
||||
expected_lines = [
|
||||
"Create and load new level: True",
|
||||
"New entity creation: True",
|
||||
"Create entity hierarchy: True",
|
||||
"Add component: True",
|
||||
"Component update: True",
|
||||
"Remove component: True",
|
||||
"Save and Export: True",
|
||||
"BasicEditorWorkflows_LevelEntityComponent: result=SUCCESS",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
test_directory,
|
||||
editor,
|
||||
"BasicEditorWorkflows_LevelEntityComponentCRUD.py",
|
||||
expected_lines,
|
||||
cfg_args=[level],
|
||||
timeout=log_monitor_timeout,
|
||||
auto_test_mode=False
|
||||
)
|
||||
|
||||
@pytest.mark.test_case_id("C6351273", "C6384955", "C16929880", "C15167490", "C15167491")
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.REQUIRES_gpu
|
||||
def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, editor, level, launcher_platform):
|
||||
|
||||
# Skip test if running against Debug build
|
||||
if "debug" in internal_plugin.build_directory:
|
||||
pytest.skip("Does not execute against debug builds.")
|
||||
|
||||
expected_lines = [
|
||||
"Create and load new level: True",
|
||||
"New entity creation: True",
|
||||
"Create entity hierarchy: True",
|
||||
"Add component: True",
|
||||
"Component update: True",
|
||||
"Remove component: True",
|
||||
"Save and Export: True",
|
||||
"BasicEditorWorkflows_LevelEntityComponent: result=SUCCESS",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
test_directory,
|
||||
editor,
|
||||
"BasicEditorWorkflows_LevelEntityComponentCRUD.py",
|
||||
expected_lines,
|
||||
cfg_args=[level],
|
||||
timeout=log_monitor_timeout,
|
||||
auto_test_mode=False,
|
||||
null_renderer=False
|
||||
)
|
||||
@ -1,62 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
"""
|
||||
C16929880: Add Delete Components
|
||||
"""
|
||||
|
||||
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 editor_python_test_tools.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 TestComponentCRUD(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("C16929880", "C16877220")
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.BAT
|
||||
def test_ComponentCRUD_Add_Delete_Components(self, request, editor, level, launcher_platform):
|
||||
expected_lines = [
|
||||
"Entity Created",
|
||||
"Box Shape found",
|
||||
"Box Shape Component added: True",
|
||||
"Mesh found",
|
||||
"Mesh Component added: True",
|
||||
"Mesh Component deleted: True",
|
||||
"Mesh Component deletion undone: True",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
test_directory,
|
||||
editor,
|
||||
"ComponentCRUD_Add_Delete_Components.py",
|
||||
expected_lines,
|
||||
cfg_args=[level],
|
||||
auto_test_mode=False,
|
||||
timeout=log_monitor_timeout
|
||||
)
|
||||
@ -1,55 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
|
||||
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 editor_python_test_tools.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_sandbox
|
||||
def test_Docking_BasicDockedTools(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,
|
||||
)
|
||||
@ -1,66 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
"""
|
||||
C1506881: Adding/Removing Event Groups
|
||||
"""
|
||||
|
||||
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 editor_python_test_tools.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 TestInputBindings(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("C1506881")
|
||||
@pytest.mark.SUITE_periodic
|
||||
def test_InputBindings_Add_Remove_Input_Events(self, request, editor, level, launcher_platform):
|
||||
expected_lines = [
|
||||
"Asset Editor opened: True",
|
||||
"New Event Groups added when + is clicked",
|
||||
"Event Group deleted when the Delete button is clicked on an Event Group",
|
||||
"All event groups deleted on clicking the Delete button",
|
||||
"Asset Editor closed: True",
|
||||
]
|
||||
|
||||
unexpected_lines = [
|
||||
"Asset Editor opened: False",
|
||||
"Asset Editor closed: False",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
test_directory,
|
||||
editor,
|
||||
"InputBindings_Add_Remove_Input_Events.py",
|
||||
expected_lines,
|
||||
unexpected_lines=unexpected_lines,
|
||||
cfg_args=[level],
|
||||
run_python="--runpython",
|
||||
auto_test_mode=False,
|
||||
timeout=log_monitor_timeout,
|
||||
)
|
||||
@ -1,132 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
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 ly_test_tools.environment.process_utils as process_utils
|
||||
import editor_python_test_tools.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)
|
||||
process_utils.kill_processes_named("o3de", ignore_extensions=True) # Kill ProjectManager windows
|
||||
|
||||
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_sandbox
|
||||
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",
|
||||
"Global Preferences Action triggered",
|
||||
"Editor Settings Manager 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",
|
||||
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",
|
||||
"Configure Layout Action triggered",
|
||||
"Go to Position Action triggered",
|
||||
"Center on Selection Action triggered",
|
||||
"Go to Location Action triggered",
|
||||
"Remember Location 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],
|
||||
run_python="--runpython",
|
||||
timeout=log_monitor_timeout
|
||||
)
|
||||
|
||||
@pytest.mark.test_case_id("C16780778")
|
||||
@pytest.mark.SUITE_sandbox
|
||||
@pytest.mark.xfail # LYN-4208
|
||||
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",
|
||||
"Edit Project Settings Action triggered",
|
||||
"Edit Platform Settings Action triggered",
|
||||
"New Project Action triggered",
|
||||
"Open Project 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],
|
||||
run_python="--runpython",
|
||||
timeout=log_monitor_timeout
|
||||
)
|
||||
@ -0,0 +1,56 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite
|
||||
|
||||
|
||||
@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.")
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(EditorTestSuite):
|
||||
|
||||
class test_GradientGenerators_Incompatibilities(EditorSharedTest):
|
||||
from .EditorScripts import GradientGenerators_Incompatibilities as test_module
|
||||
|
||||
class test_GradientModifiers_Incompatibilities(EditorSharedTest):
|
||||
from .EditorScripts import GradientModifiers_Incompatibilities as test_module
|
||||
|
||||
class test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(EditorSharedTest):
|
||||
from .EditorScripts import GradientPreviewSettings_DefaultPinnedEntityIsSelf as test_module
|
||||
|
||||
class test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(EditorSharedTest):
|
||||
from .EditorScripts import GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin as test_module
|
||||
|
||||
class test_GradientSampling_GradientReferencesAddRemoveSuccessfully(EditorSharedTest):
|
||||
from .EditorScripts import GradientSampling_GradientReferencesAddRemoveSuccessfully as test_module
|
||||
|
||||
class test_GradientSurfaceTagEmitter_ComponentDependencies(EditorSharedTest):
|
||||
from .EditorScripts import GradientSurfaceTagEmitter_ComponentDependencies as test_module
|
||||
|
||||
class test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(EditorSharedTest):
|
||||
from .EditorScripts import GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully as test_module
|
||||
|
||||
class test_GradientTransform_RequiresShape(EditorSharedTest):
|
||||
from .EditorScripts import GradientTransform_RequiresShape as test_module
|
||||
|
||||
class test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(EditorSharedTest):
|
||||
from .EditorScripts import GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange as test_module
|
||||
|
||||
class test_GradientTransform_ComponentIncompatibleWithSpawners(EditorSharedTest):
|
||||
from .EditorScripts import GradientTransform_ComponentIncompatibleWithSpawners as test_module
|
||||
|
||||
class test_GradientTransform_ComponentIncompatibleWithExpectedGradients(EditorSharedTest):
|
||||
from .EditorScripts import GradientTransform_ComponentIncompatibleWithExpectedGradients as test_module
|
||||
|
||||
class test_ImageGradient_RequiresShape(EditorSharedTest):
|
||||
from .EditorScripts import ImageGradient_RequiresShape as test_module
|
||||
|
||||
class test_ImageGradient_ProcessedImageAssignedSuccessfully(EditorSharedTest):
|
||||
from .EditorScripts import ImageGradient_ProcessedImageAssignedSuccessfully as test_module
|
||||
@ -1,103 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
|
||||
"""
|
||||
Tests that the Gradient Generator components are incompatible with Vegetation Area components
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
pytest.importorskip('ly_test_tools')
|
||||
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
import editor_python_test_tools.hydra_test_utils as hydra
|
||||
|
||||
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
|
||||
|
||||
gradient_generators = [
|
||||
'Altitude Gradient',
|
||||
'Constant Gradient',
|
||||
'FastNoise Gradient',
|
||||
'Image Gradient',
|
||||
'Perlin Noise Gradient',
|
||||
'Random Noise Gradient',
|
||||
'Shape Falloff Gradient',
|
||||
'Slope Gradient',
|
||||
'Surface Mask Gradient'
|
||||
]
|
||||
|
||||
gradient_modifiers = [
|
||||
'Dither Gradient Modifier',
|
||||
'Gradient Mixer',
|
||||
'Invert Gradient Modifier',
|
||||
'Levels Gradient Modifier',
|
||||
'Posterize Gradient Modifier',
|
||||
'Smooth-Step Gradient Modifier',
|
||||
'Threshold Gradient Modifier'
|
||||
]
|
||||
|
||||
vegetation_areas = [
|
||||
'Vegetation Layer Spawner',
|
||||
'Vegetation Layer Blender',
|
||||
'Vegetation Layer Blocker',
|
||||
'Vegetation Layer Blocker (Mesh)'
|
||||
]
|
||||
|
||||
all_gradients = gradient_modifiers + gradient_generators
|
||||
|
||||
|
||||
@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 TestGradientIncompatibilities(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)
|
||||
|
||||
@pytest.mark.test_case_id('C2691648', 'C2691649', 'C2691650', 'C2691651',
|
||||
'C2691653', 'C2691656', 'C2691657', 'C2691658',
|
||||
'C2691647', 'C2691655')
|
||||
@pytest.mark.SUITE_periodic
|
||||
def test_GradientGenerators_Incompatibilities(self, request, editor, level, launcher_platform):
|
||||
cfg_args = [level]
|
||||
|
||||
expected_lines = []
|
||||
for gradient_generator in gradient_generators:
|
||||
for vegetation_area in vegetation_areas:
|
||||
expected_lines.append(f"{gradient_generator} is disabled before removing {vegetation_area} component")
|
||||
expected_lines.append(f"{gradient_generator} is enabled after removing {vegetation_area} component")
|
||||
expected_lines.append("GradientGeneratorIncompatibilities: result=SUCCESS")
|
||||
hydra.launch_and_validate_results(request, test_directory, editor,
|
||||
'GradientGenerators_Incompatibilities.py',
|
||||
expected_lines=expected_lines, cfg_args=cfg_args)
|
||||
|
||||
@pytest.mark.test_case_id('C3416464', 'C3416546', 'C3961318', 'C3961319',
|
||||
'C3961323', 'C3961324', 'C3980656', 'C3980657',
|
||||
'C3980661', 'C3980662', 'C3980666', 'C3980667',
|
||||
'C2691652')
|
||||
@pytest.mark.SUITE_periodic
|
||||
def test_GradientModifiers_Incompatibilities(self, request, editor, level, launcher_platform):
|
||||
cfg_args = [level]
|
||||
|
||||
expected_lines = []
|
||||
for gradient_modifier in gradient_modifiers:
|
||||
for vegetation_area in vegetation_areas:
|
||||
expected_lines.append(f"{gradient_modifier} is disabled before removing {vegetation_area} component")
|
||||
expected_lines.append(f"{gradient_modifier} is enabled after removing {vegetation_area} component")
|
||||
|
||||
for conflicting_gradient in all_gradients:
|
||||
expected_lines.append(f"{gradient_modifier} is disabled before removing {conflicting_gradient} component")
|
||||
expected_lines.append(f"{gradient_modifier} is enabled after removing {conflicting_gradient} component")
|
||||
expected_lines.append("GradientModifiersIncompatibilities: result=SUCCESS")
|
||||
hydra.launch_and_validate_results(request, test_directory, editor,
|
||||
'GradientModifiers_Incompatibilities.py',
|
||||
expected_lines=expected_lines, cfg_args=cfg_args)
|
||||
@ -1,118 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
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 editor_python_test_tools.hydra_test_utils as hydra
|
||||
|
||||
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
|
||||
|
||||
|
||||
@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 TestGradientPreviewSettings(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('C3980668', 'C2676825', 'C2676828', 'C2676822', 'C3416547', 'C3961320', 'C3961325',
|
||||
'C3980658', 'C3980663')
|
||||
@pytest.mark.SUITE_periodic
|
||||
def test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(self, request, editor, level, launcher_platform):
|
||||
|
||||
expected_lines = [
|
||||
"Perlin Noise Gradient has Preview pinned to own Entity result: SUCCESS",
|
||||
"Random Noise Gradient has Preview pinned to own Entity result: SUCCESS",
|
||||
"FastNoise Gradient has Preview pinned to own Entity result: SUCCESS",
|
||||
"Dither Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
|
||||
"Invert Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
|
||||
"Levels Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
|
||||
"Posterize Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
|
||||
"Smooth-Step Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
|
||||
"Threshold Gradient Modifier has Preview pinned to own Entity result: SUCCESS",
|
||||
"GradientPreviewSettings_DefaultPinnedEntity: result=SUCCESS"
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
test_directory,
|
||||
editor,
|
||||
"GradientPreviewSettings_DefaultPinnedEntityIsSelf.py",
|
||||
expected_lines,
|
||||
cfg_args=[level]
|
||||
)
|
||||
|
||||
@pytest.mark.test_case_id("C2676829", "C3961326", "C3980659", "C3980664", "C3980669", "C3416548", "C2676823",
|
||||
"C3961321", "C2676826")
|
||||
@pytest.mark.SUITE_periodic
|
||||
def test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(self, request, editor, level,
|
||||
launcher_platform):
|
||||
|
||||
expected_lines = [
|
||||
"Random Noise Gradient entity Created",
|
||||
"Entity has a Random Noise Gradient component",
|
||||
"Entity has a Gradient Transform Modifier component",
|
||||
"Entity has a Box Shape component",
|
||||
"Random Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS",
|
||||
"Random Noise Gradient --- Preview Position set to world origin",
|
||||
"Random Noise Gradient --- Preview Size set to (1, 1, 1)",
|
||||
"Levels Gradient Modifier entity Created",
|
||||
"Entity has a Levels Gradient Modifier component",
|
||||
"Levels Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
|
||||
"Levels Gradient Modifier --- Preview Position set to world origin",
|
||||
"Posterize Gradient Modifier entity Created",
|
||||
"Entity has a Posterize Gradient Modifier component",
|
||||
"Posterize Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
|
||||
"Posterize Gradient Modifier --- Preview Position set to world origin",
|
||||
"Smooth-Step Gradient Modifier entity Created",
|
||||
"Entity has a Smooth-Step Gradient Modifier component",
|
||||
"Smooth-Step Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
|
||||
"Smooth-Step Gradient Modifier --- Preview Position set to world origin",
|
||||
"Threshold Gradient Modifier entity Created",
|
||||
"Entity has a Threshold Gradient Modifier component",
|
||||
"Threshold Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
|
||||
"Threshold Gradient Modifier --- Preview Position set to world origin",
|
||||
"FastNoise Gradient entity Created",
|
||||
"Entity has a FastNoise Gradient component",
|
||||
"FastNoise Gradient Preview Settings|Pin Preview to Shape: SUCCESS",
|
||||
"FastNoise Gradient --- Preview Position set to world origin",
|
||||
"FastNoise Gradient --- Preview Size set to (1, 1, 1)",
|
||||
"Dither Gradient Modifier entity Created",
|
||||
"Entity has a Dither Gradient Modifier component",
|
||||
"Dither Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
|
||||
"Dither Gradient Modifier --- Preview Position set to world origin",
|
||||
"Dither Gradient Modifier --- Preview Size set to (1, 1, 1)",
|
||||
"Invert Gradient Modifier entity Created",
|
||||
"Entity has a Invert Gradient Modifier component",
|
||||
"Invert Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS",
|
||||
"Invert Gradient Modifier --- Preview Position set to world origin",
|
||||
"Perlin Noise Gradient entity Created",
|
||||
"Entity has a Perlin Noise Gradient component",
|
||||
"Perlin Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS",
|
||||
"Perlin Noise Gradient --- Preview Position set to world origin",
|
||||
"Perlin Noise Gradient --- Preview Size set to (1, 1, 1)",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
test_directory,
|
||||
editor,
|
||||
"GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py",
|
||||
expected_lines,
|
||||
cfg_args=[level]
|
||||
)
|
||||
@ -1,86 +0,0 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import logging
|
||||
|
||||
# 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 editor_python_test_tools.hydra_test_utils as hydra
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
|
||||
|
||||
|
||||
@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 TestGradientSampling(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("C3526311")
|
||||
@pytest.mark.SUITE_periodic
|
||||
def test_GradientSampling_GradientReferencesAddRemoveSuccessfully(self, request, editor, level, launcher_platform):
|
||||
|
||||
expected_lines = [
|
||||
"Entity has a Random Noise Gradient component",
|
||||
"Entity has a Gradient Transform Modifier component",
|
||||
"Entity has a Box Shape component",
|
||||
"Entity has a Dither Gradient Modifier component",
|
||||
"Gradient Generator is pinned to the Dither Gradient Modifier successfully",
|
||||
"Gradient Generator is cleared from the Dither Gradient Modifier successfully",
|
||||
"Entity has a Invert Gradient Modifier component",
|
||||
"Gradient Generator is pinned to the Invert Gradient Modifier successfully",
|
||||
"Gradient Generator is cleared from the Invert Gradient Modifier successfully",
|
||||
"Entity has a Levels Gradient Modifier component",
|
||||
"Gradient Generator is pinned to the Levels Gradient Modifier successfully",
|
||||
"Gradient Generator is cleared from the Levels Gradient Modifier successfully",
|
||||
"Entity has a Posterize Gradient Modifier component",
|
||||
"Gradient Generator is pinned to the Posterize Gradient Modifier successfully",
|
||||
"Gradient Generator is cleared from the Posterize Gradient Modifier successfully",
|
||||
"Entity has a Smooth-Step Gradient Modifier component",
|
||||
"Gradient Generator is pinned to the Smooth-Step Gradient Modifier successfully",
|
||||
"Gradient Generator is cleared from the Smooth-Step Gradient Modifier successfully",
|
||||
"Entity has a Threshold Gradient Modifier component",
|
||||
"Gradient Generator is pinned to the Threshold Gradient Modifier successfully",
|
||||
"Gradient Generator is cleared from the Threshold Gradient Modifier successfully",
|
||||
]
|
||||
|
||||
unexpected_lines = [
|
||||
"Failed to pin Gradient Generator to the Dither Gradient Modifier",
|
||||
"Failed to clear Gradient Generator from the Dither Gradient Modifier",
|
||||
"Failed to pin Gradient Generator to the Invert Gradient Modifier",
|
||||
"Failed to clear Gradient Generator from the Invert Gradient Modifier",
|
||||
"Failed to pin Gradient Generator to the Levels Gradient Modifier",
|
||||
"Failed to clear Gradient Generator from the Levels Gradient Modifier",
|
||||
"Failed to pin Gradient Generator to the Posterize Gradient Modifier",
|
||||
"Failed to clear Gradient Generator from the Posterize Gradient Modifier",
|
||||
"Failed to pin Gradient Generator to the Smooth-Step Gradient Modifier",
|
||||
"Failed to clear Gradient Generator from the Smooth-Step Gradient Modifier",
|
||||
"Failed to pin Gradient Generator to the Threshold Gradient Modifier",
|
||||
"Failed to clear Gradient Generator from the Threshold Gradient Modifier",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
test_directory,
|
||||
editor,
|
||||
"GradientSampling_GradientReferencesAddRemoveSuccessfully.py",
|
||||
expected_lines,
|
||||
unexpected_lines,
|
||||
cfg_args=[level]
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue