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
This commit is contained in:
femi 2022-06-01 11:52:48 +01:00 committed by Iuri Matias
parent 88a7a5f3f7
commit 1696fec9db
4 changed files with 23 additions and 15 deletions

View File

@ -1,5 +1,6 @@
from drivers.SquishDriver import * from drivers.SquishDriver import *
from drivers.SquishDriverVerification import *

View File

@ -34,16 +34,6 @@ def is_loaded_visible_and_enabled(objName, timeout=_MAX_WAIT_OBJ_TIMEOUT):
except LookupError: except LookupError:
return False, obj 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: # 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. # It returns a tuple: True in case it is found. Otherwise, false. And the object itself.
def is_loaded(objName): def is_loaded(objName):
@ -92,7 +82,7 @@ def check_obj_by_name(objName):
return False return False
def verify_text(objName, text): def is_text_matching(objName, text):
try: try:
obj = squish.waitForObject(getattr(names, objName)) obj = squish.waitForObject(getattr(names, objName))
test.compare(obj.text, text, "Found the following text " + text) test.compare(obj.text, text, "Found the following text " + text)

View File

@ -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)

View File

@ -9,6 +9,7 @@
# *****************************************************************************/ # *****************************************************************************/
from enum import Enum from enum import Enum
from drivers.SquishDriver import * from drivers.SquishDriver import *
from drivers.SquishDriverVerification import *
class AgreementPopUp(Enum): class AgreementPopUp(Enum):
@ -52,7 +53,8 @@ class StatusWelcomeScreen:
self.input_confirmation_password(password) 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) click_obj_by_name(SignUpComponents.PASSWORD_PREFERENCE.value)
@ -68,6 +70,4 @@ class StatusWelcomeScreen:
type(SignUpComponents.PASSWORD_CONFIRM_INPUT.value, password) type(SignUpComponents.PASSWORD_CONFIRM_INPUT.value, password)
click_obj_by_name(SignUpComponents.CREATE_PASSWORD.value) 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)