From 1696fec9dbcd30fccb7261deee9d5f28b0753226 Mon Sep 17 00:00:00 2001 From: femi Date: Wed, 1 Jun 2022 11:52:48 +0100 Subject: [PATCH] feat(@DesktopApp): SignUp Scenario (Squish Test) Ticket: https://github.com/status-im/status-desktop/issues/5718 Include script to erase data file before each test --- test/ui-test/src/common/Common.py | 1 + test/ui-test/src/drivers/SquishDriver.py | 12 +----------- .../src/drivers/SquishDriverVerification.py | 17 +++++++++++++++++ test/ui-test/src/screens/StatusWelcomeScreen.py | 8 ++++---- 4 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 test/ui-test/src/drivers/SquishDriverVerification.py diff --git a/test/ui-test/src/common/Common.py b/test/ui-test/src/common/Common.py index 08f3415bb1..4c435f5349 100644 --- a/test/ui-test/src/common/Common.py +++ b/test/ui-test/src/common/Common.py @@ -1,5 +1,6 @@ from drivers.SquishDriver import * +from drivers.SquishDriverVerification import * diff --git a/test/ui-test/src/drivers/SquishDriver.py b/test/ui-test/src/drivers/SquishDriver.py index 91a3c4ea57..dd0913121d 100755 --- a/test/ui-test/src/drivers/SquishDriver.py +++ b/test/ui-test/src/drivers/SquishDriver.py @@ -34,16 +34,6 @@ def is_loaded_visible_and_enabled(objName, timeout=_MAX_WAIT_OBJ_TIMEOUT): except LookupError: return False, obj - -def verify_screen_is_loaded(objName, timeout=_MAX_WAIT_OBJ_TIMEOUT): - result = is_loaded_visible_and_enabled(objName, timeout) - test.verify(result, True) - - -def verify_object_not_enabled(objName, timeout=_MIN_WAIT_OBJ_TIMEOUT): - result = is_loaded_visible_and_enabled(objName, timeout) - test.verify(result, False) - # Waits for the given object is loaded and might be not visible and/or not enabled: # It returns a tuple: True in case it is found. Otherwise, false. And the object itself. def is_loaded(objName): @@ -92,7 +82,7 @@ def check_obj_by_name(objName): return False -def verify_text(objName, text): +def is_text_matching(objName, text): try: obj = squish.waitForObject(getattr(names, objName)) test.compare(obj.text, text, "Found the following text " + text) diff --git a/test/ui-test/src/drivers/SquishDriverVerification.py b/test/ui-test/src/drivers/SquishDriverVerification.py new file mode 100644 index 0000000000..c70c8d6266 --- /dev/null +++ b/test/ui-test/src/drivers/SquishDriverVerification.py @@ -0,0 +1,17 @@ +from drivers.SquishDriver import * + +# The default maximum timeout to find ui object +_MAX_WAIT_OBJ_TIMEOUT = 5000 + +# The default minimum timeout to find ui object +_MIN_WAIT_OBJ_TIMEOUT = 500 + + +def verify_screen_is_loaded(objName, timeout=_MAX_WAIT_OBJ_TIMEOUT): + result = is_loaded_visible_and_enabled(objName, timeout) + test.verify(result, True) + + +def verify_object_not_enabled(objName, timeout=_MIN_WAIT_OBJ_TIMEOUT): + result = is_loaded_visible_and_enabled(objName, timeout) + test.verify(result, False) diff --git a/test/ui-test/src/screens/StatusWelcomeScreen.py b/test/ui-test/src/screens/StatusWelcomeScreen.py index 8548bcfdd3..23a8e58d6e 100644 --- a/test/ui-test/src/screens/StatusWelcomeScreen.py +++ b/test/ui-test/src/screens/StatusWelcomeScreen.py @@ -9,6 +9,7 @@ # *****************************************************************************/ from enum import Enum from drivers.SquishDriver import * +from drivers.SquishDriverVerification import * class AgreementPopUp(Enum): @@ -52,7 +53,8 @@ class StatusWelcomeScreen: self.input_confirmation_password(password) - self.input_password_again(password) + self.input_password(password) + click_obj_by_name(SignUpComponents.FINALIZE_PASSWORD_STEP.value) click_obj_by_name(SignUpComponents.PASSWORD_PREFERENCE.value) @@ -68,6 +70,4 @@ class StatusWelcomeScreen: type(SignUpComponents.PASSWORD_CONFIRM_INPUT.value, password) click_obj_by_name(SignUpComponents.CREATE_PASSWORD.value) - def input_password_again(self, password): - type(SignUpComponents.PASSWORD_INPUT.value, password) - click_obj_by_name(SignUpComponents.FINALIZE_PASSWORD_STEP.value) +