From 499b9bd09e00ebdc6c3a140c92e2a941a14e5874 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 18 Jul 2022 10:37:37 +0200 Subject: [PATCH] feat(@test): Add test for watch only account --- test/ui-test/src/screens/SettingsScreen.py | 28 ++-- test/ui-test/src/screens/StatusMainScreen.py | 2 +- .../ui-test/src/screens/StatusWalletScreen.py | 123 ++++++++++++++++++ .../suite_status/shared/scripts/bdd_hooks.py | 1 + .../suite_status/shared/scripts/names.py | 48 +++++-- .../shared/steps/settingsSteps.py | 6 +- .../suite_status/shared/steps/walletSteps.py | 27 ++++ .../testSuites/suite_status/suite.conf | 2 +- .../tst_statusSignUp/test.feature | 6 +- .../suite_status/tst_wallet/test.feature | 46 +++++++ .../suite_status/tst_wallet/test.py | 8 ++ .../Wallet/panels/ImportSeedPhrasePanel.qml | 1 + .../AppLayouts/Wallet/panels/WalletHeader.qml | 1 + .../Wallet/popups/AddAccountModal.qml | 5 +- vendor/status-go | 2 +- 15 files changed, 279 insertions(+), 27 deletions(-) create mode 100644 test/ui-test/src/screens/StatusWalletScreen.py create mode 100644 test/ui-test/testSuites/suite_status/shared/steps/walletSteps.py create mode 100644 test/ui-test/testSuites/suite_status/tst_wallet/test.feature create mode 100644 test/ui-test/testSuites/suite_status/tst_wallet/test.py diff --git a/test/ui-test/src/screens/SettingsScreen.py b/test/ui-test/src/screens/SettingsScreen.py index a06edbca5e..1258123c6f 100644 --- a/test/ui-test/src/screens/SettingsScreen.py +++ b/test/ui-test/src/screens/SettingsScreen.py @@ -12,11 +12,10 @@ from enum import Enum from drivers.SquishDriver import * from drivers.SquishDriverVerification import * +from .StatusMainScreen import MainScreenComponents - -class MainScreenComponents(Enum): +class SidebarComponents(Enum): ADVANCED_OPTION: str = "advanced_StatusBaseText" - SCROLL_BAR: str = "o_ScrollBar" WALLET_ITEM: str = "wallet_AppMenu_StatusNavigationListItem" @@ -34,18 +33,25 @@ class WalletSettingsScreen(Enum): class SettingsScreen: def __init__(self): - verify_screen(MainScreenComponents.ADVANCED_OPTION.value) + verify_screen(SidebarComponents.ADVANCED_OPTION.value) - def activate_open_wallet_section(self): - scroll_obj_by_name(MainScreenComponents.SCROLL_BAR.value) - - if not (is_Visible(MainScreenComponents.WALLET_ITEM.value)) : - click_obj_by_name(MainScreenComponents.ADVANCED_OPTION.value) + def activate_open_wallet_settings(self): + if not (is_Visible(SidebarComponents.WALLET_ITEM.value)) : + click_obj_by_name(SidebarComponents.ADVANCED_OPTION.value) click_obj_by_name(AdvancedOptionScreen.ACTIVATE_OR_DEACTIVATE_WALLET.value) click_obj_by_name(AdvancedOptionScreen.I_UNDERSTAND_POP_UP.value) - verify_object_enabled(MainScreenComponents.WALLET_ITEM.value) + verify_object_enabled(SidebarComponents.WALLET_ITEM.value) - click_obj_by_name(MainScreenComponents.WALLET_ITEM.value) + click_obj_by_name(SidebarComponents.WALLET_ITEM.value) + + def activate_open_wallet_section(self): + if not (is_Visible(SidebarComponents.WALLET_ITEM.value)): + click_obj_by_name(SidebarComponents.ADVANCED_OPTION.value) + click_obj_by_name(AdvancedOptionScreen.ACTIVATE_OR_DEACTIVATE_WALLET.value) + click_obj_by_name(AdvancedOptionScreen.I_UNDERSTAND_POP_UP.value) + verify_object_enabled(SidebarComponents.WALLET_ITEM.value) + + click_obj_by_name(MainScreenComponents.WALLET_BUTTON.value) def verify_address(self, phrase: str, address: str): if phrase =='18': diff --git a/test/ui-test/src/screens/StatusMainScreen.py b/test/ui-test/src/screens/StatusMainScreen.py index 0320303f37..47304b40cb 100644 --- a/test/ui-test/src/screens/StatusMainScreen.py +++ b/test/ui-test/src/screens/StatusMainScreen.py @@ -19,6 +19,7 @@ class MainScreenComponents(Enum): PUBLIC_CHAT_ICON = "mainWindow_public_chat_icon_StatusIcon" JOIN_PUBLIC_CHAT = "join_public_chat_StatusMenuItemDelegate" SETTINGS_BUTTON = "settings_navbar_settings_icon_StatusIcon" + WALLET_BUTTON = "wallet_navbar_wallet_icon_StatusIcon" class ChatNamePopUp(Enum): @@ -39,7 +40,6 @@ class StatusMainScreen: click_obj_by_name(ChatNamePopUp.START_CHAT.value) - def open_settings(self): click_obj_by_name(MainScreenComponents.SETTINGS_BUTTON.value) diff --git a/test/ui-test/src/screens/StatusWalletScreen.py b/test/ui-test/src/screens/StatusWalletScreen.py new file mode 100644 index 0000000000..5bfb85cd4b --- /dev/null +++ b/test/ui-test/src/screens/StatusWalletScreen.py @@ -0,0 +1,123 @@ +from enum import Enum +import time +import sys +from drivers.SquishDriver import * +from drivers.SquishDriverVerification import * + + +class SigningPhrasePopUp(Enum): + OK_GOT_IT_BUTTON: str = "mainWindow_Ok_got_it_StatusBaseText" + + +class MainWalletScreen(Enum): + ADD_ACCOUNT_BUTTON: str = "mainWallet_Add_Account" + ACCOUNT_NAME: str = "mainWallet_Account_Name" + + +class AddAccountPopup(Enum): + SCROLL_BAR: str = "mainWallet_Add_Account_Popup_Main" + PASSWORD_INPUT: str = "mainWallet_Add_Account_Popup_Password" + ACCOUNT_NAME_INPUT: str = "mainWallet_Add_Account_Popup_Account_Name" + ADVANCE_SECTION: str = "mainWallet_Add_Account_Popup_Advanced" + TYPE_SELECTOR: str = "mainWallet_Add_Account_Popup_Type_Selector" + TYPE_WATCH_ONLY: str = "mainWallet_Add_Account_Popup_Type_Watch_Only" + TYPE_SEED_PHRASE: str = "mainWallet_Add_Account_Popup_Type_Seed_Phrase" + 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" + 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" + + +class StatusWalletScreen: + + def acceptSigningPhrase(self): + click_obj_by_name(SigningPhrasePopUp.OK_GOT_IT_BUTTON.value) + + def addWatchOnlyAccount(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.ADDRESS_INPUT.value, address) + click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value) + + def importPrivateKey(self, account_name: str, password: str, private_key: str): + click_obj_by_name(MainWalletScreen.ADD_ACCOUNT_BUTTON.value) + + type(AddAccountPopup.PASSWORD_INPUT.value, password) + 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.PRIVATE_KEY_INPUT.value, private_key) + click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value) + + def importSeedPhrase(self, account_name: str, password: str, mnemonic: str): + click_obj_by_name(MainWalletScreen.ADD_ACCOUNT_BUTTON.value) + + type(AddAccountPopup.PASSWORD_INPUT.value, password) + 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) + + words = mnemonic.split() + scroll_obj_by_name(AddAccountPopup.SCROLL_BAR.value) + time.sleep(2) + + scroll_obj_by_name(AddAccountPopup.SCROLL_BAR.value) + time.sleep(2) + + scroll_obj_by_name(AddAccountPopup.SCROLL_BAR.value) + time.sleep(2) + + 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) + + click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value) + + def generateNewAccount(self, account_name: str, password: str): + click_obj_by_name(MainWalletScreen.ADD_ACCOUNT_BUTTON.value) + + type(AddAccountPopup.PASSWORD_INPUT.value, password) + type(AddAccountPopup.ACCOUNT_NAME_INPUT.value, account_name) + + time.sleep(2) + click_obj_by_name(AddAccountPopup.ADD_ACCOUNT_BUTTON.value) + + def verifyAccountNameIsPresent(self, account_name: str): + verify_text_matching(MainWalletScreen.ACCOUNT_NAME.value, account_name) + diff --git a/test/ui-test/testSuites/suite_status/shared/scripts/bdd_hooks.py b/test/ui-test/testSuites/suite_status/shared/scripts/bdd_hooks.py index d2270c64a4..41cc1dcd45 100644 --- a/test/ui-test/testSuites/suite_status/shared/scripts/bdd_hooks.py +++ b/test/ui-test/testSuites/suite_status/shared/scripts/bdd_hooks.py @@ -13,6 +13,7 @@ _appClosureTimeout = 2 #[seconds] @OnScenarioStart def hook(context): erase_directory("../../../../../Status/data") + erase_directory("../../../../../Status/qt") startApplication(_statusDektopAppName) context.userData = {} diff --git a/test/ui-test/testSuites/suite_status/shared/scripts/names.py b/test/ui-test/testSuites/suite_status/shared/scripts/names.py index ec0e9bceb4..4c775e03d6 100644 --- a/test/ui-test/testSuites/suite_status/shared/scripts/names.py +++ b/test/ui-test/testSuites/suite_status/shared/scripts/names.py @@ -4,7 +4,7 @@ from objectmaphelper import * statusDesktop_mainWindow = {"name": "mainWindow", "type": "StatusWindow", "visible": True} mainWindow_dropRectangle_Rectangle = {"container": statusDesktop_mainWindow, "id": "dropRectangle", "type": "Rectangle", "unnamed": 1, "visible": True} -loginView_passwordInput = {"container": statusDesktop_mainWindow, "echoMode": 2, "id": "inputValue", "passwordCharacter": "•", "type": "StyledTextField", "unnamed": 1, "visible": True} +loginView_passwordInput = {"container": statusDesktop_mainWindow, "echoMode": 2, "passwordCharacter": "•", "type": "StyledTextField", "unnamed": 1, "visible": True} loginView_changeAccountBtn = {"container": statusDesktop_mainWindow, "id": "changeAccountBtn", "type": "Rectangle", "unnamed": 1, "visible": True} loginView_submitBtn = {"container": statusDesktop_mainWindow, "type": "StatusRoundButton", "visible": True} loginView_main = {"container": statusDesktop_mainWindow, "type": "LoginView", "visible": True} @@ -12,20 +12,20 @@ loginView_errMsgLabel = {"container": statusDesktop_mainWindow, "id": "errMsg", statusDesktop_mainWindow_overlay = {"container": statusDesktop_mainWindow, "type": "Overlay", "unnamed": 1, "visible": True} accountsView_accountListPanel = {"container": statusDesktop_mainWindow_overlay, "type": "AccountListPanel", "visible": True} acknowledge_checkbox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "objectName": "acknowledgeCheckBox", "type": "StatusCheckBox", "visible": True} -termsOfUseCheckBox_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "id":"termsOfUse", "type": "StatusCheckBox", "visible": True} +termsOfUseCheckBox_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "objectName":"termsOfUseCheckBox", "type": "StatusCheckBox", "visible": True} getStartedStatusButton_StatusButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "getStartedStatusButton", "type": "StatusButton", "visible": True} mainWindow_I_am_new_to_Status_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "I am new to Status", "type": "StatusBaseText", "unnamed": 1, "visible": True} mainWindow_Generate_new_keys_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Generate new keys", "type": "StatusBaseText", "unnamed": 1, "visible": True} get_Started_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "text": "Get Started", "type": "StatusBaseText", "unnamed": 1, "visible": True} i_accept_Status_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "text": "I accept Status", "type": "StatusBaseText", "unnamed": 1, "visible": True} termsOfUseLink_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "objectName": "termsOfUseLink", "type": "StatusBaseText", "visible": True} -mainWindow_edit_TextEdit = {"container": statusDesktop_mainWindow, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True} +mainWindow_edit_TextEdit = {"container": statusDesktop_mainWindow, "type": "TextEdit", "unnamed": 1, "visible": True} mainWindow_Next_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Next", "type": "StatusBaseText", "unnamed": 1, "visible": True} mainWindow_Confirm_password_PlaceholderText = {"container": statusDesktop_mainWindow, "text": "Confirm password", "type": "PlaceholderText", "unnamed": 1, "visible": True} mainWindow_Display_name_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Display name", "type": "StatusBaseText", "unnamed": 1, "visible": True} -mainWindow_nextBtn_StatusButton = {"container": statusDesktop_mainWindow, "id": "nextBtn", "type": "StatusButton", "unnamed": 1, "visible": True} +mainWindow_nextBtn_StatusButton = {"container": statusDesktop_mainWindow, "type": "StatusButton", "unnamed": 1, "visible": True} mainWindow_New_password_PlaceholderText = {"container": statusDesktop_mainWindow, "text": "New password", "type": "PlaceholderText", "unnamed": 1, "visible": True} -mainWindow_Password_textField = {"container": statusDesktop_mainWindow, "echoMode": 2, "id": "inputValue", "occurrence": 2, "passwordCharacter": "•", "type": "StyledTextField", "unnamed": 1, "visible": True} +mainWindow_Password_textField = {"container": statusDesktop_mainWindow, "echoMode": 2, "occurrence": 2, "passwordCharacter": "•", "type": "StyledTextField", "unnamed": 1, "visible": True} mainWindow_Rectangle = {"container": statusDesktop_mainWindow, "occurrence": 11, "type": "Rectangle", "unnamed": 1, "visible": True} mainWindow_Create_password_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Create password", "type": "StatusBaseText", "unnamed": 1, "visible": True} mainWindow_Confirm_you_password_again_PlaceholderText = {"container": statusDesktop_mainWindow, "text": "Confirm you password (again)", "type": "PlaceholderText", "unnamed": 1, "visible": True} @@ -88,7 +88,7 @@ mainWindow_Restore_Status_Profile_StatusBaseText = {"container": statusDesktop_m mainWindow_Rectangle_4 = {"container": statusDesktop_mainWindow, "occurrence": 31, "type": "Rectangle", "unnamed": 1, "visible": True} mainWindow_submitButton_StatusButton = {"container": statusDesktop_mainWindow, "id": "submitButton", "type": "StatusButton", "unnamed": 1, "visible": True} i_understand_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "text": "I understand", "type": "StatusBaseText", "unnamed": 1, "visible": True} -mainWindow_navBarListView_ListView = {"container": statusDesktop_mainWindow, "id": "navBarListView", "type": "ListView", "unnamed": 1, "visible": True} +mainWindow_navBarListView_ListView = {"container": statusDesktop_mainWindow, "type": "ListView", "unnamed": 1, "visible": True} navBarListView_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_navBarListView_ListView, "occurrence": 4, "type": "StatusNavBarTabButton", "unnamed": 1, "visible": True} statusIcon_StatusIcon_3 = {"container": navBarListView_StatusNavBarTabButton, "id": "statusIcon", "source": "qrc:/StatusQ/src/assets/img/icons/settings.svg", "type": "StatusIcon", "unnamed": 1, "visible": True} mainWindow_ScrollView = {"container": statusDesktop_mainWindow, "type": "ScrollView", "unnamed": 1, "visible": True} @@ -135,7 +135,6 @@ walletAccount_WalletAccountDelegate = {"container": mainWindow_ScrollView_2, "ob twenty_four_seed_phrase_address = {"container": mainWindow_ScrollView_2, "text": "0x28cf6770664821a51984daf5b9fb1b52e6538e4b", "type": "StatusBaseText", "unnamed": 1, "visible": True} advanced_listItem_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": "Advanced-listItem", "type": "StatusNavigationListItem", "visible": True} communities_AppMenu_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": "Communities-AppMenu", "type": "StatusNavigationListItem", "visible": True} -o_ScrollBar = {"container": mainWindow_ScrollView, "type": "ScrollBar", "unnamed": 1, "visible": True} wallet_AppMenu_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": "Wallet-AppMenu", "type": "StatusNavigationListItem", "visible": True} mainWindow_public_chat_icon_StatusIcon = {"container": statusDesktop_mainWindow, "objectName": "public-chat-icon", "source": "qrc:/StatusQ/src/assets/img/icons/public-chat.svg", "type": "StatusIcon", "visible": True} @@ -149,5 +148,38 @@ mainWindow_submitBtn_StatusButton = {"container": statusDesktop_mainWindow, "id" appearance_SettingsMenu_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": "Appearance-SettingsMenu", "type": "StatusNavigationListItem", "visible": True} advanced_SettingsMenu_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": "Advanced-SettingsMenu", "type": "StatusNavigationListItem", "visible": True} walletSettingsLineButton = {"container": mainWindow_ScrollView_2, "objectName": "WalletSettingsLineButton", "type": "StatusSettingsLineButton", "visible": True} + navBarListView_Settings_navbar_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_navBarListView_ListView, "objectName": "Settings-navbar", "type": "StatusNavBarTabButton", "visible": True} -settings_navbar_settings_icon_StatusIcon = {"container": navBarListView_Settings_navbar_StatusNavBarTabButton, "objectName": "settings-icon", "source": "qrc:/StatusQ/src/assets/img/icons/settings.svg", "type": "StatusIcon", "visible": True} +settings_navbar_settings_icon_StatusIcon = {"container": navBarListView_Settings_navbar_StatusNavBarTabButton, "objectName": "settings-icon", "type": "StatusIcon", "visible": True} + +navBarListView_Wallet_navbar_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_navBarListView_ListView, "objectName": "Wallet-navbar", "type": "StatusNavBarTabButton", "visible": True} +wallet_navbar_wallet_icon_StatusIcon = {"container": navBarListView_Wallet_navbar_StatusNavBarTabButton, "objectName": "wallet-icon", "type": "StatusIcon", "visible": True} + +mainWallet_Account_Name = {"container": statusDesktop_mainWindow, "objectName": "accountName", "type": "StatusBaseText", "visible": True} +mainWallet_Add_Account = {"container": statusDesktop_mainWindow, "text": "Add account", "type": "StatusBaseText", "unnamed": 1, "visible": True} + +mainWallet_Add_Account_Popup_Main = {"container": statusDesktop_mainWindow, "objectName": "AddAccountModalContent", "type": "ScrollView", "visible": True} +mainWallet_Add_Account_Popup_Password = {"container": mainWallet_Add_Account_Popup_Main, "text": "Enter your password...", "type": "PlaceholderText", "unnamed": 1, "visible": True} +mainWallet_Add_Account_Popup_Advanced = {"container": mainWallet_Add_Account_Popup_Main, "text": "Advanced", "type": "StatusBaseText", "unnamed": 1, "visible": True} +mainWallet_Add_Account_Popup_Type_Selector = {"container": mainWallet_Add_Account_Popup_Main, "text": "Default", "type": "StatusBaseText", "unnamed": 1, "visible": True} +mainWallet_Add_Account_Popup_Type_Watch_Only = {"container": statusDesktop_mainWindow, "text": "Add a watch-only address", "type": "StatusBaseText", "unnamed": 1, "visible": True} +mainWallet_Add_Account_Popup_Type_Private_Key = {"container": statusDesktop_mainWindow, "text": "Generate from Private key", "type": "StatusBaseText", "unnamed": 1, "visible": True} +mainWallet_Add_Account_Popup_Type_Seed_Phrase = {"container": statusDesktop_mainWindow, "text": "Import new Seed Phrase", "type": "StatusBaseText", "unnamed": 1, "visible": True} +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} + +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} \ No newline at end of file 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 f04898d8f7..6e6b24c28d 100644 --- a/test/ui-test/testSuites/suite_status/shared/steps/settingsSteps.py +++ b/test/ui-test/testSuites/suite_status/shared/steps/settingsSteps.py @@ -11,7 +11,11 @@ def step(context: any): _statusMain.open_settings() -@When("the user activates wallet and opens the wallets section") +@When("the user activates wallet and opens the wallet settings") +def step(context: any): + _settingsScreen.activate_open_wallet_settings() + +@When("the user activates wallet and opens the wallet section") def step(context: any): _settingsScreen.activate_open_wallet_section() diff --git a/test/ui-test/testSuites/suite_status/shared/steps/walletSteps.py b/test/ui-test/testSuites/suite_status/shared/steps/walletSteps.py new file mode 100644 index 0000000000..6edae2263f --- /dev/null +++ b/test/ui-test/testSuites/suite_status/shared/steps/walletSteps.py @@ -0,0 +1,27 @@ +from screens.StatusWalletScreen import StatusWalletScreen + +_walletScreen = StatusWalletScreen() + +@When("the user accept the signing phrase") +def step(context): + _walletScreen.acceptSigningPhrase() + +@When("the user add watch only account with |any| and |any|") +def step(context, account_name, address): + _walletScreen.addWatchOnlyAccount(account_name, address) + +@When("the user generate a new account with |any| and |any|") +def step(context, account_name, password): + _walletScreen.generateNewAccount(account_name, password) + +@When("the user import a private key with |any| and |any| and |any|") +def step(context, account_name, password, private_key): + _walletScreen.importPrivateKey(account_name, password, private_key) + +@When("the user import a seed phrase with |any| and |any| and |any|") +def step(context, account_name, password, mnemonic): + _walletScreen.importSeedPhrase(account_name, password, mnemonic) + +@Then("the new account |any| is added") +def step(context, account_name): + _walletScreen.verifyAccountNameIsPresent(account_name) \ No newline at end of file diff --git a/test/ui-test/testSuites/suite_status/suite.conf b/test/ui-test/testSuites/suite_status/suite.conf index ae4f99a443..ff54d741e3 100644 --- a/test/ui-test/testSuites/suite_status/suite.conf +++ b/test/ui-test/testSuites/suite_status/suite.conf @@ -4,6 +4,6 @@ HOOK_SUB_PROCESSES=false IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_statusLoginPassword tst_basicChatFlow +TEST_CASES=tst_statusLoginPassword tst_basicChatFlow tst_wallet VERSION=3 WRAPPERS=Qt 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 5ba54bbd50..e4590b5650 100644 --- a/test/ui-test/testSuites/suite_status/tst_statusSignUp/test.feature +++ b/test/ui-test/testSuites/suite_status/tst_statusSignUp/test.feature @@ -95,7 +95,7 @@ Feature: Status Desktop Sign Up 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 wallets section + And the user activates wallet and opens the wallet settings Then the 12 seed phrase address is 0x8285cb9bf17b23d64a489a8dad29163dd227d0fd displayed in the wallet @@ -127,7 +127,7 @@ Feature: Status Desktop Sign Up 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 wallets section + And the user activates wallet and opens the wallet settings Then the 18 seed phrase address is 0xba1d0d6ef35df8751df5faf55ebd885ad0e877b0 displayed in the wallet @@ -165,7 +165,7 @@ Feature: Status Desktop Sign Up 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 wallets section + 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 diff --git a/test/ui-test/testSuites/suite_status/tst_wallet/test.feature b/test/ui-test/testSuites/suite_status/tst_wallet/test.feature new file mode 100644 index 0000000000..fc5fd694c2 --- /dev/null +++ b/test/ui-test/testSuites/suite_status/tst_wallet/test.feature @@ -0,0 +1,46 @@ +Feature: Status Desktop Wallet + + As a user I want to use the wallet + + Background: Sign up & Enable wallet section + Given A first time user lands on the status desktop and generates new key + 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 + When the user activates wallet and opens the wallet section + When the user accept the signing phrase + + Scenario Outline: User add a watch only account + When the user add watch only account with and
+ Then the new account is added + + Examples: + | account_name | address | + | one | 0x8397bc3c5a60a1883174f722403d63a8833312b7 | + | two | 0xf51ba8631618b9b3521ff4eb9adfd8a837455226 | + + + Scenario Outline: User generate a new account from wallet + When the user generate a new account with and TesTEr16843/!@00 + Then the new account is added + + Examples: + | account_name | + | one | + | two | + + Scenario Outline: User import a private key + When the user import a private key with and TesTEr16843/!@00 and + Then the new account is added + + Examples: + | account_name | private_key | + | one | 8da4ef21b864d2cc526dbdb2a120bd2874c36c9d0a1fb7f8c63d7f7a8b41de8f | + + Scenario Outline: User import a seed phrase + When the user import a seed phrase with and TesTEr16843/!@00 and + Then the new account is added + + Examples: + | account_name | seed_phrase | + | one | indoor dish desk flag debris potato excuse depart ticket judge file exit | \ No newline at end of file diff --git a/test/ui-test/testSuites/suite_status/tst_wallet/test.py b/test/ui-test/testSuites/suite_status/tst_wallet/test.py new file mode 100644 index 0000000000..61b17dac9a --- /dev/null +++ b/test/ui-test/testSuites/suite_status/tst_wallet/test.py @@ -0,0 +1,8 @@ +source(findFile('scripts', 'python/bdd.py')) + +setupHooks('../shared/scripts/bdd_hooks.py') +collectStepDefinitions('./steps', '../shared/steps', './shared/walletSteps') + +def main(): + testSettings.throwOnFailure = True + runFeatureFile('test.feature') diff --git a/ui/app/AppLayouts/Wallet/panels/ImportSeedPhrasePanel.qml b/ui/app/AppLayouts/Wallet/panels/ImportSeedPhrasePanel.qml index c8d8d12d2c..c25893f79b 100644 --- a/ui/app/AppLayouts/Wallet/panels/ImportSeedPhrasePanel.qml +++ b/ui/app/AppLayouts/Wallet/panels/ImportSeedPhrasePanel.qml @@ -164,6 +164,7 @@ StatusGridView { width: grid.cellWidth - (Style.current.halfPadding/2) height: (grid.cellHeight - Style.current.halfPadding) textEdit.errorMessageCmp.visible: false + textEdit.input.placeholder.objectName: "seedPhraseInputPlaceholder" + index leftComponentText: index + 1 inputList: BIP39_en { } property int itemIndex: index diff --git a/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml b/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml index 546dffe394..b28a6c96ba 100644 --- a/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml +++ b/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml @@ -34,6 +34,7 @@ Item { Row { spacing: Style.current.halfPadding StatusBaseText { + objectName: "accountName" font.pixelSize: 28 font.bold: true text: currentAccount.name diff --git a/ui/app/AppLayouts/Wallet/popups/AddAccountModal.qml b/ui/app/AppLayouts/Wallet/popups/AddAccountModal.qml index d54402d9df..a916831623 100644 --- a/ui/app/AppLayouts/Wallet/popups/AddAccountModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/AddAccountModal.qml @@ -160,6 +160,7 @@ StatusModal { leftPadding: Style.current.padding rightPadding: Style.current.padding height: Style.dp(400) + objectName: "AddAccountModalContent" Column { property alias accountNameInput: accountNameInput @@ -176,10 +177,12 @@ StatusModal { id: passwordInput anchors.fill: parent - placeholderText: qsTr("Enter your password…") + placeholderText: qsTr("Enter your password...") label: qsTr("Password") textField.echoMode: TextInput.Password validationError: root.passwordValidationError + textField.objectName: "accountModalPassword" + validationError: popup.passwordValidationError inputLabel.font.pixelSize: 15 inputLabel.font.weight: Font.Normal onTextChanged: { diff --git a/vendor/status-go b/vendor/status-go index a8c8604745..28b76ce4ca 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit a8c860474530eb93459ec56321ad88b08cb03ec9 +Subproject commit 28b76ce4ca6c5f1b1a43b0317116ed4ef0e43e37