From 764cd52c267494077d2c3a4e671594ba1cccbf54 Mon Sep 17 00:00:00 2001 From: AMZN-AlexOteiza <82234181+AMZN-AlexOteiza@users.noreply.github.com> Date: Mon, 26 Apr 2021 21:06:01 +0100 Subject: [PATCH] Fixed whitebox tests using correct imports Fixed whitebox tests using correct imports Co-authored-by: aljanru --- .../Gem/PythonTests/CMakeLists.txt | 33 +++++++++---------- ...C28798177_WhiteBox_AddComponentToEntity.py | 10 ++++-- .../C28798205_WhiteBox_SetInvisible.py | 10 ++++-- .../C29279329_WhiteBox_SetDefaultShape.py | 10 ++++-- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt index 9a46f656cf..260d5ea1b1 100644 --- a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt @@ -95,23 +95,22 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) endif() ## White Box ## -# DISABLED - See LYN-2663 -#if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) -# ly_add_pytest( -# NAME AutomatedTesting::WhiteBoxTests -# TEST_SUITE main -# TEST_SERIAL -# PATH ${CMAKE_CURRENT_LIST_DIR}/WhiteBox/TestSuite_Active.py -# TIMEOUT 3600 -# RUNTIME_DEPENDENCIES -# Legacy::Editor -# Legacy::CryRenderNULL -# AZ::AssetProcessor -# AutomatedTesting.Assets -# COMPONENT -# WhiteBox -# ) -#endif() +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::WhiteBoxTests + TEST_SUITE main + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/WhiteBox/TestSuite_Active.py + TIMEOUT 3600 + RUNTIME_DEPENDENCIES + Legacy::Editor + Legacy::CryRenderNULL + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + WhiteBox + ) +endif() ## NvCloth ## # [TODO LYN-1928] Enable when AutomatedTesting runs with Atom diff --git a/AutomatedTesting/Gem/PythonTests/WhiteBox/C28798177_WhiteBox_AddComponentToEntity.py b/AutomatedTesting/Gem/PythonTests/WhiteBox/C28798177_WhiteBox_AddComponentToEntity.py index 252126674c..dabc04575f 100755 --- a/AutomatedTesting/Gem/PythonTests/WhiteBox/C28798177_WhiteBox_AddComponentToEntity.py +++ b/AutomatedTesting/Gem/PythonTests/WhiteBox/C28798177_WhiteBox_AddComponentToEntity.py @@ -22,10 +22,10 @@ class Tests(): # fmt:on -def run(): +def C28798177_WhiteBox_AddComponentToEntity(): import os import sys - import WhiteBoxInit as init + from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init import ImportPathHelper as imports imports.init() @@ -58,4 +58,8 @@ def run(): if __name__ == "__main__": - run() + import ImportPathHelper as imports + imports.init() + + from editor_python_test_tools.utils import Report + Report.start_test(C28798177_WhiteBox_AddComponentToEntity) diff --git a/AutomatedTesting/Gem/PythonTests/WhiteBox/C28798205_WhiteBox_SetInvisible.py b/AutomatedTesting/Gem/PythonTests/WhiteBox/C28798205_WhiteBox_SetInvisible.py index b7c6719721..18a5c3164e 100755 --- a/AutomatedTesting/Gem/PythonTests/WhiteBox/C28798205_WhiteBox_SetInvisible.py +++ b/AutomatedTesting/Gem/PythonTests/WhiteBox/C28798205_WhiteBox_SetInvisible.py @@ -22,13 +22,13 @@ class Tests(): # fmt:on -def run(): +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 - import WhiteBoxInit as init + 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() @@ -68,4 +68,8 @@ def run(): if __name__ == "__main__": - run() + import ImportPathHelper as imports + imports.init() + + from editor_python_test_tools.utils import Report + Report.start_test(C28798205_WhiteBox_SetInvisible) diff --git a/AutomatedTesting/Gem/PythonTests/WhiteBox/C29279329_WhiteBox_SetDefaultShape.py b/AutomatedTesting/Gem/PythonTests/WhiteBox/C29279329_WhiteBox_SetDefaultShape.py index 0b0a081186..e892285dde 100755 --- a/AutomatedTesting/Gem/PythonTests/WhiteBox/C29279329_WhiteBox_SetDefaultShape.py +++ b/AutomatedTesting/Gem/PythonTests/WhiteBox/C29279329_WhiteBox_SetDefaultShape.py @@ -26,10 +26,10 @@ class Tests(): critical_shape_check = ("Default shape has more than 0 sides", "default shape has 0 sides") -def run(): +def C29279329_WhiteBox_SetDefaultShape(): import os import sys - import WhiteBoxInit as init + from Gems.WhiteBox.Editor.Scripts import WhiteBoxInit as init import ImportPathHelper as imports imports.init() @@ -107,4 +107,8 @@ def run(): if __name__ == "__main__": - run() + import ImportPathHelper as imports + imports.init() + + from editor_python_test_tools.utils import Report + Report.start_test(C29279329_WhiteBox_SetDefaultShape)