From 9591123b7ec97eb8822d79cdb9122359d362a965 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 3 Aug 2022 13:31:59 -0400 Subject: [PATCH] test(onboarding): fix signup with seed phrase tests Fixes #6744 --- test/ui-test/src/common/SeedUtils.py | 35 +++++ test/ui-test/src/drivers/SquishDriver.py | 10 ++ .../src/drivers/SquishDriverVerification.py | 9 +- test/ui-test/src/screens/SettingsScreen.py | 15 +-- .../ui-test/src/screens/StatusWalletScreen.py | 35 +---- .../src/screens/StatusWelcomeScreen.py | 32 +++-- .../shared/scripts/sections/login_names.py | 4 +- .../scripts/sections/onboarding_names.py | 34 ++++- .../shared/scripts/sections/settings_names.py | 7 +- .../shared/scripts/sections/wallet_names.py | 24 ++-- .../shared/steps/settingsSteps.py | 6 +- .../suite_status/shared/steps/signUpSteps.py | 14 +- .../tst_statusSignUp/test.feature | 124 ++---------------- .../AppLayouts/Onboarding/views/LoginView.qml | 3 + .../Onboarding/views/SeedPhraseInputView.qml | 6 +- .../Profile/views/wallet/MainView.qml | 1 + ui/imports/shared/controls/Input.qml | 1 + 17 files changed, 162 insertions(+), 198 deletions(-) create mode 100644 test/ui-test/src/common/SeedUtils.py diff --git a/test/ui-test/src/common/SeedUtils.py b/test/ui-test/src/common/SeedUtils.py new file mode 100644 index 0000000000..104ad2219a --- /dev/null +++ b/test/ui-test/src/common/SeedUtils.py @@ -0,0 +1,35 @@ + +from drivers.SquishDriver import * +from drivers.SquishDriverVerification import * + + +def input_seed_phrase(input_object_name: str, words: str): + type(input_object_name + "1", words[0]) + type(input_object_name + "2", words[1]) + type(input_object_name + "3", words[2]) + type(input_object_name + "4", words[3]) + type(input_object_name + "5", words[4]) + type(input_object_name + "6", words[5]) + type(input_object_name + "7", words[6]) + type(input_object_name + "8", words[7]) + type(input_object_name + "9", words[8]) + type(input_object_name + "10", words[9]) + type(input_object_name + "11", words[10]) + type(input_object_name + "12", words[11]) + + if len(words) >= 18: + type(input_object_name + "13", words[12]) + type(input_object_name + "14", words[13]) + type(input_object_name + "15", words[14]) + type(input_object_name + "16", words[15]) + type(input_object_name + "17", words[16]) + type(input_object_name + "18", words[17]) + + if len(words) == 24: + type(input_object_name + "19", words[18]) + type(input_object_name + "20", words[19]) + type(input_object_name + "21", words[20]) + type(input_object_name + "22", words[21]) + type(input_object_name + "23", words[22]) + type(input_object_name + "24", words[23]) + diff --git a/test/ui-test/src/drivers/SquishDriver.py b/test/ui-test/src/drivers/SquishDriver.py index b37c1709b7..fbbb2246f0 100755 --- a/test/ui-test/src/drivers/SquishDriver.py +++ b/test/ui-test/src/drivers/SquishDriver.py @@ -122,6 +122,16 @@ def is_text_matching(objName: str, text: str): return False +def is_text_matching_insensitive(objName: str, text: str): + try: + obj = squish.waitForObject(getattr(names, objName)) + test.compare(obj.text.toLower(), text.lower(), "Found the following text " + text.lower()) + return True + except LookupError: + print(objName + " is not found, please check app for correct object and update object mapper") + return False + + # It types the specified text into the given object (as if the user had used the keyboard): def type(objName: str, text: str): try: diff --git a/test/ui-test/src/drivers/SquishDriverVerification.py b/test/ui-test/src/drivers/SquishDriverVerification.py index e4df14f501..6269ca7dc8 100644 --- a/test/ui-test/src/drivers/SquishDriverVerification.py +++ b/test/ui-test/src/drivers/SquishDriverVerification.py @@ -13,13 +13,16 @@ def verify_screen(objName: str, timeout: int=_MAX_WAIT_OBJ_TIMEOUT): def verify_object_enabled(objName: str, timeout: int=_MIN_WAIT_OBJ_TIMEOUT, condition: bool=True): result = is_loaded_visible_and_enabled(objName, timeout) - test.verify(result[0] == condition, "verify_object_enabled") + test.verify(result[0] == condition, "object not enabled") def verify_text_matching(objName: str, text: str): - test.verify(is_text_matching(objName, text), True) + test.verify(is_text_matching(objName, text), "text does not match") + +def verify_text_matching_insensitive(objName: str, text: str): + test.verify(is_text_matching_insensitive(objName, text), "text does not match") def verify_equal(result: object, expected: object): - test.verify(result == expected, "verify equal") + test.verify(result == expected, "objects are not equal") def verify(result: bool, msg: str): test.verify(result, msg) diff --git a/test/ui-test/src/screens/SettingsScreen.py b/test/ui-test/src/screens/SettingsScreen.py index 0fa5eeb3ad..9327a8db31 100644 --- a/test/ui-test/src/screens/SettingsScreen.py +++ b/test/ui-test/src/screens/SettingsScreen.py @@ -25,9 +25,7 @@ class AdvancedOptionScreen(Enum): class WalletSettingsScreen(Enum): - TWELVE_SEED_PHRASE: str = "twelve_seed_phrase_address" - EIGHTEEN_SEED_PHRASE: str = "eighteen_seed_phrase_address" - TWENTY_FOUR_SEED_PHRASE: str = "twenty_four_seed_phrase_address" + ACCOUNT_DELEGATE_WALLET_ADDRESS: str = "walletSettingsAccountDelegate_WalletAddress_Text" GENERATED_ACCOUNTS: str = "settings_Wallet_MainView_GeneratedAccounts" DELETE_ACCOUNT: str = "settings_Wallet_AccountView_DeleteAccount" DELETE_ACCOUNT_CONFIRM: str = "settings_Wallet_AccountView_DeleteAccount_Confirm" @@ -75,16 +73,9 @@ class SettingsScreen: index = self._find_account_index(account_name) verify_equal(index, -1) - def verify_address(self, phrase: str, address: str): - if phrase =='18': - verify_text_matching(WalletSettingsScreen.EIGHTEEN_SEED_PHRASE.value, address) + def verify_address(self, address: str): + verify_text_matching_insensitive(WalletSettingsScreen.ACCOUNT_DELEGATE_WALLET_ADDRESS.value, address) - if phrase == '24': - verify_text_matching(WalletSettingsScreen.TWENTY_FOUR_SEED_PHRASE.value, address) - - if phrase == '12': - verify_text_matching(WalletSettingsScreen.TWELVE_SEED_PHRASE.value, address) - def toggle_test_networks(self): click_obj_by_name(WalletSettingsScreen.NETWORKS_ITEM.value) click_obj_by_name(WalletSettingsScreen.TESTNET_TOGGLE.value) diff --git a/test/ui-test/src/screens/StatusWalletScreen.py b/test/ui-test/src/screens/StatusWalletScreen.py index 17b2af92f9..527a2af971 100644 --- a/test/ui-test/src/screens/StatusWalletScreen.py +++ b/test/ui-test/src/screens/StatusWalletScreen.py @@ -3,6 +3,7 @@ import time import sys from drivers.SquishDriver import * from drivers.SquishDriverVerification import * +from common.SeedUtils import * class SigningPhrasePopUp(Enum): @@ -49,18 +50,7 @@ class AddAccountPopup(Enum): ADDRESS_INPUT: str = "mainWallet_Add_Account_Popup_Watch_Only_Address" PRIVATE_KEY_INPUT: str = "mainWallet_Add_Account_Popup_Private_Key" ADD_ACCOUNT_BUTTON: str = "mainWallet_Add_Account_Popup_Footer_Add_Account" - SEED_PHRASE_INPUT_0: str = "mainWindow_Add_Account_Popup_Seed_Phrase_0" - SEED_PHRASE_INPUT_1: str = "mainWindow_Add_Account_Popup_Seed_Phrase_1" - SEED_PHRASE_INPUT_2: str = "mainWindow_Add_Account_Popup_Seed_Phrase_2" - SEED_PHRASE_INPUT_3: str = "mainWindow_Add_Account_Popup_Seed_Phrase_3" - SEED_PHRASE_INPUT_4: str = "mainWindow_Add_Account_Popup_Seed_Phrase_4" - SEED_PHRASE_INPUT_5: str = "mainWindow_Add_Account_Popup_Seed_Phrase_5" - SEED_PHRASE_INPUT_6: str = "mainWindow_Add_Account_Popup_Seed_Phrase_6" - SEED_PHRASE_INPUT_7: str = "mainWindow_Add_Account_Popup_Seed_Phrase_7" - SEED_PHRASE_INPUT_8: str = "mainWindow_Add_Account_Popup_Seed_Phrase_8" - SEED_PHRASE_INPUT_9: str = "mainWindow_Add_Account_Popup_Seed_Phrase_9" - SEED_PHRASE_INPUT_10: str = "mainWindow_Add_Account_Popup_Seed_Phrase_10" - SEED_PHRASE_INPUT_11: str = "mainWindow_Add_Account_Popup_Seed_Phrase_11" + SEED_PHRASE_INPUT_TEMPLATE: str = "mainWindow_Add_Account_Popup_Seed_Phrase_" class StatusWalletScreen: @@ -108,27 +98,16 @@ class StatusWalletScreen: words = mnemonic.split() scroll_obj_by_name(AddAccountPopup.SCROLL_BAR.value) - time.sleep(2) + time.sleep(1) scroll_obj_by_name(AddAccountPopup.SCROLL_BAR.value) - time.sleep(2) + time.sleep(1) scroll_obj_by_name(AddAccountPopup.SCROLL_BAR.value) - time.sleep(2) + time.sleep(1) - type(AddAccountPopup.SEED_PHRASE_INPUT_0.value, words[0]) - type(AddAccountPopup.SEED_PHRASE_INPUT_1.value, words[1]) - type(AddAccountPopup.SEED_PHRASE_INPUT_2.value, words[2]) - type(AddAccountPopup.SEED_PHRASE_INPUT_3.value, words[3]) - type(AddAccountPopup.SEED_PHRASE_INPUT_4.value, words[4]) - type(AddAccountPopup.SEED_PHRASE_INPUT_5.value, words[5]) - type(AddAccountPopup.SEED_PHRASE_INPUT_6.value, words[6]) - type(AddAccountPopup.SEED_PHRASE_INPUT_7.value, words[7]) - type(AddAccountPopup.SEED_PHRASE_INPUT_8.value, words[8]) - type(AddAccountPopup.SEED_PHRASE_INPUT_9.value, words[9]) - type(AddAccountPopup.SEED_PHRASE_INPUT_10.value, words[10]) - type(AddAccountPopup.SEED_PHRASE_INPUT_11.value, words[11]) - time.sleep(2) + input_seed_phrase(AddAccountPopup.SEED_PHRASE_INPUT_TEMPLATE.value, words) + time.sleep(1) click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value) diff --git a/test/ui-test/src/screens/StatusWelcomeScreen.py b/test/ui-test/src/screens/StatusWelcomeScreen.py index 2879cd2130..a3842b3ae4 100644 --- a/test/ui-test/src/screens/StatusWelcomeScreen.py +++ b/test/ui-test/src/screens/StatusWelcomeScreen.py @@ -8,10 +8,12 @@ # * \brief Sign Up and Login for new users to the app. # *****************************************************************************/ +from array import array from enum import Enum import sys from drivers.SquishDriver import * from drivers.SquishDriverVerification import * +from common.SeedUtils import * class AgreementPopUp(Enum): @@ -38,11 +40,12 @@ class SignUpComponents(Enum): class SeedPhraseComponents(Enum): IMPORT_A_SEED_TEXT: str = "import_a_seed_phrase_StatusBaseText" + INVALID_SEED_TEXT: str = "onboarding_InvalidSeed_Text" IMPORT_A_SEED_BUTTON: str = "keysMainView_PrimaryAction_Button" - TWELVE_WORDS_BUTTON: str = "switchTabBar_12_words_StatusBaseText" - EIGHTEEN_WORDS_BUTTON: str = "switchTabBar_18_words_StatusBaseText" - TWENTY_FOUR_BUTTON: str = "switchTabBar_24_words_StatusBaseText" - SEEDS_WORDS_TEXTFIELD: str = "mainWindow_placeholder_StatusBaseText" + TWELVE_WORDS_BUTTON: str = "switchTabBar_12_words_Button" + EIGHTEEN_WORDS_BUTTON: str = "switchTabBar_18_words_Button" + TWENTY_FOUR_BUTTON: str = "switchTabBar_24_words_Button" + SEEDS_WORDS_TEXTFIELD_template: str = "onboarding_SeedPhrase_Input_TextField_" SUBMIT_BUTTON: str = "seedPhraseView_Submit_Button" class StatusWelcomeScreen: @@ -59,17 +62,19 @@ class StatusWelcomeScreen: click_obj_by_name(SeedPhraseComponents.IMPORT_A_SEED_TEXT.value) click_obj_by_name(SeedPhraseComponents.IMPORT_A_SEED_BUTTON.value) - def input_seed_phrase(self, seed: str, words: str, occurrence: str): - if words =='18': - click_obj_by_name(SeedPhraseComponents.EIGHTEEN_WORDS_BUTTON.value) + def input_seed_phrase(self, seed_phrase: str): + words = seed_phrase.split() - if words == '24': - click_obj_by_name(SeedPhraseComponents.TWENTY_FOUR_BUTTON.value) - - if words == '12': + if len(words) == 12: click_obj_by_name(SeedPhraseComponents.TWELVE_WORDS_BUTTON.value) + elif len(words) == 18: + click_obj_by_name(SeedPhraseComponents.EIGHTEEN_WORDS_BUTTON.value) + elif len(words) == 24: + click_obj_by_name(SeedPhraseComponents.TWENTY_FOUR_BUTTON.value) + else: + test.fail("Wrong amount of seed words", len(words)) - type(SeedPhraseComponents.SEEDS_WORDS_TEXTFIELD.value, seed) + input_seed_phrase(SeedPhraseComponents.SEEDS_WORDS_TEXTFIELD_template.value, words) def input_username_and_password_and_finalize_sign_up(self, username: str, password: str): self.input_username(username) @@ -106,3 +111,6 @@ class StatusWelcomeScreen: verify_text_matching(SignUpComponents.WELCOME_TO_STATUS.value, "Welcome to Status") click_obj_by_name(SignUpComponents.NEW_TO_STATUS.value) + def seed_phrase_visible(self): + is_loaded_visible_and_enabled(SeedPhraseComponents.INVALID_SEED_TEXT.value) + diff --git a/test/ui-test/testSuites/suite_status/shared/scripts/sections/login_names.py b/test/ui-test/testSuites/suite_status/shared/scripts/sections/login_names.py index cf0524bc99..f586bb3ed0 100644 --- a/test/ui-test/testSuites/suite_status/shared/scripts/sections/login_names.py +++ b/test/ui-test/testSuites/suite_status/shared/scripts/sections/login_names.py @@ -3,8 +3,8 @@ from sections.global_names import * # Main: loginView_passwordInput = {"container": statusDesktop_mainWindow, "objectName": "loginPasswordInput", "type": "StyledTextField"} -loginView_changeAccountBtn = {"container": statusDesktop_mainWindow, "objectName": "changeAccountBtn", "type": "Rectangle"} +loginView_changeAccountBtn = {"container": statusDesktop_mainWindow, "objectName": "loginChangeAccountButton", "type": "StatusFlatRoundButton"} loginView_submitBtn = {"container": statusDesktop_mainWindow, "type": "StatusRoundButton", "visible": True} loginView_main = {"container": statusDesktop_mainWindow, "type": "LoginView", "visible": True} -loginView_errMsgLabel = {"container": statusDesktop_mainWindow, "id": "errMsg", "type": "StyledText", "visible": True} +loginView_errMsgLabel = {"container": statusDesktop_mainWindow, "objectName": "loginPassworkInputValidationErrorText", "type": "StatusBaseText", "visible": True} accountsView_accountListPanel = {"container": statusDesktop_mainWindow, "type": "ListView", "visible": True} # This probably is missing an objectName diff --git a/test/ui-test/testSuites/suite_status/shared/scripts/sections/onboarding_names.py b/test/ui-test/testSuites/suite_status/shared/scripts/sections/onboarding_names.py index ca97b22584..ba13230e75 100644 --- a/test/ui-test/testSuites/suite_status/shared/scripts/sections/onboarding_names.py +++ b/test/ui-test/testSuites/suite_status/shared/scripts/sections/onboarding_names.py @@ -20,10 +20,34 @@ mainWindow_Ok_got_it_StatusBaseText = {"container": statusDesktop_mainWindow, "t # Seed phrase form: import_a_seed_phrase_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Import a seed phrase", "type": "StatusBaseText", "unnamed": 1, "visible": True} -mainWindow_switchTabBar_StatusSwitchTabBar = {"container": statusDesktop_mainWindow, "id": "switchTabBar", "type": "StatusSwitchTabBar", "unnamed": 1, "visible": True} -switchTabBar_12_words_StatusBaseText = {"container": mainWindow_switchTabBar_StatusSwitchTabBar, "text": "12 words", "type": "StatusBaseText", "unnamed": 1, "visible": True} -switchTabBar_18_words_StatusBaseText = {"container": mainWindow_switchTabBar_StatusSwitchTabBar, "text": "18 words", "type": "StatusBaseText", "unnamed": 1, "visible": True} -switchTabBar_24_words_StatusBaseText = {"container": mainWindow_switchTabBar_StatusSwitchTabBar, "text": "24 words", "type": "StatusBaseText", "unnamed": 1, "visible": True} -mainWindow_placeholder_StatusBaseText = {"container": statusDesktop_mainWindow, "id": "placeholder", "type": "StatusBaseText", "unnamed": 1, "visible": True} +mainWindow_switchTabBar_StatusSwitchTabBar = {"container": statusDesktop_mainWindow, "objectName": "onboardingSeedPhraseSwitchBar", "type": "StatusSwitchTabBar"} +switchTabBar_12_words_Button = {"container": mainWindow_switchTabBar_StatusSwitchTabBar, "objectName": "12SeedButton", "type": "StatusSwitchTabButton"} +switchTabBar_18_words_Button = {"container": mainWindow_switchTabBar_StatusSwitchTabBar, "objectName": "18SeedButton", "type": "StatusSwitchTabButton"} +switchTabBar_24_words_Button = {"container": mainWindow_switchTabBar_StatusSwitchTabBar, "objectName": "24SeedButton", "type": "StatusSwitchTabButton"} seedPhraseView_Submit_Button = {"container": statusDesktop_mainWindow, "objectName": "seedPhraseViewSubmitButton", "type": "StatusButton"} +onboarding_InvalidSeed_Text = {"container": statusDesktop_mainWindow, "objectName": "onboardingInvalidSeedText", "type": "StatusBaseText"} +onboarding_SeedPhrase_Input_TextField_1 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField1"} +onboarding_SeedPhrase_Input_TextField_2 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField2"} +onboarding_SeedPhrase_Input_TextField_3 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField3"} +onboarding_SeedPhrase_Input_TextField_4 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField4"} +onboarding_SeedPhrase_Input_TextField_5 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField5"} +onboarding_SeedPhrase_Input_TextField_6 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField6"} +onboarding_SeedPhrase_Input_TextField_7 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField7"} +onboarding_SeedPhrase_Input_TextField_8 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField8"} +onboarding_SeedPhrase_Input_TextField_9 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField9"} +onboarding_SeedPhrase_Input_TextField_10 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField10"} +onboarding_SeedPhrase_Input_TextField_11 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField11"} +onboarding_SeedPhrase_Input_TextField_12 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField12"} +onboarding_SeedPhrase_Input_TextField_13 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField13"} +onboarding_SeedPhrase_Input_TextField_14 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField14"} +onboarding_SeedPhrase_Input_TextField_15 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField15"} +onboarding_SeedPhrase_Input_TextField_16 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField16"} +onboarding_SeedPhrase_Input_TextField_17 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField17"} +onboarding_SeedPhrase_Input_TextField_18 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField18"} +onboarding_SeedPhrase_Input_TextField_19 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField19"} +onboarding_SeedPhrase_Input_TextField_20 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField20"} +onboarding_SeedPhrase_Input_TextField_21 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField21"} +onboarding_SeedPhrase_Input_TextField_22 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField22"} +onboarding_SeedPhrase_Input_TextField_23 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField23"} +onboarding_SeedPhrase_Input_TextField_24 = {"container": statusDesktop_mainWindow, "type": "TextEdit", "objectName": "statusSeedPhraseInputField24"} diff --git a/test/ui-test/testSuites/suite_status/shared/scripts/sections/settings_names.py b/test/ui-test/testSuites/suite_status/shared/scripts/sections/settings_names.py index 0e3e65df8b..94d7556200 100644 --- a/test/ui-test/testSuites/suite_status/shared/scripts/sections/settings_names.py +++ b/test/ui-test/testSuites/suite_status/shared/scripts/sections/settings_names.py @@ -13,12 +13,13 @@ settings_Wallet_MainView_GeneratedAccounts = {"container": statusDesktop_mainWin settings_Wallet_AccountView_DeleteAccount = {"container": statusDesktop_mainWindow, "type": "StatusButton", "objectName": "deleteAccountButton"} settings_Wallet_AccountView_DeleteAccount_Confirm = {"container": statusDesktop_mainWindow, "type": "StatusButton", "objectName": "confirmDeleteAccountButton"} mainWindow_ScrollView_2 = {"container": statusDesktop_mainWindow, "occurrence": 2, "type": "StatusScrollView", "unnamed": 1, "visible": True} -twelve_seed_phrase_address = {"container": mainWindow_ScrollView_2, "text": "0x8285cb9bf17b23d64a489a8dad29163dd227d0fd", "type": "StatusBaseText", "unnamed": 1, "visible": True} -eighteen_seed_phrase_address = {"container": mainWindow_ScrollView_2, "text": "0xba1d0d6ef35df8751df5faf55ebd885ad0e877b0", "type": "StatusBaseText", "unnamed": 1, "visible": True} -twenty_four_seed_phrase_address = {"container": mainWindow_ScrollView_2, "text": "0x28cf6770664821a51984daf5b9fb1b52e6538e4b", "type": "StatusBaseText", "unnamed": 1, "visible": True} settings_Wallet_MainView_Networks = {"container": statusDesktop_mainWindow, "objectName": "networksItem", "type": "StatusListItem"} settings_Wallet_NetworksView_TestNet_Toggle = {"container": statusDesktop_mainWindow, "objectName": "testnetModeSwitch", "type": "StatusSwitch"} +generatedAccounts_ListView = {"container": statusDesktop_mainWindow, "objectName": "generatedAccounts", "type": "ListView"} +generatedAccounts_walletSettingsAccountDelegate_WalletAccountDelegate = {"container": generatedAccounts_ListView, "index": 0, "objectName": "walletSettingsAccountDelegate", "type": "WalletAccountDelegate"} +walletSettingsAccountDelegate_WalletAddress_Text = {"container": generatedAccounts_walletSettingsAccountDelegate_WalletAccountDelegate, "objectName": "statusListItemSubTitle", "type": "StatusBaseText"} + # Advanced Settings: walletSettingsLineButton = {"container": statusDesktop_mainWindow, "objectName": "WalletSettingsLineButton", "type": "StatusSettingsLineButton", "visible": True} i_understand_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "text": "I understand", "type": "StatusBaseText", "unnamed": 1, "visible": True} diff --git a/test/ui-test/testSuites/suite_status/shared/scripts/sections/wallet_names.py b/test/ui-test/testSuites/suite_status/shared/scripts/sections/wallet_names.py index 7ae8b38dc0..6d29c4a171 100644 --- a/test/ui-test/testSuites/suite_status/shared/scripts/sections/wallet_names.py +++ b/test/ui-test/testSuites/suite_status/shared/scripts/sections/wallet_names.py @@ -31,18 +31,18 @@ mainWallet_Add_Account_Popup_Type_Seed_Phrase = {"container": statusDesktop_main mainWallet_Add_Account_Popup_Account_Name = {"container": mainWallet_Add_Account_Popup_Main, "text": "Enter an account name...", "type": "StatusBaseText", "unnamed": 1, "visible": True} mainWallet_Add_Account_Popup_Watch_Only_Address = {"container": mainWallet_Add_Account_Popup_Main, "text": "Enter address...", "type": "StatusBaseText", "unnamed": 1, "visible": True} mainWallet_Add_Account_Popup_Private_Key = {"container": mainWallet_Add_Account_Popup_Main, "text": "Paste the contents of your private key", "type": "StatusBaseText", "unnamed": 1, "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_0 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder0", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_1 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder1", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_2 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder2", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_3 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder3", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_4 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder4", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_5 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder5", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_6 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder6", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_7 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder7", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_8 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder8", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_9 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder9", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_10 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder10", "visible": True} -mainWindow_Add_Account_Popup_Seed_Phrase_11 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder11", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_1 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder0", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_2 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder1", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_3 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder2", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_4 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder3", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_5 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder4", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_6 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder5", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_7 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder6", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_8 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder7", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_9 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder8", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_10 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder9", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_11 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder10", "visible": True} +mainWindow_Add_Account_Popup_Seed_Phrase_12 = {"container": mainWallet_Add_Account_Popup_Main, "type": "StatusBaseText", "objectName": "seedPhraseInputPlaceholder11", "visible": True} mainWallet_Add_Account_Popup_Footer = {"container": statusDesktop_mainWindow, "type": "StatusModalFooter", "unnamed": 1, "visible": True} mainWallet_Add_Account_Popup_Footer_Add_Account = {"container": mainWallet_Add_Account_Popup_Footer, "text": "Add account", "type": "StatusBaseText", "unnamed": 1, "visible": True} diff --git a/test/ui-test/testSuites/suite_status/shared/steps/settingsSteps.py b/test/ui-test/testSuites/suite_status/shared/steps/settingsSteps.py index 43f3b4a35e..5790299bc5 100644 --- a/test/ui-test/testSuites/suite_status/shared/steps/settingsSteps.py +++ b/test/ui-test/testSuites/suite_status/shared/steps/settingsSteps.py @@ -27,9 +27,9 @@ def step(context: any, account_name: str): def step(context: any): _settingsScreen.toggle_test_networks() -@Then("the |any| seed phrase address is |any| displayed in the wallet") -def step(context: any, phrase :str, address: str): - _settingsScreen.verify_address(phrase, address) +@Then("the address |any| is displayed in the wallet") +def step(context: any, address: str): + _settingsScreen.verify_address(address) @Then("the account |any| is not in the list of accounts") diff --git a/test/ui-test/testSuites/suite_status/shared/steps/signUpSteps.py b/test/ui-test/testSuites/suite_status/shared/steps/signUpSteps.py index 29c589c847..0a22260235 100644 --- a/test/ui-test/testSuites/suite_status/shared/steps/signUpSteps.py +++ b/test/ui-test/testSuites/suite_status/shared/steps/signUpSteps.py @@ -32,8 +32,12 @@ def step(context, username): def step(context): StatusMainScreen() -@When("The user inputs |any| seed phrases") -def step(context, seedPhraseAmount): - table = context.table - for row in table[1:]: - _welcomeScreen.input_seed_phrase(row[0], seedPhraseAmount, row[1]) + +@When("The user inputs the seed phrase |any|") +def step(context, seed_phrase): + _welcomeScreen.input_seed_phrase(seed_phrase) + + +@Then("the invalid seed text is visible") +def step(context): + _welcomeScreen.seed_phrase_visible() diff --git a/test/ui-test/testSuites/suite_status/tst_statusSignUp/test.feature b/test/ui-test/testSuites/suite_status/tst_statusSignUp/test.feature index 901da19037..56621180bc 100644 --- a/test/ui-test/testSuites/suite_status/tst_statusSignUp/test.feature +++ b/test/ui-test/testSuites/suite_status/tst_statusSignUp/test.feature @@ -83,7 +83,6 @@ Feature: Status Desktop Sign Up Examples: | username | wrongpassword | | tester123 | Invalid34 | - | tester123 | TesTEr16843/!@) | Scenario Outline: User cannot finish Sign Up and Sign In process with right password format in new password input but incorrect in confirmation password input Given A first time user lands on the status desktop and generates new key @@ -111,128 +110,29 @@ Feature: Status Desktop Sign Up | tester123 | Invalid34 | TesTEr16843/!@00 | | tester123 | TesTEr16843/!@) | TesTEr16843/!@01 | - Scenario: User signs up with imported 12 seed phrase + Scenario Outline: User signs up with imported seed phrase Given A first time user lands on the status desktop and navigates to import seed phrase - When The user inputs 12 seed phrases - | phrases | occurrence | - | lawn | 1 | - | corn | 3 | - | paddle | 5 | - | survey | 7 | - | shrimp | 9 | - | mind | 11 | - | select | 2 | - | gaze | 4 | - | arrest | 6 | - | pear | 8 | - | reduce | 10 | - | scan | 12 | + When The user inputs the seed phrase And user clicks on the following ui-component seedPhraseView_Submit_Button When user signs up with username tester123 and password TesTEr16843/!@00 Then the user lands on the signed in app When the user opens app settings screen And the user activates wallet and opens the wallet settings - Then the 12 seed phrase address is 0x8285cb9bf17b23d64a489a8dad29163dd227d0fd displayed in the wallet + Then the address
is displayed in the wallet + Examples: + | seed | address | + | truth gold urban vital rose market legal release border gospel leave fame | 0x8672E2f1a7b28cda8bcaBb53B52c686ccB7735c3 | + | lemon card easy goose keen divide cabbage daughter glide glad sense dice promote present august obey stay cheese | 0xdd06a08d469dd61Cb2E5ECE30f5D16019eBe0fc9 | + | provide between target maze travel enroll edge churn random sight grass lion diet sugar cable fiction reflect reason gaze camp tone maximum task unlock | 0xCb59031d11D233112CB57DFd667fE1FF6Cd7b6Da | - Scenario: User signs up with imported 18 seed phrase - - Given A first time user lands on the status desktop and navigates to import seed phrase - When The user inputs 18 seed phrases - | phrases | occurrence | - | flip | 1 | - | foam | 4 | - | time | 7 | - | sight | 10 | - | scheme | 13 | - | describe | 16 | - | candy | 2 | - | erosion | 5 | - | layer | 8 | - | depth | 11 | - | extend | 14 | - | dish | 17 | - | fog | 3 | - | seven | 6 | - | budget | 9 | - | denial | 12 | - | body | 15 | - | device | 18 | - - And user clicks on the following ui-component seedPhraseView_Submit_Button - When user signs up with username tester124 and password TesTEr16843/!@00 - Then the user lands on the signed in app - When the user opens app settings screen - And the user activates wallet and opens the wallet settings - Then the 18 seed phrase address is 0xba1d0d6ef35df8751df5faf55ebd885ad0e877b0 displayed in the wallet - - - Scenario: User signs up with imported 24 seed phrase - - Given A first time user lands on the status desktop and navigates to import seed phrase - When The user inputs 24 seed phrases - | phrases | occurrence | - | abstract | 1 | - | maple | 5 | - | license | 9 | - | damage | 13 | - | margin | 17 | - | marine | 21 | - | prevent | 2 | - | neutral | 6 | - | slender | 10 | - | unique | 14 | - | sphere | 18 | - | drama | 22 | - | exact | 3 | - | pottery | 7 | - | just | 11 | - | consider | 15 | - | debate | 19 | - | dial | 23 | - | oil | 4 | - | deny | 8 | - | timber | 12 | - | angle | 16 | - | exhibit | 20 | - | actress | 24 | - - And user clicks on the following ui-component mainWindow_submitseedPhraseView_Submit_ButtonButton_StatusButton - When user signs up with username tester124 and password TesTEr16843/!@00 - Then the user lands on the signed in app - When the user opens app settings screen - And the user activates wallet and opens the wallet settings - Then the 24 seed phrase address is 0x28cf6770664821a51984daf5b9fb1b52e6538e4b displayed in the wallet Scenario: User signs up with wrong imported seed phrase Given A first time user lands on the status desktop and navigates to import seed phrase - When The user inputs 24 seed phrases - | phrases | occurrence | - | abstract | 1 | - | maple | 5 | - | games | 9 | - | damage | 13 | - | margin | 17 | - | drama | 21 | - | prevent | 2 | - | neutral | 6 | - | timber | 10 | - | unique | 14 | - | sphere | 18 | - | only | 22 | - | exact | 3 | - | pottery | 7 | - | just | 11 | - | consider | 15 | - | actress | 19 | - | dial | 23 | - | oil | 4 | - | deny | 8 | - | dial | 12 | - | timber | 16 | - | exhibit | 20 | - | house | 24 | - + When The user inputs the seed phrase truth gold urban vital rose market legal release border gospel leave potato + And user clicks on the following ui-component seedPhraseView_Submit_Button Then the following ui-component seedPhraseView_Submit_Button is not enabled + And the invalid seed text is visible + diff --git a/ui/app/AppLayouts/Onboarding/views/LoginView.qml b/ui/app/AppLayouts/Onboarding/views/LoginView.qml index 84325eac4e..6c529e0d76 100644 --- a/ui/app/AppLayouts/Onboarding/views/LoginView.qml +++ b/ui/app/AppLayouts/Onboarding/views/LoginView.qml @@ -226,6 +226,7 @@ Item { StatusFlatRoundButton { id: changeAccountBtn + objectName: "loginChangeAccountButton" icon.name: "chevron-down" type: StatusFlatRoundButton.Type.Tertiary width: 24 @@ -291,6 +292,8 @@ Item { Input { id: txtPassword + textField.objectName: "loginPasswordInput" + validationErrorObjectName: "loginPassworkInputValidationErrorText" width: 318 height: 70 enabled: !d.loading diff --git a/ui/app/AppLayouts/Onboarding/views/SeedPhraseInputView.qml b/ui/app/AppLayouts/Onboarding/views/SeedPhraseInputView.qml index 3d71389366..8e4547473b 100644 --- a/ui/app/AppLayouts/Onboarding/views/SeedPhraseInputView.qml +++ b/ui/app/AppLayouts/Onboarding/views/SeedPhraseInputView.qml @@ -89,6 +89,7 @@ Item { StatusSwitchTabBar { id: switchTabBar + objectName: "onboardingSeedPhraseSwitchBar" anchors.top: headlineText.bottom anchors.horizontalCenter: parent.horizontalCenter anchors.topMargin: 24 @@ -97,7 +98,7 @@ Item { StatusSwitchTabButton { text: qsTr("%1 words").arg(modelData) id: seedPhraseWords - objectName: qsTr("%1SeedButton").arg(modelData) + objectName: `${modelData}SeedButton` } } onCurrentIndexChanged: { @@ -111,6 +112,7 @@ Item { StatusGridView { id: grid + objectName: "seedPhraseGridView" width: parent.width property var wordIndex: [ ["1", "3", "5", "7", "9", "11", "2", "4", "6", "8", "10", "12"] @@ -174,6 +176,7 @@ Item { delegate: StatusSeedPhraseInput { id: seedWordInput + textEdit.input.edit.objectName: `statusSeedPhraseInputField${seedWordInput.leftComponentText}` width: (grid.cellWidth - 8) height: (grid.cellHeight - 8) Behavior on width { NumberAnimation { duration: 180 } } @@ -259,6 +262,7 @@ Item { StatusBaseText { id: invalidSeedTxt + objectName: "onboardingInvalidSeedText" anchors.horizontalCenter: parent.horizontalCenter anchors.top: grid.bottom anchors.topMargin: 24 diff --git a/ui/app/AppLayouts/Profile/views/wallet/MainView.qml b/ui/app/AppLayouts/Profile/views/wallet/MainView.qml index 8a8b610aed..5cf05595f0 100644 --- a/ui/app/AppLayouts/Profile/views/wallet/MainView.qml +++ b/ui/app/AppLayouts/Profile/views/wallet/MainView.qml @@ -106,6 +106,7 @@ Column { objectName: "generatedAccounts" model: walletStore.generatedAccounts delegate: WalletAccountDelegate { + objectName: "walletSettingsAccountDelegate" account: model onGoToAccountView: { root.goToAccountView(model.address) diff --git a/ui/imports/shared/controls/Input.qml b/ui/imports/shared/controls/Input.qml index f3e6769b38..948aa9f17c 100644 --- a/ui/imports/shared/controls/Input.qml +++ b/ui/imports/shared/controls/Input.qml @@ -22,6 +22,7 @@ Item { property alias text: inputValue.text property alias maxLength: inputValue.maximumLength property string validationError: "" + property alias validationErrorObjectName: validationErrorText.objectName property alias validationErrorAlignment: validationErrorText.horizontalAlignment property int validationErrorTopMargin: 1 property color validationErrorColor: Style.current.danger