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 03:43:53 +01:00 committed by Iuri Matias
parent edc48d2168
commit 88a7a5f3f7
6 changed files with 120 additions and 54 deletions

View File

@ -17,10 +17,15 @@ import names
import test
# 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
# Waits for the given object is loaded, visible and enabled.
# It returns a tuple: True in case it is found. Otherwise, false. And the object itself.
def is_loaded_visible_and_enabled(objName, timeout=_MAX_WAIT_OBJ_TIMEOUT):
obj = None
try:
@ -39,7 +44,8 @@ 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):
obj = None
try:
@ -48,18 +54,18 @@ def is_loaded(objName):
except LookupError:
return False, obj
# It checks if the given object is visible and enabled.
def is_visible_and_enabled(obj):
return obj.visible and obj.enabled
# Given a specific object, get a specific child.
def get_child(obj, child_index=None):
if None == child_index:
return object.children(obj)
else:
return object.children(obj)[child_index]
# It executes the click action into the given object:
def click_obj(obj):
try:
squish.mouseClick(obj, squish.Qt.LeftButton)
@ -67,7 +73,7 @@ def click_obj(obj):
except LookupError:
return False
# It executes the click action into object with given object name:
def click_obj_by_name(objName):
try:
obj = squish.waitForObject(getattr(names, objName))
@ -94,7 +100,7 @@ def verify_text(objName, text):
except LookupError:
return False
# It types the specified text into the given object (as if the user had used the keyboard):
def type(objName, text):
try:
obj = squish.findObject(getattr(names, objName))

View File

@ -1,6 +1,6 @@
#******************************************************************************
# ******************************************************************************
# Status.im
#*****************************************************************************/
# *****************************************************************************/
# /**
# * \file StatusWelcomeScreen.py
# *
@ -33,32 +33,41 @@ class SignUpComponents(Enum):
PASSWORD_PREFERENCE = "mainWindow_I_prefer_to_use_my_password_StatusBaseText"
class StatusWelcomeScreen():
class StatusWelcomeScreen:
def __init__(self):
verify_screen_is_loaded(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value)
def agree_terms_conditions_and_generate_new_key(self):
def agree_terms_conditions_and_generate_new_key(self):
click_obj_by_name(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value)
check_obj_by_name(AgreementPopUp.TERMS_OF_USE_CHECK_BOX.value)
click_obj_by_name(AgreementPopUp.GET_STARTED_BUTTON.value)
click_obj_by_name(SignUpComponents.NEW_TO_STATUS.value)
click_obj_by_name(SignUpComponents.GENERATE_NEW_KEYS.value)
def input_username_and_password_and_finalize_sign_up(self, username, password):
self.input_username(username)
self.input_password(password)
self.input_confirmation_password(password)
self.input_password_again(password)
click_obj_by_name(SignUpComponents.PASSWORD_PREFERENCE.value)
def input_username(self, username):
type(SignUpComponents.USERNAME_INPUT.value, username)
click_obj_by_name(SignUpComponents.NEXT_BUTTON.value)
click_obj_by_name(SignUpComponents.NEXT_STATUS_BUTTON.value)
click_obj_by_name(SignUpComponents.NEW_PASSWORD_BUTTON.value)
def input_password(self, password):
type(SignUpComponents.PASSWORD_INPUT.value, password)
click_obj_by_name(SignUpComponents.CONFIRM_PASSWORD.value)
def input_confirmation_password(self, password):
type(SignUpComponents.PASSWORD_CONFIRM_INPUT.value, password)
click_obj_by_name(SignUpComponents.CREATE_PASSWORD.value)
click_obj_by_name(SignUpComponents.CONFIRM_PASSWORD_AGAIN.value)
def input_password_again(self, password):
type(SignUpComponents.PASSWORD_INPUT.value, password)
click_obj_by_name(SignUpComponents.FINALIZE_PASSWORD_STEP.value)
click_obj_by_name(SignUpComponents.PASSWORD_PREFERENCE.value)

View File

@ -2,16 +2,22 @@
from screens.StatusWelcomeScreen import StatusWelcomeScreen
from screens.StatusChatScreen import StatusChatScreen
welcomeScreen = StatusWelcomeScreen()
_welcomeScreen = StatusWelcomeScreen()
@Given("A first time user lands on the status desktop and generates new key")
def step(context):
welcomeScreen.agree_terms_conditions_and_generate_new_key()
_welcomeScreen.agree_terms_conditions_and_generate_new_key()
@When("user inputs username |any| and password |any|")
def step(context, username, password):
welcomeScreen.input_username_and_password_and_finalize_sign_up(username, password)
_welcomeScreen.input_username_and_password_and_finalize_sign_up(username, password)
@When("the user inputs username |any|")
def step(context, username):
_welcomeScreen.input_username(username)
@Then("the user lands on the signed in app")

