feature(@desktop/ui-tests): managing wallet accounts tests added

Closes #9997
This commit is contained in:
Sale Djenic 2023-04-13 12:32:25 +02:00 committed by saledjenic
parent fae1fd2668
commit 7f8d6ce2c7
10 changed files with 754 additions and 15 deletions

View File

@ -26,6 +26,7 @@ class SettingsScreenComponents(Enum):
class SidebarComponents(Enum):
ADVANCED_OPTION: str = "advanced_StatusNavigationListItem"
KEYCARD_OPTION: str = "keycard_StatusNavigationListItem"
WALLET_OPTION: str = "wallet_StatusNavigationListItem"
LANGUAGE_CURRENCY_OPTION: str = "language_StatusNavigationListItem"
SIGN_OUT_AND_QUIT_OPTION: str = "sign_out_Quit_StatusNavigationListItem"

View File

@ -3,11 +3,17 @@ from enum import Enum
import time
import os
import sys
import common.Common as common
from common.SeedUtils import *
from .StatusMainScreen import StatusMainScreen
from .StatusMainScreen import authenticatePopupEnterPassword
from .SettingsScreen import SidebarComponents
from drivers.SquishDriver import type_text as type_text
NOT_APPLICABLE = "N/A"
VALUE_YES = "yes"
VALUE_NO = "no"
class Tokens(Enum):
ETH: str = "ETH"
@ -15,6 +21,7 @@ class SigningPhrasePopUp(Enum):
OK_GOT_IT_BUTTON: str = "signPhrase_Ok_Button"
class MainWalletScreen(Enum):
WALLET_LEFT_TAB: str = "mainWallet_LeftTab"
ADD_ACCOUNT_BUTTON: str = "mainWallet_Add_Account_Button"
ACCOUNT_NAME: str = "mainWallet_Account_Name"
ACCOUNT_ADDRESS_PANEL: str = "mainWallet_Address_Panel"
@ -22,9 +29,17 @@ class MainWalletScreen(Enum):
SAVED_ADDRESSES_BUTTON: str = "mainWallet_Saved_Addresses_Button"
NETWORK_SELECTOR_BUTTON: str = "mainWallet_Network_Selector_Button"
RIGHT_SIDE_TABBAR: str = "mainWallet_Right_Side_Tab_Bar"
FIRST_ACCOUNT_ITEM: str = "firstWalletAccount_Item"
WALLET_ACCOUNTS_LIST: str = "walletAccounts_StatusListView"
WALLET_ACCOUNT_ITEM_PLACEHOLDER = "walletAccounts_WalletAccountItem_Placeholder"
EPHEMERAL_NOTIFICATION_LIST: str = "mainWallet_Ephemeral_Notification_List"
TOTAL_CURRENCY_BALANCE: str = "mainWallet_totalCurrencyBalance"
class MainWalletRightClickMenu(Enum):
COPY_ADDRESS_ACTION_PLACEHOLDER: str = "mainWallet_RightClick_CopyAddress_MenuItem_Placeholder"
EDIT_ACCOUNT_ACTION_PLACEHOLDER: str = "mainWallet_RightClick_EditAccount_MenuItem_Placeholder"
DELETE_ACCOUNT_ACTION_PLACEHOLDER: str = "mainWallet_RightClick_DeleteAccount_MenuItem_Placeholder"
ADD_NEW_ACCOUNT_ACTION_PLACEHOLDER: str = "mainWallet_RightClick_AddNewAccount_MenuItem_Placeholder"
ADD_WATCH_ONLY_ACCOUNT_ACTION_PLACEHOLDER: str = "mainWallet_RightClick_AddWatchOnlyAccount_MenuItem_Placeholder"
class AssetView(Enum):
LIST: str = "mainWallet_Assets_View_List"
@ -59,7 +74,56 @@ class SendPopup(Enum):
ASSET_LIST: str = "mainWallet_Send_Popup_Asset_List"
HIGH_GAS_BUTTON: str = "mainWallet_Send_Popup_GasSelector_HighGas_Button"
class AddAccountPopup(Enum):
class AddEditAccountPopup(Enum):
CONTENT = "mainWallet_AddEditAccountPopup_Content"
ACCOUNT_NAME = "mainWallet_AddEditAccountPopup_AccountName"
ACCOUNT_COLOR_SELECTOR = "mainWallet_AddEditAccountPopup_AccountColorSelector"
SELECTED_ORIGIN = "mainWallet_AddEditAccountPopup_SelectedOrigin"
EMOJI_PUPUP_BUTTON = "mainWallet_AddEditAccountPopup_AccountEmojiPopupButton"
EMOJI_PUPUP_SEARCH = "mainWallet_AddEditAccountPopup_AccountEmojiSearchBox"
EMOJI_PUPUP_EMOJI = "mainWallet_AddEditAccountPopup_AccountEmoji"
ORIGIN_OPTION_PLACEHOLDER = "mainWallet_AddEditAccountPopup_OriginOption_Placeholder"
ORIGIN_OPTION_NEW_MASTER_KEY = "mainWallet_AddEditAccountPopup_OriginOptionNewMasterKey"
ORIGIN_OPTION_WATCH_ONLY_ACC = "mainWallet_AddEditAccountPopup_OriginOptionWatchOnlyAcc"
WATCH_ONLY_ADDRESS = "mainWallet_AddEditAccountPopup_AccountWatchOnlyAddress"
PRIMARY_BUTTON = "mainWallet_AddEditAccountPopup_PrimaryButton"
BACK_BUTTON = "mainWallet_AddEditAccountPopup_BackButton"
EDIT_DERIVATION_PATH_BUTTON = "mainWallet_AddEditAccountPopup_EditDerivationPathButton"
RESET_DERIVATION_PATH_BUTTON = "mainWallet_AddEditAccountPopup_ResetDerivationPathButton"
DERIVATION_PATH = "mainWallet_AddEditAccountPopup_DerivationPathInput"
PREDEFINED_DERIVATION_PATHS_BUTTON = "mainWallet_AddEditAccountPopup_PreDefinedDerivationPathsButton"
PREDEFINED_TESTNET_ROPSTEN_PATH = "mainWallet_AddEditAccountPopup_PreDefinedPathsOptionTestnetRopsten"
SELECTED_GENERATED_ADDRESS = "mainWallet_AddEditAccountPopup_GeneratedAddressComponent"
GENERATED_ADDDRESS_99 = "mainWallet_AddEditAccountPopup_GeneratedAddress_99"
GENERATED_ADDRESSES_PAGE_20 = "mainWallet_AddEditAccountPopup_PageIndicatorPage_20"
NON_ETH_DERIVATION_PATH = "mainWallet_AddEditAccountPopup_NonEthDerivationPathCheckBox"
MASTER_KEY_IMPORT_PRIVATE_KEY_OPTION = "mainWallet_AddEditAccountPopup_MasterKey_ImportPrivateKeyOption"
MASTER_KEY_IMPORT_SEED_PHRASE_OPTION = "mainWallet_AddEditAccountPopup_MasterKey_ImportSeedPhraseOption"
MASTER_KEY_GENERATE_SEED_PHRASE_OPTION = "mainWallet_AddEditAccountPopup_MasterKey_GenerateSeedPhraseOption"
MASTER_KEY_GO_TO_KEYCARD_SETTINGS_OPTION = "mainWallet_AddEditAccountPopup_MasterKey_GoToKeycardSettingsOption"
PRIVATE_KEY = "mainWallet_AddEditAccountPopup_PrivateKey"
PRIVATE_KEY_KEY_NAME = "mainWallet_AddEditAccountPopup_PrivateKeyName"
IMPORTED_SEED_PHRASE_KEY_NAME = "mainWallet_AddEditAccountPopup_ImportedSeedPhraseKeyName"
GENERATED_SEED_PHRASE_KEY_NAME = "mainWallet_AddEditAccountPopup_GeneratedSeedPhraseKeyName"
SEED_PHRASE_12_WORDS: str = "mainWallet_AddEditAccountPopup_12WordsButton"
SEED_PHRASE_18_WORDS: str = "mainWallet_AddEditAccountPopup_18WordsButton"
SEED_PHRASE_24_WORDS: str = "mainWallet_AddEditAccountPopup_24WordsButton"
SEED_PHRASE_WORD_PATTERN: str = "mainWallet_AddEditAccountPopup_SPWord_"
HAVE_PEN_AND_PAPER = "mainWallet_AddEditAccountPopup_HavePenAndPaperCheckBox"
SEED_PHRASE_WRITTEN = "mainWallet_AddEditAccountPopup_SeedPhraseWrittenCheckBox"
STORING_SEED_PHRASE_CONFIRMED = "mainWallet_AddEditAccountPopup_StoringSeedPhraseConfirmedCheckBox"
SEED_BACKUP_ACKNOWLEDGE = "mainWallet_AddEditAccountPopup_SeedBackupAknowledgeCheckBox"
REVEAL_SEED_PHRASE_BUTTON = "mainWallet_AddEditAccountPopup_RevealSeedPhraseButton"
SEED_PHRASE_WORD_AT_INDEX_PLACEHOLDER = "mainWallet_AddEditAccountPopup_SeedPhraseWordAtIndex_Placeholder"
ENTER_SEED_PHRASE_WORD_COMPONENT = "mainWallet_AddEditAccountPopup_EnterSeedPhraseWordComponent"
ENTER_SEED_PHRASE_WORD = "mainWallet_AddEditAccountPopup_EnterSeedPhraseWord"
class RemoveAccountPopup(Enum):
ACCOUNT_NOTIFICATION = "mainWallet_Remove_Account_Popup_Account_Notification"
ACCOUNT_PATH = "mainWallet_Remove_Account_Popup_Account_Path"
HAVE_PEN_PAPER = "mainWallet_Remove_Account_Popup_HavePenPaperCheckBox"
CONFIRM_BUTTON = "mainWallet_Remove_Account_Popup_ConfirmButton"
CANCEL_BUTTON = "mainWallet_Remove_Account_Popup_CancelButton"
class CollectiblesView(Enum):
COLLECTIONS_REPEATER: str = "mainWallet_Collections_Repeater"
@ -82,6 +146,217 @@ class StatusWalletScreen:
def accept_signing_phrase(self):
click_obj_by_name(SigningPhrasePopUp.OK_GOT_IT_BUTTON.value)
def open_add_account_popup(self):
click_obj_by_name(MainWalletScreen.ADD_ACCOUNT_BUTTON.value)
def add_account_popup_do_primary_action(self, password: str = NOT_APPLICABLE):
click_obj_by_name(AddEditAccountPopup.PRIMARY_BUTTON.value)
if password != NOT_APPLICABLE:
authenticatePopupEnterPassword(password)
def add_account_popup_open_edit_derivation_path_section(self, password: str):
click_obj_by_name(AddEditAccountPopup.EDIT_DERIVATION_PATH_BUTTON.value)
authenticatePopupEnterPassword(password)
def add_account_popup_change_account_name(self, name: str):
is_loaded_visible_and_enabled(AddEditAccountPopup.ACCOUNT_NAME.value, 1000)
setText(AddEditAccountPopup.ACCOUNT_NAME.value, name)
def add_account_popup_change_account_color(self, color: str):
colorList = get_obj(AddEditAccountPopup.ACCOUNT_COLOR_SELECTOR.value)
for index in range(colorList.count):
c = colorList.itemAt(index)
if(c.radioButtonColor == color):
click_obj(colorList.itemAt(index))
def add_account_popup_change_origin(self, origin_object_name: str):
click_obj_by_name(AddEditAccountPopup.SELECTED_ORIGIN.value)
click_obj_by_name(origin_object_name)
def add_account_popup_change_origin_by_keypair_name(self, keypair_name):
click_obj_by_name(AddEditAccountPopup.SELECTED_ORIGIN.value)
originObj = wait_by_wildcards(AddEditAccountPopup.ORIGIN_OPTION_PLACEHOLDER.value, "%NAME%", keypair_name)
click_obj(originObj)
def add_account_popup_change_derivation_path(self, index: str, order: str, is_ethereum_root: str):
# initially we set derivation path to other than default eth path, in order to test reset button functionality
click_obj_by_name(AddEditAccountPopup.PREDEFINED_DERIVATION_PATHS_BUTTON.value)
hover_and_click_object_by_name(AddEditAccountPopup.PREDEFINED_TESTNET_ROPSTEN_PATH.value)
if is_ethereum_root == VALUE_YES:
click_obj_by_name(AddEditAccountPopup.RESET_DERIVATION_PATH_BUTTON.value)
else:
scroll_item_until_item_is_visible(AddEditAccountPopup.CONTENT.value, AddEditAccountPopup.NON_ETH_DERIVATION_PATH.value)
click_obj_by_name(AddEditAccountPopup.NON_ETH_DERIVATION_PATH.value)
[compLoaded, selectedAccount] = is_loaded(AddEditAccountPopup.SELECTED_GENERATED_ADDRESS.value)
if not compLoaded:
verify_failure("cannot find selected address")
return
if index != NOT_APPLICABLE or order != NOT_APPLICABLE:
click_obj_by_name(AddEditAccountPopup.DERIVATION_PATH.value)
common.clear_input_text(AddEditAccountPopup.DERIVATION_PATH.value)
if index != NOT_APPLICABLE:
type_text(AddEditAccountPopup.DERIVATION_PATH.value, index)
elif order != NOT_APPLICABLE:
do_until_validation_with_timeout(
lambda: time.sleep(0.5),
lambda: not selectedAccount.loading,
"generating addresses to offer after path is cleared",
5000)
click_obj(selectedAccount)
is_loaded_visible_and_enabled(AddEditAccountPopup.GENERATED_ADDRESSES_PAGE_20.value)
click_obj_by_name(AddEditAccountPopup.GENERATED_ADDRESSES_PAGE_20.value)
is_loaded_visible_and_enabled(AddEditAccountPopup.GENERATED_ADDDRESS_99.value)
click_obj_by_name(AddEditAccountPopup.GENERATED_ADDDRESS_99.value)
do_until_validation_with_timeout(
lambda: time.sleep(0.5),
lambda: not selectedAccount.loading,
"resolving an address after path is finally chosen",
5000)
def add_account_popup_change_account_emoji(self, emoji: str):
click_obj_by_name(AddEditAccountPopup.EMOJI_PUPUP_BUTTON.value)
wait_for_object_and_type(AddEditAccountPopup.EMOJI_PUPUP_SEARCH.value, emoji)
click_obj(wait_by_wildcards(AddEditAccountPopup.EMOJI_PUPUP_EMOJI.value, "%NAME%", "*"))
def add_account_popup_set_watch_only_account_as_selected_origin(self, address: str):
self.add_account_popup_change_origin(AddEditAccountPopup.ORIGIN_OPTION_WATCH_ONLY_ACC.value)
wait_for_object_and_type(AddEditAccountPopup.WATCH_ONLY_ADDRESS.value, address)
def add_account_popup_set_new_private_key_as_selected_origin(self, private_key: str, keypair_name: str):
self.add_account_popup_change_origin(AddEditAccountPopup.ORIGIN_OPTION_NEW_MASTER_KEY.value)
is_loaded_visible_and_enabled(AddEditAccountPopup.MASTER_KEY_IMPORT_PRIVATE_KEY_OPTION.value)
click_obj_by_name(AddEditAccountPopup.MASTER_KEY_IMPORT_PRIVATE_KEY_OPTION.value)
type_text(AddEditAccountPopup.PRIVATE_KEY.value, private_key)
wait_for_object_and_type(AddEditAccountPopup.PRIVATE_KEY_KEY_NAME.value, keypair_name)
self.add_account_popup_do_primary_action()
def add_account_popup_set_new_seed_phrase_as_selected_origin(self, seed_phrase: str, keypair_name: str):
self.add_account_popup_change_origin(AddEditAccountPopup.ORIGIN_OPTION_NEW_MASTER_KEY.value)
is_loaded_visible_and_enabled(AddEditAccountPopup.MASTER_KEY_IMPORT_SEED_PHRASE_OPTION.value)
click_obj_by_name(AddEditAccountPopup.MASTER_KEY_IMPORT_SEED_PHRASE_OPTION.value)
sp_words = seed_phrase.split()
if len(sp_words) == 12:
click_obj_by_name(AddEditAccountPopup.SEED_PHRASE_12_WORDS.value)
elif len(sp_words) == 18:
click_obj_by_name(AddEditAccountPopup.SEED_PHRASE_18_WORDS.value)
elif len(sp_words) == 24:
click_obj_by_name(AddEditAccountPopup.SEED_PHRASE_24_WORDS.value)
else:
test.fail("Wrong amount of seed words", len(words))
input_seed_phrase(AddEditAccountPopup.SEED_PHRASE_WORD_PATTERN.value, sp_words)
wait_for_object_and_type(AddEditAccountPopup.IMPORTED_SEED_PHRASE_KEY_NAME.value, keypair_name)
self.add_account_popup_do_primary_action()
def add_account_popup_set_generated_seed_phrase_as_selected_origin(self, keypair_name: str):
self.add_account_popup_change_origin(AddEditAccountPopup.ORIGIN_OPTION_NEW_MASTER_KEY.value)
is_loaded_visible_and_enabled(AddEditAccountPopup.MASTER_KEY_IMPORT_SEED_PHRASE_OPTION.value)
click_obj_by_name(AddEditAccountPopup.MASTER_KEY_GENERATE_SEED_PHRASE_OPTION.value)
click_obj_by_name(AddEditAccountPopup.HAVE_PEN_AND_PAPER.value)
click_obj_by_name(AddEditAccountPopup.SEED_PHRASE_WRITTEN.value)
click_obj_by_name(AddEditAccountPopup.STORING_SEED_PHRASE_CONFIRMED.value)
self.add_account_popup_do_primary_action()
click_obj_by_name(AddEditAccountPopup.REVEAL_SEED_PHRASE_BUTTON.value)
seed_phrase = [wait_by_wildcards(AddEditAccountPopup.SEED_PHRASE_WORD_AT_INDEX_PLACEHOLDER.value, "%WORD-INDEX%", str(i + 1)).textEdit.input.edit.text for i in range(12)]
self.add_account_popup_do_primary_action()
enterWordObj = wait_and_get_obj(AddEditAccountPopup.ENTER_SEED_PHRASE_WORD_COMPONENT.value)
label = str(enterWordObj.label)
index = int(label[len("Word #"):len(label)]) - 1
wordToEnter = str(seed_phrase[index])
wait_for_object_and_type(AddEditAccountPopup.ENTER_SEED_PHRASE_WORD.value, wordToEnter)
self.add_account_popup_do_primary_action()
enterWordObj = wait_and_get_obj(AddEditAccountPopup.ENTER_SEED_PHRASE_WORD_COMPONENT.value)
label = str(enterWordObj.label)
index = int(label[len("Word #"):len(label)]) - 1
wordToEnter = str(seed_phrase[index])
wait_for_object_and_type(AddEditAccountPopup.ENTER_SEED_PHRASE_WORD.value, wordToEnter)
self.add_account_popup_do_primary_action()
click_obj_by_name(AddEditAccountPopup.SEED_BACKUP_ACKNOWLEDGE.value)
self.add_account_popup_do_primary_action()
wait_for_object_and_type(AddEditAccountPopup.GENERATED_SEED_PHRASE_KEY_NAME.value, keypair_name)
self.add_account_popup_do_primary_action()
def add_account_popup_go_to_keycard_settings(self):
self.add_account_popup_change_origin(AddEditAccountPopup.ORIGIN_OPTION_NEW_MASTER_KEY.value)
is_loaded_visible_and_enabled(AddEditAccountPopup.MASTER_KEY_GO_TO_KEYCARD_SETTINGS_OPTION.value)
click_obj_by_name(AddEditAccountPopup.MASTER_KEY_GO_TO_KEYCARD_SETTINGS_OPTION.value)
def remove_account_popup_do_cancel_action(self):
click_obj_by_name(RemoveAccountPopup.CANCEL_BUTTON.value)
def remove_account_popup_do_remove_action(self, confirmHavingPenAndPaper, password: str):
if confirmHavingPenAndPaper:
click_obj_by_name(RemoveAccountPopup.HAVE_PEN_PAPER.value)
click_obj_by_name(RemoveAccountPopup.CONFIRM_BUTTON.value)
if password != NOT_APPLICABLE:
authenticatePopupEnterPassword(password)
def click_option_from_left_part_right_click_menu(self, option: str):
right_click_obj_by_name(MainWalletScreen.WALLET_LEFT_TAB.value)
optionObj = wait_by_wildcards(option, "%NAME%", "wallet-background")
hover_obj(optionObj)
click_obj(optionObj)
def click_option_from_right_click_menu_of_account_with_name(self, option: str, name: str):
time.sleep(2)
##########################################
# Sometimes this function fails to open right click menu on form the wallet account item,
# or because of missed option from the right click menu
#
# NEEDS SOME INSPECTION WHAT'S REALLY HAPPENING
#
##########################################
# OPTION-1
# accounts = wait_and_get_obj(MainWalletScreen.WALLET_ACCOUNTS_LIST.value)
# for index in range(accounts.count):
# accountObj = accounts.itemAtIndex(index)
# if(accountObj.objectName == "walletAccount-" + name):
# right_click_obj(accountObj)
# do_until_validation_with_timeout(
# lambda: time.sleep(1),
# lambda: accountObj.itemLoaded,
# "loading address",
# 5000)
# optionObj = wait_by_wildcards(option, "%NAME%", name)
# hover_obj(optionObj)
# click_obj(optionObj)
# return
# OPTION-2
accountObj = wait_by_wildcards(MainWalletScreen.WALLET_ACCOUNT_ITEM_PLACEHOLDER.value, "%NAME%", name)
if accountObj is None:
objName = copy.deepcopy(getattr(names, MainWalletScreen.WALLET_ACCOUNT_ITEM_PLACEHOLDER.value))
realObjName = objName["objectName"].replace("%NAME%", name)
[compLoaded, accountObj] = is_loaded_visible_and_enabled(realObjName)
if not compLoaded:
verify_failure("cannot find wallet account component with objectName = " + realObjName)
return
if accountObj is None:
verify_failure("cannot find wallet account component with name = " + name)
return
do_until_validation_with_timeout(
lambda: time.sleep(0.5),
lambda: false if accountObj is None else accountObj.itemLoaded,
"loading address",
5000)
right_click_obj(accountObj)
time.sleep(1)
optionObj = wait_by_wildcards(option, "%NAME%", name)
if optionObj is None:
verify_failure("cannot find option in wallet account right click menu with name = " + name)
return
hover_obj(optionObj)
click_obj(optionObj)
def send_transaction(self, account_name, amount, token, chain_name, password):
is_loaded_visible_and_enabled(AssetView.LIST.value, 2000)
@ -192,19 +467,68 @@ class StatusWalletScreen:
return
assert False, "network name not found"
def click_first_account(self):
click_obj_by_name(MainWalletScreen.FIRST_ACCOUNT_ITEM.value)
def click_default_wallet_account(self):
accounts = get_obj(MainWalletScreen.WALLET_ACCOUNTS_LIST.value)
click_obj(accounts.itemAtIndex(0))
def click_wallet_account(self, account_name: str):
accounts = get_obj(MainWalletScreen.WALLET_ACCOUNTS_LIST.value)
for index in range(accounts.count):
if(accounts.itemAtIndex(index).objectName == "walletAccount-" + account_name):
click_obj(accounts.itemAtIndex(index))
return
#####################################
### Verifications region:
#####################################
def remove_account_popup_verify_account_account_to_be_removed(self, name: str, path: str):
objNotification = wait_and_get_obj(RemoveAccountPopup.ACCOUNT_NOTIFICATION.value)
displayedNotification = str(objNotification.text)
if name not in displayedNotification:
verify_failure("Remove account popup doesn't refer to an account with name: " + name)
if path != NOT_APPLICABLE:
objPath = get_obj(RemoveAccountPopup.ACCOUNT_PATH.value)
if path != objPath.text:
verify_failure("Remove account popup doesn't refer to an account with path: " + path)
def verify_account_existence(self, name: str, color: str, emoji_unicode: str):
[compLoaded, accNameObj] = is_loaded_visible_and_enabled(MainWalletScreen.ACCOUNT_NAME.value)
if not compLoaded:
verify_failure("cannot find account name on the right, most likely the account we're searching for is not selected")
return
do_until_validation_with_timeout(
lambda: time.sleep(0.5),
lambda: accNameObj.text == name,
"selected account match",
5000)
def verify_account_name_is_present(self, account_name: str):
# Wait 2 second for UI text to update
test.verify(wait_for_text_matching(MainWalletScreen.ACCOUNT_NAME.value, account_name, 2000), "Account name was updated and matches expected")
is_loaded_visible_and_enabled(MainWalletScreen.WALLET_ACCOUNTS_LIST.value)
accounts = get_obj(MainWalletScreen.WALLET_ACCOUNTS_LIST.value)
for index in range(accounts.count):
acc = accounts.itemAtIndex(index)
if(acc.objectName == "walletAccount-" + name):
verify_equal(str(acc.title), name, "Account displays the expected name")
verify_equal(str(acc.asset.color.name), str(color.lower()), "Account displays the expected color")
verify_equal((True if emoji_unicode in str(acc.asset.emoji) else False), True, "Account displays the expected emoji")
return
def verify_account_doesnt_exist(self, name: str):
is_loaded_visible_and_enabled(MainWalletScreen.WALLET_ACCOUNTS_LIST.value)
accounts = get_obj(MainWalletScreen.WALLET_ACCOUNTS_LIST.value)
for index in range(accounts.count):
acc = accounts.itemAtIndex(index)
if(acc.objectName == "walletAccount-" + name):
verify_failure("Account with " + name + " is still displayed even it should not be")
def verify_keycard_settings_is_opened(self):
[compLoaded, accNameObj] = is_loaded_visible_and_enabled(SidebarComponents.KEYCARD_OPTION.value)
if not compLoaded:
verify_failure("keycard option from the app settings cannot be found")
return
verify(bool(accNameObj.selected), "keycard option from the app settings is displayed")
def verify_account_balance_is_positive(self, list, symbol: str) -> Tuple(bool, ):
if list is None:
return (False, )

