test(suite_wallet): tests updated according to the changes applied to add account modal popup

This commit is contained in:
Sale Djenic 2022-10-28 18:59:53 +02:00 committed by saledjenic
parent 2c03146309
commit 250a193f91
1 changed files with 22 additions and 17 deletions

View File

@ -69,7 +69,6 @@ class AddAccountPopup(Enum):
TYPE_PRIVATE_KEY: str = "mainWallet_Add_Account_Popup_Type_Private_Key"
ADDRESS_INPUT: str = "mainWallet_Add_Account_Popup_Watch_Only_Address"
PRIVATE_KEY_INPUT: str = "mainWallet_Add_Account_Popup_Private_Key"
AUTHENTICATE_BUTTON: str = "mainWallet_Authenticate_Popup_Footer_Add_Account"
ADD_ACCOUNT_BUTTON: str = "mainWallet_Add_Account_Popup_Footer_Add_Account"
SEED_PHRASE_INPUT_TEMPLATE: str = "mainWindow_Add_Account_Popup_Seed_Phrase_"
@ -99,46 +98,45 @@ class StatusWalletScreen:
def add_watch_only_account(self, account_name: str, address: str):
click_obj_by_name(MainWalletScreen.ADD_ACCOUNT_BUTTON.value)
type(AddAccountPopup.ACCOUNT_NAME_INPUT.value, account_name)
click_obj_by_name(AddAccountPopup.ADVANCE_SECTION.value)
click_obj_by_name(AddAccountPopup.TYPE_SELECTOR.value)
time.sleep(1)
click_obj_by_name(AddAccountPopup.TYPE_WATCH_ONLY.value)
type(AddAccountPopup.ACCOUNT_NAME_INPUT.value, account_name)
type(AddAccountPopup.ADDRESS_INPUT.value, address)
click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value)
def import_private_key(self, account_name: str, password: str, private_key: str):
click_obj_by_name(MainWalletScreen.ADD_ACCOUNT_BUTTON.value)
click_obj_by_name(AddAccountPopup.AUTHENTICATE_BUTTON.value)
wait_for_object_and_type(SharedPopup.PASSWORD_INPUT.value, password)
click_obj_by_name(SharedPopup.PRIMARY_BUTTON.value)
type(AddAccountPopup.ACCOUNT_NAME_INPUT.value, account_name)
click_obj_by_name(AddAccountPopup.ADVANCE_SECTION.value)
click_obj_by_name(AddAccountPopup.TYPE_SELECTOR.value)
time.sleep(1)
click_obj_by_name(AddAccountPopup.TYPE_PRIVATE_KEY.value)
type(AddAccountPopup.ACCOUNT_NAME_INPUT.value, account_name)
type(AddAccountPopup.PRIVATE_KEY_INPUT.value, private_key)
click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value)
wait_for_object_and_type(SharedPopup.PASSWORD_INPUT.value, password)
click_obj_by_name(SharedPopup.PRIMARY_BUTTON.value)
time.sleep(5)
def import_seed_phrase(self, account_name: str, password: str, mnemonic: str):
click_obj_by_name(MainWalletScreen.ADD_ACCOUNT_BUTTON.value)
click_obj_by_name(AddAccountPopup.AUTHENTICATE_BUTTON.value)
wait_for_object_and_type(SharedPopup.PASSWORD_INPUT.value, password)
click_obj_by_name(SharedPopup.PRIMARY_BUTTON.value)
type(AddAccountPopup.ACCOUNT_NAME_INPUT.value, account_name)
click_obj_by_name(AddAccountPopup.ADVANCE_SECTION.value)
click_obj_by_name(AddAccountPopup.TYPE_SELECTOR.value)
time.sleep(1)
click_obj_by_name(AddAccountPopup.TYPE_SEED_PHRASE.value)
type(AddAccountPopup.ACCOUNT_NAME_INPUT.value, account_name)
words = mnemonic.split()
scroll_obj_by_name(AddAccountPopup.SCROLL_BAR.value)
@ -158,18 +156,25 @@ class StatusWalletScreen:
click_obj_by_name(MainWalletScreen.MAILSERVER_RETRY.value)
click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value)
wait_for_object_and_type(SharedPopup.PASSWORD_INPUT.value, password)
click_obj_by_name(SharedPopup.PRIMARY_BUTTON.value)
time.sleep(5)
def generate_new_account(self, account_name: str, password: str):
click_obj_by_name(MainWalletScreen.ADD_ACCOUNT_BUTTON.value)
click_obj_by_name(AddAccountPopup.AUTHENTICATE_BUTTON.value)
type(AddAccountPopup.ACCOUNT_NAME_INPUT.value, account_name)
time.sleep(1)
click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value)
wait_for_object_and_type(SharedPopup.PASSWORD_INPUT.value, password)
click_obj_by_name(SharedPopup.PRIMARY_BUTTON.value)
type(AddAccountPopup.ACCOUNT_NAME_INPUT.value, account_name)
click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value)
time.sleep(5)
def verify_account_name_is_present(self, account_name: str):
verify_text_matching(MainWalletScreen.ACCOUNT_NAME.value, account_name)