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-05-26 01:28:49 +01:00 committed by Iuri Matias
parent 2be85fd6a5
commit 734ad54c47
4 changed files with 27 additions and 1 deletions

View File

@ -7,6 +7,8 @@
# * \date May 2022 # * \date May 2022
# * \brief Sign Up and Login for new users to the app. # * \brief Sign Up and Login for new users to the app.
# *****************************************************************************/ # *****************************************************************************/
from enum import Enum
from drivers.SquishDriver import *
class AgreementPopUp(Enum): class AgreementPopUp(Enum):
@ -37,7 +39,6 @@ class StatusWelcomeScreen():
verify_screen_is_loaded(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value) 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):
verify_text(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value, "I acknowledge that Status Desktop is in Beta and by using it, I take the full responsibility for all risks concerning my data and funds.")
click_obj_by_name(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value) click_obj_by_name(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value)
check_obj_by_name(AgreementPopUp.TERMS_OF_USE_CHECK_BOX.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(AgreementPopUp.GET_STARTED_BUTTON.value)

View File

@ -0,0 +1,13 @@
import os, shutil
import os.path as path
def erase_directory(dir):
directory = path.abspath(path.join(__file__ , "../../../../../" + dir))
if (os.path.isdir(directory)):
print(directory)
try:
shutil.rmtree(directory)
except OSError:
os.remove(directory)

View File

@ -1,13 +1,18 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# This file contains hook functions to run as the .feature file is executed. # This file contains hook functions to run as the .feature file is executed.
from utils.FileManager import *
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/")) sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/"))
_statusDektopAppName = "nim_status_client" _statusDektopAppName = "nim_status_client"
_appClosureTimeout = 2 #[seconds] _appClosureTimeout = 2 #[seconds]
@OnScenarioStart @OnScenarioStart
def hook(context): def hook(context):
erase_directory("Status/data")
startApplication(_statusDektopAppName) startApplication(_statusDektopAppName)
context.userData = {} context.userData = {}

View File

@ -31,3 +31,10 @@ mainWindow_Create_password_StatusBaseText = {"container": statusDesktop_mainWind
mainWindow_Confirm_you_password_again_PlaceholderText = {"container": statusDesktop_mainWindow, "text": "Confirm you password (again)", "type": "PlaceholderText", "unnamed": 1, "visible": True} mainWindow_Confirm_you_password_again_PlaceholderText = {"container": statusDesktop_mainWindow, "text": "Confirm you password (again)", "type": "PlaceholderText", "unnamed": 1, "visible": True}
mainWindow_Finalise_Status_Password_Creation_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Finalise Status Password Creation", "type": "StatusBaseText", "unnamed": 1, "visible": True} mainWindow_Finalise_Status_Password_Creation_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Finalise Status Password Creation", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_I_prefer_to_use_my_password_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "I prefer to use my password", "type": "StatusBaseText", "unnamed": 1, "visible": True} mainWindow_I_prefer_to_use_my_password_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "I prefer to use my password", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_Enter_password_PlaceholderText = {"container": statusDesktop_mainWindow, "text": "Enter password", "type": "PlaceholderText", "unnamed": 1, "visible": True}
mainWindow_button_StatusButton = {"container": statusDesktop_mainWindow, "id": "button", "type": "StatusButton", "unnamed": 1, "visible": True}
mainWindow_Username_must_be_at_least_5_characters_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Username must be at least 5 characters", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_Passwords_don_t_match_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Passwords don't match", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_inputRectangle_Rectangle = {"container": statusDesktop_mainWindow, "id": "inputRectangle", "occurrence": 2, "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_inputRectangle_Rectangle_2 = {"container": statusDesktop_mainWindow, "id": "inputRectangle", "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_You_will_not_be_able_to_recover_this_password_if_it_is_lost_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "You will not be able to recover this password if it is lost.", "type": "StatusBaseText", "unnamed": 1, "visible": True}