View File

@ -45,6 +45,7 @@ settings_ENS_Terms_Transaction_Password_Input = {"container": statusDesktop_main
wallet_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.WALLET.value, "type": "StatusNavigationListItem", "visible": True}
language_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.LANGUAGE.value, "type": "StatusNavigationListItem", "visible": True}
advanced_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.ADVANCED.value, "type": "StatusNavigationListItem", "visible": True}
keycard_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.KEYCARD.value, "type": "StatusNavigationListItem", "visible": True}
sign_out_Quit_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.SIGNOUT.value, "type": "StatusNavigationListItem", "visible": True}
communities_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.COMMUNITY.value, "type": "StatusNavigationListItem", "visible": True}
profile_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.PROFILE.value, "type": "StatusNavigationListItem", "visible": True}

View File

@ -3,6 +3,7 @@ from scripts.global_names import *
# Main:
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_LeftTab = {"container": statusDesktop_mainWindow, "objectName": "walletLeftTab", "type": "LeftTabView", "visible": True}
mainWallet_Account_Name = {"container": statusDesktop_mainWindow, "objectName": "accountName", "type": "StatusBaseText", "visible": True}
mainWallet_Address_Panel = {"container": statusDesktop_mainWindow, "objectName": "addressPanel", "type": "StatusAddressPanel", "visible": True}
mainWallet_Add_Account_Button = {"container": statusDesktop_mainWindow, "objectName": "addAccountButton", "type": "StatusRoundButton", "visible": True}
@ -12,9 +13,14 @@ mainWallet_Network_Selector_Button = {"container": statusDesktop_mainWindow, "ob
mainWallet_Right_Side_Tab_Bar = {"container": statusDesktop_mainWindow, "objectName": "rightSideWalletTabBar", "type": "StatusTabBar"}
mainWallet_Ephemeral_Notification_List = {"container": statusDesktop_mainWindow, "objectName": "ephemeralNotificationList", "type": "StatusListView"}
accounts_StatusListView = {"container": statusDesktop_mainWindow, "objectName": "walletAccountsListView", "type": "StatusListView", "visible": True}
firstWalletAccount_Item = {"container": accounts_StatusListView, "index": 0, "objectName": "walletAccountItem", "type": "StatusListItem", "visible": True}
mainWallet_RightClick_CopyAddress_MenuItem_Placeholder = {"container": statusDesktop_mainWindow, "enabled": True, "objectName": "AccountMenu-CopyAddressAction-%NAME%", "type": "StatusMenuItem"}
mainWallet_RightClick_EditAccount_MenuItem_Placeholder = {"container": statusDesktop_mainWindow, "enabled": True, "objectName": "AccountMenu-EditAction-%NAME%", "type": "StatusMenuItem"}
mainWallet_RightClick_DeleteAccount_MenuItem_Placeholder = {"container": statusDesktop_mainWindow, "enabled": True, "objectName": "AccountMenu-DeleteAction-%NAME%", "type": "StatusMenuItem"}
mainWallet_RightClick_AddNewAccount_MenuItem_Placeholder = {"container": statusDesktop_mainWindow, "enabled": True, "objectName": "AccountMenu-AddNewAccountAction-%NAME%", "type": "StatusMenuItem"}
mainWallet_RightClick_AddWatchOnlyAccount_MenuItem_Placeholder = {"container": statusDesktop_mainWindow, "enabled": True, "objectName": "AccountMenu-AddWatchOnlyAccountAction-%NAME%", "type": "StatusMenuItem"}
walletAccounts_StatusListView = {"container": statusDesktop_mainWindow, "objectName": "walletAccountsListView", "type": "StatusListView", "visible": True}
walletAccounts_WalletAccountItem_Placeholder = {"container": walletAccounts_StatusListView, "objectName": "walletAccount-%NAME%", "type": "StatusListItem", "visible": True}
# Assets view:
mainWallet_Assets_View_List = {"container": statusDesktop_mainWindow, "objectName": "assetViewStatusListView", "type": "StatusListView"}
@ -36,7 +42,89 @@ mainWallet_Send_Popup_Asset_Selector = {"container": statusDesktop_mainWindow, "
mainWallet_Send_Popup_Asset_List = {"container": statusDesktop_mainWindow, "objectName": "assetSelectorList", "type": "StatusListView"}
mainWallet_Send_Popup_GasPrice_Input = {"container": statusDesktop_mainWindow, "objectName": "gasPriceSelectorInput", "type": "StyledTextField"}
# Add account popup:
# Add/Edit account popup:
mainWallet_AddEditAccountPopup_Content = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-Content", "type": "Item", "visible": True}
mainWallet_AddEditAccountPopup_PrimaryButton = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-PrimaryButton", "type": "StatusButton", "visible": True}
mainWallet_AddEditAccountPopup_BackButton = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-BackButton", "type": "StatusBackButton", "visible": True}
mainWallet_AddEditAccountPopup_AccountNameComponent = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-AccountName", "type": "StatusInput", "visible": True}
mainWallet_AddEditAccountPopup_AccountName = {"container": mainWallet_AddEditAccountPopup_AccountNameComponent, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
mainWallet_AddEditAccountPopup_AccountColorComponent = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-AccountColor", "type": "StatusColorSelectorGrid", "visible": True}
mainWallet_AddEditAccountPopup_AccountColorSelector = {"container": mainWallet_AddEditAccountPopup_AccountColorComponent, "type": "Repeater", "objectName": "statusColorRepeater", "visible": True}
mainWallet_AddEditAccountPopup_AccountEmojiPopupButton = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-AccountEmoji", "type": "StatusFlatRoundButton", "visible": True}
mainWallet_AddEditAccountPopup_AccountEmojiSearchBox = {"container": statusDesktop_mainWindow, "objectName": "StatusEmojiPopup_searchBox", "type": "TextEdit", "visible": True}
mainWallet_AddEditAccountPopup_AccountEmoji = {"container": statusDesktop_mainWindow, "objectName": "statusEmoji_%NAME%", "type": "StatusEmoji", "visible": True}
mainWallet_AddEditAccountPopup_SelectedOrigin = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-SelectedOrigin", "type": "StatusListItem", "visible": True}
mainWallet_AddEditAccountPopup_OriginOption_Placeholder = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-OriginOption-%NAME%", "type": "StatusListItem", "visible": True}
mainWallet_AddEditAccountPopup_OriginOptionNewMasterKey = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-OriginOption-LABEL-OPTION-ADD-NEW-MASTER-KEY", "type": "StatusListItem", "visible": True}
mainWallet_AddEditAccountPopup_OriginOptionWatchOnlyAcc = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-OriginOption-LABEL-OPTION-ADD-WATCH-ONLY-ACC", "type": "StatusListItem", "visible": True}
mainWallet_AddEditAccountPopup_AccountWatchOnlyAddressComponent = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-WatchOnlyAddress", "type": "StatusInput", "visible": True}
mainWallet_AddEditAccountPopup_AccountWatchOnlyAddress = {"container": mainWallet_AddEditAccountPopup_AccountWatchOnlyAddressComponent, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
mainWallet_AddEditAccountPopup_EditDerivationPathButton = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-EditDerivationPath", "type": "StatusButton", "visible": True}
mainWallet_AddEditAccountPopup_ResetDerivationPathButton = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-ResetDerivationPath", "type": "StatusLinkText", "enabled": True, "visible": True}
mainWallet_AddEditAccountPopup_DerivationPathInputComponent = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-DerivationPathInput", "type": "DerivationPathInput", "visible": True}
mainWallet_AddEditAccountPopup_DerivationPathInput = {"container": mainWallet_AddEditAccountPopup_DerivationPathInputComponent, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
mainWallet_AddEditAccountPopup_PreDefinedDerivationPathsButton = {"container": mainWallet_AddEditAccountPopup_DerivationPathInputComponent, "objectName": "chevron-down-icon", "type": "StatusIcon", "visible": True}
mainWallet_AddEditAccountPopup_PreDefinedPathsOptionTestnetRopsten = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-PreDefinedDerivationPath-Ethereum Testnet (Ropsten)", "type": "StatusListItem", "visible": True}
mainWallet_AddEditAccountPopup_GeneratedAddressComponent = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-GeneratedAddress", "type": "StatusListItem", "visible": True}
mainWallet_AddEditAccountPopup_GeneratedAddress_99 = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-GeneratedAddress-99", "type": "Rectangle", "visible": True}
mainWallet_AddEditAccountPopup_PageIndicatorComponent = {"container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-GeneratedAddressesListPageIndicatior", "occurrence": 5, "type": "Rectangle", "visible": True}
mainWallet_AddEditAccountPopup_PageIndicatorPage_20 = {"container": statusDesktop_mainWindow, "objectName": "Page-20", "type": "StatusBaseButton", "visible": True}
mainWallet_AddEditAccountPopup_NonEthDerivationPathCheckBox = {"checkable": True, "container": statusDesktop_mainWindow, "objectName": "AddAccountPopup-ConfirmAddingNonEthDerivationPath", "type": "StatusCheckBox", "visible": True}
mainWallet_AddEditAccountPopup_MasterKey_ImportPrivateKeyOption = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-ImportPrivateKey", "type": "StatusListItem", "visible": True}
mainWallet_AddEditAccountPopup_MasterKey_ImportSeedPhraseOption = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-ImportUsingSeedPhrase", "type": "StatusListItem", "visible": True}
mainWallet_AddEditAccountPopup_MasterKey_GenerateSeedPhraseOption = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-GenerateNewMasterKey", "type": "StatusListItem", "visible": True}
mainWallet_AddEditAccountPopup_MasterKey_GoToKeycardSettingsOption = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-GoToKeycardSettings", "type": "StatusButton", "visible": True}
mainWallet_AddEditAccountPopup_PrivateKey = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-PrivateKeyInput", "type": "StatusPasswordInput", "visible": True}
mainWallet_AddEditAccountPopup_PrivateKeyNameComponent = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-PrivateKeyName", "type": "StatusInput", "visible": True}
mainWallet_AddEditAccountPopup_PrivateKeyName = {"container": mainWallet_AddEditAccountPopup_PrivateKeyNameComponent, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
mainWallet_AddEditAccountPopup_ImportedSeedPhraseKeyNameComponent = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-ImportedSeedPhraseKeyName", "type": "StatusInput", "visible": True}
mainWallet_AddEditAccountPopup_ImportedSeedPhraseKeyName = {"container": mainWallet_AddEditAccountPopup_ImportedSeedPhraseKeyNameComponent, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
mainWallet_AddEditAccountPopup_GeneratedSeedPhraseKeyNameComponent = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-GeneratedSeedPhraseKeyName", "type": "StatusInput", "visible": True}
mainWallet_AddEditAccountPopup_GeneratedSeedPhraseKeyName = {"container": mainWallet_AddEditAccountPopup_GeneratedSeedPhraseKeyNameComponent, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
mainWallet_AddEditAccountPopup_HavePenAndPaperCheckBox = {"checkable": True, "container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-HavePenAndPaper", "type": "StatusCheckBox", "visible": True}
mainWallet_AddEditAccountPopup_SeedPhraseWrittenCheckBox = {"checkable": True, "container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-SeedPhraseWritten", "type": "StatusCheckBox", "visible": True}
mainWallet_AddEditAccountPopup_StoringSeedPhraseConfirmedCheckBox = {"checkable": True, "container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-StoringSeedPhraseConfirmed", "type": "StatusCheckBox", "visible": True}
mainWallet_AddEditAccountPopup_SeedBackupAknowledgeCheckBox = {"checkable": True, "container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-SeedBackupAknowledge", "type": "StatusCheckBox", "visible": True}
mainWallet_AddEditAccountPopup_RevealSeedPhraseButton = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-RevealSeedPhrase", "type": "StatusButton", "visible": True}
mainWallet_AddEditAccountPopup_SeedPhraseWordAtIndex_Placeholder = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "SeedPhraseWordAtIndex-%WORD-INDEX%", "type": "StatusSeedPhraseInput", "visible": True}
mainWallet_AddEditAccountPopup_EnterSeedPhraseWordComponent = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "AddAccountPopup-EnterSeedPhraseWord", "type": "StatusInput", "visible": True}
mainWallet_AddEditAccountPopup_EnterSeedPhraseWord = {"container": mainWallet_AddEditAccountPopup_EnterSeedPhraseWordComponent, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
mainWallet_AddEditAccountPopup_12WordsButton = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "12SeedButton", "type": "StatusSwitchTabButton"}
mainWallet_AddEditAccountPopup_18WordsButton = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "18SeedButton", "type": "StatusSwitchTabButton"}
mainWallet_AddEditAccountPopup_24WordsButton = {"container": mainWallet_AddEditAccountPopup_Content, "objectName": "24SeedButton", "type": "StatusSwitchTabButton"}
mainWallet_AddEditAccountPopup_SPWord_1 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField1"}
mainWallet_AddEditAccountPopup_SPWord_2 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField2"}
mainWallet_AddEditAccountPopup_SPWord_3 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField3"}
mainWallet_AddEditAccountPopup_SPWord_4 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField4"}
mainWallet_AddEditAccountPopup_SPWord_5 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField5"}
mainWallet_AddEditAccountPopup_SPWord_6 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField6"}
mainWallet_AddEditAccountPopup_SPWord_7 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField7"}
mainWallet_AddEditAccountPopup_SPWord_8 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField8"}
mainWallet_AddEditAccountPopup_SPWord_9 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField9"}
mainWallet_AddEditAccountPopup_SPWord_10 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField10"}
mainWallet_AddEditAccountPopup_SPWord_11 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField11"}
mainWallet_AddEditAccountPopup_SPWord_12 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField12"}
mainWallet_AddEditAccountPopup_SPWord_13 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField13"}
mainWallet_AddEditAccountPopup_SPWord_14 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField14"}
mainWallet_AddEditAccountPopup_SPWord_15 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField15"}
mainWallet_AddEditAccountPopup_SPWord_16 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField16"}
mainWallet_AddEditAccountPopup_SPWord_17 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField17"}
mainWallet_AddEditAccountPopup_SPWord_18 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField18"}
mainWallet_AddEditAccountPopup_SPWord_19 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField19"}
mainWallet_AddEditAccountPopup_SPWord_20 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField20"}
mainWallet_AddEditAccountPopup_SPWord_21 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField21"}
mainWallet_AddEditAccountPopup_SPWord_22 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField22"}
mainWallet_AddEditAccountPopup_SPWord_23 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField23"}
mainWallet_AddEditAccountPopup_SPWord_24 = {"container": mainWallet_AddEditAccountPopup_Content, "type": "TextEdit", "objectName": "statusSeedPhraseInputField24"}
# Remove account popup:
mainWallet_Remove_Account_Popup_Account_Notification = {"container": statusDesktop_mainWindow, "objectName": "RemoveAccountPopup-Notification", "type": "StatusBaseText", "visible": True}
mainWallet_Remove_Account_Popup_Account_Path_Component = {"container": statusDesktop_mainWindow, "objectName": "RemoveAccountPopup-DerivationPath", "type": "StatusInput", "visible": True}
mainWallet_Remove_Account_Popup_Account_Path = {"container": mainWallet_Remove_Account_Popup_Account_Path_Component, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
mainWallet_Remove_Account_Popup_HavePenPaperCheckBox = {"checkable": True, "container": statusDesktop_mainWindow, "objectName": "RemoveAccountPopup-HavePenPaper", "type": "StatusCheckBox", "visible": True}
mainWallet_Remove_Account_Popup_ConfirmButton = {"container": statusDesktop_mainWindow, "objectName": "RemoveAccountPopup-ConfirmButton", "type": "StatusButton", "visible": True}
mainWallet_Remove_Account_Popup_CancelButton = {"container": statusDesktop_mainWindow, "objectName": "RemoveAccountPopup-CancelButton", "type": "StatusFlatButton", "visible": True}
# saved address view
mainWallet_Saved_Addreses_Add_Buttton = {"container": statusDesktop_mainWindow, "objectName": "addNewAddressBtn", "type": "StatusButton"}

View File

@ -2,6 +2,8 @@ import walletInitSteps as wallet_init_steps
from screens.StatusMainScreen import StatusMainScreen
from screens.StatusWalletScreen import StatusWalletScreen
from screens.StatusWalletScreen import MainWalletRightClickMenu
from screens.StatusWalletScreen import NOT_APPLICABLE, VALUE_YES
from scripts.decorators import verify_screenshot
from common.Common import str_to_bool
@ -19,6 +21,106 @@ def step(context):
#########################
### ACTIONS region:
#########################
@When("the user opens wallet section")
def step(context):
wallet_init_steps.the_user_opens_wallet_screen()
@When("the user clicks on the default wallet account")
def step(context):
_walletScreen.click_default_wallet_account()
@When("the user adds a watch only account \"|any|\" with \"|any|\" color \"|any|\" and emoji \"|any|\" via \"|any|\"")
@verify_screenshot
def step(context, address, name, color, emoji, via_right_click_menu):
if via_right_click_menu == VALUE_YES:
_walletScreen.click_option_from_left_part_right_click_menu(MainWalletRightClickMenu.ADD_WATCH_ONLY_ACCOUNT_ACTION_PLACEHOLDER.value)
else:
_walletScreen.open_add_account_popup()
_walletScreen.add_account_popup_change_account_name(name)
_walletScreen.add_account_popup_change_account_color(color)
_walletScreen.add_account_popup_change_account_emoji(emoji)
_walletScreen.add_account_popup_set_watch_only_account_as_selected_origin(address)
_walletScreen.add_account_popup_do_primary_action()
@When("the user adds a generated account with \"|any|\" color \"|any|\" and emoji \"|any|\" via \"|any|\" using password \"|any|\"")
@verify_screenshot
def step(context, name, color, emoji, via_right_click_menu, password):
if via_right_click_menu == VALUE_YES:
_walletScreen.click_option_from_left_part_right_click_menu(MainWalletRightClickMenu.ADD_NEW_ACCOUNT_ACTION_PLACEHOLDER.value)
else:
_walletScreen.open_add_account_popup()
_walletScreen.add_account_popup_change_account_name(name)
_walletScreen.add_account_popup_change_account_color(color)
_walletScreen.add_account_popup_change_account_emoji(emoji)
_walletScreen.add_account_popup_do_primary_action(password)
@When("the user adds to \"|any|\" a custom generated account with \"|any|\" color \"|any|\" and emoji \"|any|\" using password \"|any|\" and setting custom path index \"|any|\" or selecting address with \"|any|\" using \"|any|\"")
@verify_screenshot
def step(context, keypair_name, name, color, emoji, password, index, order, is_ethereum_root):
_walletScreen.open_add_account_popup()
_walletScreen.add_account_popup_change_account_name(name)
_walletScreen.add_account_popup_change_account_color(color)
_walletScreen.add_account_popup_change_account_emoji(emoji)
if keypair_name != NOT_APPLICABLE:
_walletScreen.add_account_popup_change_origin_by_keypair_name(keypair_name)
_walletScreen.add_account_popup_open_edit_derivation_path_section(password)
_walletScreen.add_account_popup_change_derivation_path(index, order, is_ethereum_root)
_walletScreen.add_account_popup_do_primary_action()
@When("the user adds a private key account \"|any|\" with \"|any|\" color \"|any|\" and emoji \"|any|\" using password \"|any|\" making keypair with name \"|any|\"")
@verify_screenshot
def step(context, private_key, name, color, emoji, password, keypair_name):
_walletScreen.open_add_account_popup()
_walletScreen.add_account_popup_change_account_name(name)
_walletScreen.add_account_popup_change_account_color(color)
_walletScreen.add_account_popup_change_account_emoji(emoji)
_walletScreen.add_account_popup_set_new_private_key_as_selected_origin(private_key, keypair_name)
_walletScreen.add_account_popup_do_primary_action(password)
@When("the user adds an imported seed phrase account \"|any|\" with \"|any|\" color \"|any|\" and emoji \"|any|\" using password \"|any|\" making keypair with name \"|any|\"")
@verify_screenshot
def step(context, seed_phrase, name, color, emoji, password, keypair_name):
_walletScreen.open_add_account_popup()
_walletScreen.add_account_popup_change_account_name(name)
_walletScreen.add_account_popup_change_account_color(color)
_walletScreen.add_account_popup_change_account_emoji(emoji)
_walletScreen.add_account_popup_set_new_seed_phrase_as_selected_origin(seed_phrase, keypair_name)
_walletScreen.add_account_popup_do_primary_action(password)
@When("the user adds a generated seed phrase account with \"|any|\" color \"|any|\" and emoji \"|any|\" using password \"|any|\" making keypair with name \"|any|\"")
@verify_screenshot
def step(context, name, color, emoji, password, keypair_name):
_walletScreen.open_add_account_popup()
_walletScreen.add_account_popup_change_account_name(name)
_walletScreen.add_account_popup_change_account_color(color)
_walletScreen.add_account_popup_change_account_emoji(emoji)
_walletScreen.add_account_popup_set_generated_seed_phrase_as_selected_origin(keypair_name)
_walletScreen.add_account_popup_do_primary_action(password)
@When("the user adds new master key and go to use a Keycard")
def step(context):
_walletScreen.open_add_account_popup()
_walletScreen.add_account_popup_go_to_keycard_settings()
@When("the user edits an account with \"|any|\" to \"|any|\" with color \"|any|\" and emoji \"|any|\"")
def step(context, name, new_name, new_color, new_emoji):
_walletScreen.click_option_from_right_click_menu_of_account_with_name(MainWalletRightClickMenu.EDIT_ACCOUNT_ACTION_PLACEHOLDER.value, name)
_walletScreen.add_account_popup_change_account_name(new_name)
_walletScreen.add_account_popup_change_account_color(new_color)
_walletScreen.add_account_popup_change_account_emoji(new_emoji)
_walletScreen.add_account_popup_do_primary_action()
@When("the user removes an account with name \"|any|\" and path \"|any|\" using password \"|any|\" and test cancel \"|any|\"")
def step(context, name, path, password, test_cancel):
_walletScreen.click_option_from_right_click_menu_of_account_with_name(MainWalletRightClickMenu.DELETE_ACCOUNT_ACTION_PLACEHOLDER.value, name)
_walletScreen.remove_account_popup_verify_account_account_to_be_removed(name, path)
if test_cancel == VALUE_YES:
_walletScreen.remove_account_popup_do_cancel_action()
_walletScreen.click_option_from_right_click_menu_of_account_with_name(MainWalletRightClickMenu.DELETE_ACCOUNT_ACTION_PLACEHOLDER.value, name)
_walletScreen.remove_account_popup_verify_account_account_to_be_removed(name, path)
_walletScreen.remove_account_popup_do_remove_action(True if path != NOT_APPLICABLE else False, password)
@When("the user sends a transaction to himself from account \"|any|\" of \"|any|\" \"|any|\" on \"|any|\" with password \"|any|\"")
def step(context, account_name, amount, token, chain_name, password):
_walletScreen.send_transaction(account_name, amount, token, chain_name, password)
@ -48,6 +150,18 @@ def step(context, network_name):
### VERIFICATIONS region:
#########################
@Then("the account is correctly displayed with \"|any|\" and \"|any|\" and emoji unicode \"|any|\"")
def step(context, name, color, emoji_unicode):
_walletScreen.verify_account_existence(name, color, emoji_unicode)
@Then("settings keycard section is opened")
def step(context):
_walletScreen.verify_keycard_settings_is_opened()
@Then("the account with \"|any|\" is not displayed")
def step(context, name):
_walletScreen.verify_account_doesnt_exist(name)
@Then("the user has a positive balance of \"|any|\"")
def step(context, symbol):
_walletScreen.verify_positive_balance(symbol)

View File

@ -4,6 +4,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAPSTYLE=script
TEST_CASES=tst_wallet tst_transaction
TEST_CASES=tst_wallet tst_transaction tst_wallet_section_accounts_management
VERSION=3
WRAPPERS=Qt

View File

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# This file contains hook functions to run as the .feature file is executed
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../testSuites/global_shared/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../shared/steps/"))
import steps.commonInitSteps as init_steps
import walletInitSteps as wallet_init_steps
# Global properties for the specific feature
_user = "tester123"
_password = "TesTEr16843/!@00"
@OnFeatureStart
def hook(context):
init_steps.context_init(context, testSettings)
init_steps.signs_up_process_steps(context, _user, _password)
wallet_init_steps.open_wallet()
@OnFeatureEnd
def hook(context):
currentApplicationContext().detach()
snooze(_app_closure_timeout)
@OnStepEnd
def hook(context):
context.userData["step_name"] = context._data["text"]

View File

@ -0,0 +1,10 @@
<testconfig version="1.0">
<information>
<summary/>
<description/>
</information>
<tags>
<tag>~mayfail</tag>
</tags>
<testsettings/>
</testconfig>

View File

@ -0,0 +1,165 @@
Feature: Status Desktop Wallet Section Wallet Account Management
As a user I want to add edit remove different types of wallet accounts
The feature start sequence is the following (setup on its own `bdd_hooks`):
** 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"
** and the user lands on the signed in app
** and the user opens the wallet section
** and the user accepts the signing phrase
Scenario Outline: The user edits default wallet account
When the user clicks on the default wallet account
And the user edits an account with "<name>" to "<new_name>" with color "#<new_color>" and emoji "<new_emoji>"
Then the account is correctly displayed with "<new_name>" and "#<new_color>" and emoji unicode "<new_emoji_unicode>"
Examples:
| name | new_name | new_color | new_emoji | new_emoji_unicode |
| Status account | My Primary Account | 7CDA00 | sunglasses | 1f60e |
Scenario Outline: The user manages a watch only account
When the user adds a watch only account "<address>" with "<name>" color "#<color>" and emoji "<emoji>" via "<add_via_context_menu>"
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>"
When the user edits an account with "<name>" to "<new_name>" with color "#<new_color>" and emoji "<new_emoji>"
Then the account is correctly displayed with "<new_name>" and "#<new_color>" and emoji unicode "<new_emoji_unicode>"
When the user removes an account with name "<new_name>" and path "<path>" using password "<password>" and test cancel "yes"
Then the account with "<new_name>" is not displayed
Examples:
| password | address | path | name | color | emoji | emoji_unicode | add_via_context_menu | new_name | new_color | new_emoji | new_emoji_unicode |
| N/A | 0xea123F7beFF45E3C9fdF54B324c29DBdA14a639A | N/A | AccWatch_1 | 2946C4 | sunglasses | 1f60e | yes | AccWatch_1_edited | 7CDA00 | thumbsup | 1f44d |
| N/A | 0xea123F7beFF45E3C9fdF54B324c29DBdA14a639B | N/A | AccWatch_2 | D37EF4 | sunglasses | 1f60e | no | AccWatch_2_edited | 26A69A | thumbsup | 1f44d |
##################################################################
# The following 2 scenarions have to be executed one after another,
# cause the second depends on the state made in the first one
#
# - Scenario Outline: The user manages a generated account
# - Scenario Outline: The user manages a custom generated account
##################################################################
Scenario Outline: The user manages a generated account
When the user adds a generated account with "<name>" color "#<color>" and emoji "<emoji>" via "<add_via_context_menu>" using password "<password>"
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>"
When the user edits an account with "<name>" to "<new_name>" with color "#<new_color>" and emoji "<new_emoji>"
Then the account is correctly displayed with "<new_name>" and "#<new_color>" and emoji unicode "<new_emoji_unicode>"
When the user removes an account with name "<new_name>" and path "<path>" using password "<password>" and test cancel "yes"
Then the account with "<new_name>" is not displayed
Examples:
| password | path | name | color | emoji | emoji_unicode | add_via_context_menu | new_name | new_color | new_emoji | new_emoji_unicode |
| TesTEr16843/!@00 | m/44'/60'/0'/0/1 | GenAcc_1 | 2946C4 | sunglasses | 1f60e | yes | GenAcc_1_edited | 7CDA00 | thumbsup | 1f44d |
| TesTEr16843/!@00 | m/44'/60'/0'/0/2 | GenAcc_2 | D37EF4 | sunglasses | 1f60e | no | GenAcc_2_edited | 26A69A | thumbsup | 1f44d |
Scenario Outline: The user manages a custom generated account
When the user adds to "N/A" a custom generated account with "<name>" color "#<color>" and emoji "<emoji>" using password "<password>" and setting custom path index "<index>" or selecting address with "<order>" using "<is_ethereum_root>"
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>"
When the user removes an account with name "<name>" and path "<path>" using password "<password>" and test cancel "no"
Then the account with "<name>" is not displayed
Examples:
| is_ethereum_root | index | order | password | path | name | color | emoji | emoji_unicode |
| yes | N/A | N/A | TesTEr16843/!@00 | m/44'/60'/0'/0/3 | CustomGenAcc_1 | 7CDA00 | sunglasses | 1f60e |
| yes | 10 | N/A | TesTEr16843/!@00 | m/44'/60'/0'/0/10 | CustomGenAcc_2 | D37EF4 | sunglasses | 1f60e |
| yes | N/A | 99 | TesTEr16843/!@00 | m/44'/60'/0'/0/99 | CustomGenAcc_3 | 26A69A | sunglasses | 1f60e |
| no | 10 | N/A | TesTEr16843/!@00 | m/44'/1'/0'/0/10 | CustomGenAcc_4 | D37EF4 | sunglasses | 1f60e |
| no | N/A | 99 | TesTEr16843/!@00 | m/44'/1'/0'/0/99 | CustomGenAcc_5 | 26A69A | sunglasses | 1f60e |
##################################################################
Scenario Outline: The user manages a private key imported account
When the user adds a private key account "<private_key>" with "<name>" color "#<color>" and emoji "<emoji>" using password "<password>" making keypair with name "<keypair_name>"
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>"
When the user edits an account with "<name>" to "<new_name>" with color "#<new_color>" and emoji "<new_emoji>"
Then the account is correctly displayed with "<new_name>" and "#<new_color>" and emoji unicode "<new_emoji_unicode>"
When the user removes an account with name "<new_name>" and path "<path>" using password "<password>" and test cancel "no"
Then the account with "<new_name>" is not displayed
Examples:
| password | keypair_name | private_key | path | name | color | emoji | emoji_unicode | new_name | new_color | new_emoji | new_emoji_unicode |
| TesTEr16843/!@00 | PrivateKeyKeypair | 2daa36a3abe381a9c01610bf10fda272fbc1b8a22179a39f782c512346e3e470 | N/A | PrivKeyAcc_1 | 2946C4 | sunglasses | 1f60e | PrivKeyAcc_1_edited | 7CDA00 | thumbsup | 1f44d |
Scenario Outline: The user manages a seed phrase imported account
When the user adds an imported seed phrase account "<seed_phrase>" with "<name>" color "#<color>" and emoji "<emoji>" using password "<password>" making keypair with name "<keypair_name>"
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>"
When the user edits an account with "<name>" to "<new_name>" with color "#<new_color>" and emoji "<new_emoji>"
Then the account is correctly displayed with "<new_name>" and "#<new_color>" and emoji unicode "<new_emoji_unicode>"
When the user removes an account with name "<new_name>" and path "<path>" using password "<password>" and test cancel "no"
Then the account with "<name>" is not displayed
Examples:
| password | keypair_name | path | seed_phrase | name | color | emoji | emoji_unicode | new_name | new_color | new_emoji | new_emoji_unicode |
| TesTEr16843/!@00 | SPKeyPair24 | m/44'/60'/0'/0/0 | elite dinosaur flavor canoe garbage palace antique dolphin virtual mixed sand impact solution inmate hair pipe affair cage vote estate gloom lamp robust like | SPAcc_24 | 2946C4 | sunglasses | 1f60e | SPAcc_24_edited | 7CDA00 | thumbsup | 1f44d |
| TesTEr16843/!@00 | SPKeyPair18 | m/44'/60'/0'/0/0 | kitten tiny cup admit cactus shrug shuffle accident century faith roof plastic beach police barely vacant sign blossom | SPAcc_18 | 2946C4 | sunglasses | 1f60e | SPAcc_18_edited | 7CDA00 | thumbsup | 1f44d |
| TesTEr16843/!@00 | SPKeyPair12 | m/44'/60'/0'/0/0 | pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial | SPAcc_12 | 2946C4 | sunglasses | 1f60e | SPAcc_12_edited | 7CDA00 | thumbsup | 1f44d |
##################################################################
# The following 2 scenarions have to be executed one after another,
# cause the second depends on the state made in the first one
#
# - Scenario Outline: The user adds an account from the imported seed phrase
# - Scenario Outline: The user manages an account created from the imported seed phrase
##################################################################
Scenario Outline: The user adds an account from the imported seed phrase
When the user adds an imported seed phrase account "<seed_phrase>" with "<name>" color "#<color>" and emoji "<emoji>" using password "<password>" making keypair with name "<keypair_name>"
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>"
Examples:
| password | keypair_name | path | seed_phrase | name | color | emoji | emoji_unicode |
| TesTEr16843/!@00 | SPKeyPair12 | m/44'/60'/0'/0/0 | pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial | SPAcc_12 | 2946C4 | sunglasses | 1f60e |
Scenario Outline: The user manages an account created from the imported seed phrase
When the user adds to "<keypair_name>" a custom generated account with "<name>" color "#<color>" and emoji "<emoji>" using password "<password>" and setting custom path index "<index>" or selecting address with "<order>" using "<is_ethereum_root>"
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>"
When the user removes an account with name "<name>" and path "<path>" using password "<password>" and test cancel "no"
Then the account with "<name>" is not displayed
Examples:
| keypair_name | is_ethereum_root | index | order | password | path | name | color | emoji | emoji_unicode |
| SPKeyPair12 | yes | N/A | N/A | TesTEr16843/!@00 | m/44'/60'/0'/0/1 | CustomGenAcc_1 | 7CDA00 | sunglasses | 1f60e |
| SPKeyPair12 | yes | 10 | N/A | TesTEr16843/!@00 | m/44'/60'/0'/0/10 | CustomGenAcc_2 | D37EF4 | sunglasses | 1f60e |
| SPKeyPair12 | yes | N/A | 99 | TesTEr16843/!@00 | m/44'/60'/0'/0/99 | CustomGenAcc_3 | 26A69A | sunglasses | 1f60e |
| SPKeyPair12 | no | 10 | N/A | TesTEr16843/!@00 | m/44'/1'/0'/0/10 | CustomGenAcc_4 | D37EF4 | sunglasses | 1f60e |
| SPKeyPair12 | no | N/A | 99 | TesTEr16843/!@00 | m/44'/1'/0'/0/99 | CustomGenAcc_5 | 26A69A | sunglasses | 1f60e |
##################################################################
##################################################################
# The following 2 scenarions have to be executed one after another,
# cause the second depends on the state made in the first one
#
# - Scenario Outline: The user adds and edits an account from the generated seed phrase
# - Scenario Outline: The user manages an account created from the generated seed phrase
##################################################################
Scenario Outline: The user adds and edits an account from the generated seed phrase
When the user adds a generated seed phrase account with "<name>" color "#<color>" and emoji "<emoji>" using password "<password>" making keypair with name "<keypair_name>"
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>"
When the user edits an account with "<name>" to "<new_name>" with color "#<new_color>" and emoji "<new_emoji>"
Then the account is correctly displayed with "<new_name>" and "#<new_color>" and emoji unicode "<new_emoji_unicode>"
Examples:
| password | keypair_name | name | color | emoji | emoji_unicode | new_name | new_color | new_emoji | new_emoji_unicode |
| TesTEr16843/!@00 | SPKeyPair | SPAcc | 2946C4 | sunglasses | 1f60e | SPAcc_edited | 7CDA00 | thumbsup | 1f44d |
Scenario Outline: The user manages an account created from the generated seed phrase
When the user adds to "<keypair_name>" a custom generated account with "<name>" color "#<color>" and emoji "<emoji>" using password "<password>" and setting custom path index "<index>" or selecting address with "<order>" using "<is_ethereum_root>"
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>"
When the user removes an account with name "<name>" and path "<path>" using password "<password>" and test cancel "no"
Then the account with "<name>" is not displayed
Examples:
| keypair_name | is_ethereum_root | index | order | password | path | name | color | emoji | emoji_unicode |
| SPKeyPair | yes | N/A | N/A | TesTEr16843/!@00 | m/44'/60'/0'/0/1 | CustomGenAcc_1 | 7CDA00 | sunglasses | 1f60e |
| SPKeyPair | yes | 10 | N/A | TesTEr16843/!@00 | m/44'/60'/0'/0/10 | CustomGenAcc_2 | D37EF4 | sunglasses | 1f60e |
| SPKeyPair | yes | N/A | 99 | TesTEr16843/!@00 | m/44'/60'/0'/0/99 | CustomGenAcc_3 | 26A69A | sunglasses | 1f60e |
| SPKeyPair | no | 10 | N/A | TesTEr16843/!@00 | m/44'/1'/0'/0/10 | CustomGenAcc_4 | D37EF4 | sunglasses | 1f60e |
| SPKeyPair | no | N/A | 99 | TesTEr16843/!@00 | m/44'/1'/0'/0/99 | CustomGenAcc_5 | 26A69A | sunglasses | 1f60e |
##################################################################
Scenario: The user adds an account and then decides to use a Keycard
When the user adds new master key and go to use a Keycard
Then settings keycard section is opened

View File

@ -0,0 +1,8 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/')
def main():
testSettings.throwOnFailure = True
runFeatureFile('test.feature')