From 4aa5ba4eca245fcc177bdd799c4a92c448a4ec59 Mon Sep 17 00:00:00 2001 From: Neil Widmaier Date: Mon, 31 Jan 2022 15:08:03 -0800 Subject: [PATCH] Making minor fixes, and cycling through light types Signed-off-by: Neil Widmaier --- .../hydra_AtomEditorComponents_GridAdded.py | 16 +++++++------- .../hydra_AtomEditorComponents_LightAdded.py | 21 ++++++++++--------- ...a_AtomEditorComponents_PhysicalSkyAdded.py | 6 +++--- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GridAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GridAdded.py index 31061f1044..3a58ec80b1 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GridAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_GridAdded.py @@ -63,13 +63,13 @@ def AtomEditorComponents_Grid_AddedToEntity(): 3) UNDO the entity creation and component addition. 4) REDO the entity creation and component addition. 5) Grid Size changed. - 5) Enter/Exit game mode. - 6) Test IsHidden. - 7) Test IsVisible. - 8) Delete Grid entity. - 9) UNDO deletion. - 10) REDO deletion. - 11) Look for errors. + 6) Enter/Exit game mode. + 7) Test IsHidden. + 8) Test IsVisible. + 9) Delete Grid entity. + 10) UNDO deletion. + 11) REDO deletion. + 12) Look for errors. :return: None """ @@ -123,7 +123,7 @@ def AtomEditorComponents_Grid_AddedToEntity(): general.idle_wait_frames(1) Report.result(Tests.creation_redo, grid_entity.exists()) - # 5. Grid Size changed (default is 32, changed to 64) + # 5. Grid Size changed grid_component.set_component_property_value( AtomComponentProperties.grid('Grid Size'), value=64) current_grid_size = grid_component.get_component_property_value( diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightAdded.py index f7c789c151..f0dfd32b81 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightAdded.py @@ -27,9 +27,6 @@ class Tests: light_component = ( "Entity has a Light component", "Entity failed to find Light component") - light_type_value = ( - "Light type value set", - "Light type value could not be set") enter_game_mode = ( "Entered game mode", "Failed to enter game mode") @@ -71,7 +68,7 @@ def AtomEditorComponents_Light_AddedToEntity(): 2) Add Light component to the Light entity. 3) UNDO the entity creation and component addition. 4) REDO the entity creation and component addition. - 5) Set the light type to sphere. + 5) Cycle through all light types. 6) Enter/Exit game mode. 7) Test IsHidden. 8) Test IsVisible. @@ -128,12 +125,16 @@ def AtomEditorComponents_Light_AddedToEntity(): general.idle_wait_frames(1) Report.result(Tests.creation_redo, light_entity.exists()) - # 5. Set the light type to sphere - light_component.set_component_property_value( - AtomComponentProperties.light('Light type'), LIGHT_TYPES['sphere']) - current_light_type = light_component.get_component_property_value( - AtomComponentProperties.light('Light type')) - Report.result(Tests.light_type_value, current_light_type == LIGHT_TYPES['sphere']) + # 5. Cycle through all light types. + for ltype, value in LIGHT_TYPES.items(): + light_component.set_component_property_value( + AtomComponentProperties.light('Light type'), LIGHT_TYPES[ltype]) + current_light_type = light_component.get_component_property_value( + AtomComponentProperties.light('Light type')) + test_shape = ( + f"Light component has {ltype} type set", + f"Light component failed to set {ltype} type") + Report.result(test_shape, current_light_type == LIGHT_TYPES[ltype]) # 6. Enter/Exit game mode. TestHelper.enter_game_mode(Tests.enter_game_mode) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PhysicalSkyAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PhysicalSkyAdded.py index 39dd0d15a5..1970e38d83 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PhysicalSkyAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_PhysicalSkyAdded.py @@ -28,7 +28,7 @@ class Tests: "Entity has a Physical Sky component", "Entity failed to find Physical Sky component") sky_intensity = ( - "Sky Intensity value set to 2", + "Sky Intensity value updated successfully", "Sky Intensity value could not be set") enter_game_mode = ( "Entered game mode", @@ -71,7 +71,7 @@ def AtomEditorComponents_PhysicalSky_AddedToEntity(): 2) Add Physical Sky component to Physical Sky entity. 3) UNDO the entity creation and component addition. 4) REDO the entity creation and component addition. - 5) Set Sky Intensity to a value of 2. + 5) Update Sky Intensity value. 6) Enter/Exit game mode. 7) Test IsHidden. 8) Test IsVisible. @@ -130,7 +130,7 @@ def AtomEditorComponents_PhysicalSky_AddedToEntity(): general.idle_wait_frames(1) Report.result(Tests.creation_redo, physical_sky_entity.exists()) - # 5. Set Sky Intensity to a value of 2 (default value is 4) + # 5. Set Sky Intensity value physical_sky_component.set_component_property_value( AtomComponentProperties.physical_sky('Sky Intensity'), value=2) current_sky_intensity = physical_sky_component.get_component_property_value(