View File

@ -22,11 +22,16 @@ def step(context):
startApplication("nim_status_client")
@When("user inputs the following |any| with object locator |any|")
@When("user inputs the following |any| with ui-component |any|")
def step(context, text, obj):
input_text(text, obj)
@When("user clicks on the following ui-component |any|")
def step(context, obj):
click_on_an_object(obj)
@Then("the following object locator |any| is not enabled")
@Then("the following ui-component |any| is not enabled")
def step(context, obj):
object_not_enabled(obj)

View File

@ -30,13 +30,16 @@ Feature: Status Desktop login
| Granular_Diligent| TesTEr16843/!@22 |
#Scenario Outline: User tries to login with an invalid password
Scenario Outline: User tries to login with an invalid password
#Given A Status Desktop <account> and <password>
# When the user tries to login with invalid credentials
# Then the user is NOT able to login to Status Desktop application
#Examples:
# | account | password |
#| Athletic_Prime | Invalid34 |
#| Granular_Diligent | Testpwd |
#| Nervous_Pesky | WrongPSW |
Given A first time user lands on the status desktop and generates new key
When user inputs username <account> and password <password>
Given the application is restarted
Given A Status Desktop <account> and <wrongpassword>
When the user tries to login with invalid credentials
Then the user is NOT able to login to Status Desktop application
Examples:
| account | password | wrongpassword |
| Athletic_Prime | TesTEr16843/!@00 | Invalid34 |
| Granular_Diligent | TesTEr16843/!@11 | Testpwd |
| Nervous_Pesky | TesTEr16843/!@22 | WrongPSW |

View File

@ -11,28 +11,65 @@
Feature: Status Desktop Sign Up
As a user I want to Sign-up into the Status Desktop application.
As a user I want to Sign-up into the Status Desktop application.
The following scenarios cover Sign up process.
The following scenarios cover Sign up process.
Scenario: User signs up and signs in with password
Given A first time user lands on the status desktop and generates new key
When user inputs username tester123 and password TesTEr16843/!@00
Then the user lands on the signed in app
Scenario: User signs up and signs in with password
Given A first time user lands on the status desktop and generates new key
When user inputs username tester123 and password TesTEr16843/!@00
Then the user lands on the signed in app
Scenario Outline: User cannot sign up with wrong username format
Scenario Outline: User cannot sign up with wrong username format
Given A first time user lands on the status desktop and generates new key
When user inputs the following <username> with ui-component mainWindow_edit_TextEdit
Then the following ui-component mainWindow_Next_StatusBaseText is not enabled
Given A first time user lands on the status desktop and generates new key
When user inputs the following <username> with object locator mainWindow_edit_TextEdit
Then the following object locator mainWindow_Next_StatusBaseText is not enabled
Examples:
| username |
| Athl |
| Nervo |
| Gra |
|tester3@ |
Examples:
| username |
| Athl |
| Nervo |
| Gra |
| tester3@ |
Scenario Outline: User cannot sign up with wrong password format
Given A first time user lands on the status desktop and generates new key
When the user inputs username <username>
# Input wrong password format in both new password and confirmation input and verify create password button is not enabled
When user inputs the following <wrongpassword> with ui-component loginView_passwordInput
And user inputs the following <wrongpassword> with ui-component mainWindow_inputValue_StyledTextField
Then the following ui-component mainWindow_Create_password_StatusBaseText is not enabled
# Input right password format in new password input but incorrect in confirmation password input and verify create password button is not enabled
When user inputs the following <password> with ui-component loginView_passwordInput
And user inputs the following <wrongpassword> with ui-component mainWindow_inputValue_StyledTextField
Then the following ui-component mainWindow_Create_password_StatusBaseText is not enabled
Examples:
| username | wrongpassword | password |
| tester123 | Invalid34 | TesTEr16843/!@00 |
| tester124 | badP | TesTEr16843/!@01 |
| tester124 | bad2!s | TesTEr16843/!@01 |
Scenario Outline: User cannot finish Sign Up and Sign In process with wrong password
Given A first time user lands on the status desktop and generates new key
When the user inputs username <username>
# Input correct password format in both new password and confirmation input
When user inputs the following <password> with ui-component loginView_passwordInput
And user inputs the following <password> with ui-component mainWindow_inputValue_StyledTextField
And user clicks on the following ui-component mainWindow_Create_password_StatusBaseText
# Input wrong password in final password input and verify password creation button is not enabled
When user inputs the following <wrongpassword> with ui-component loginView_passwordInput
Then the following ui-component mainWindow_Finalise_Status_Password_Creation_StatusBaseText is not enabled
Examples:
| username | wrongpassword | password |
| tester123 | Invalid34 | TesTEr16843/!@00 |
| tester123 | TesTEr16843/!@) | TesTEr16843/!@01 |