From 4409c20264807a831cb1c879b36bc21299ceb1aa Mon Sep 17 00:00:00 2001 From: Anastasiya Semenkevich Date: Mon, 28 Oct 2024 12:54:23 +0300 Subject: [PATCH] chore(@e2e): change object name for AccountListItem --- test/e2e/gui/objects_map/wallet_names.py | 2 +- test/e2e/gui/screens/wallet.py | 14 +++++++------- ui/app/AppLayouts/Wallet/views/LeftTabView.qml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/e2e/gui/objects_map/wallet_names.py b/test/e2e/gui/objects_map/wallet_names.py index 20168d4d4a..bf2eaa0722 100644 --- a/test/e2e/gui/objects_map/wallet_names.py +++ b/test/e2e/gui/objects_map/wallet_names.py @@ -9,7 +9,7 @@ mainWallet_Saved_Addresses_Button = {"container": mainWindow_RighPanel, "objectN walletAccounts_StatusListView = {"container": statusDesktop_mainWindow, "objectName": "walletAccountsListView", "type": "StatusListView", "visible": True} mainWallet_All_Accounts_Button = {"container": walletAccounts_StatusListView, "objectName": "allAccountsBtn", "type": "Button", "visible": True} mainWallet_Add_Account_Button = {"container": statusDesktop_mainWindow, "objectName": "addAccountButton", "type": "StatusRoundButton", "visible": True} -walletAccount_StatusListItem = {"container": walletAccounts_StatusListView, "objectName": RegularExpression("walletAccount*"), "type": "StatusListItem", "visible": True} +walletAccount_StatusListItem = {"container": walletAccounts_StatusListView, "objectName": "walletAccountListItem", "type": "StatusListItem", "visible": True} mainWallet_All_Accounts_Balance = {"container": mainWallet_All_Accounts_Button, "objectName": "walletLeftListAmountValue", "type": "StatusTextWithLoadingState", "visible": True} # Saved Address View diff --git a/test/e2e/gui/screens/wallet.py b/test/e2e/gui/screens/wallet.py index e03f8b8708..79eeab09c5 100644 --- a/test/e2e/gui/screens/wallet.py +++ b/test/e2e/gui/screens/wallet.py @@ -50,10 +50,11 @@ class LeftPanel(QObject): def accounts(self) -> typing.List[constants.user.account_list_item]: if 'title' in self._wallet_account_item.real_name.keys(): del self._wallet_account_item.real_name['title'] - + time.sleep(1) # to give a chance to build the list + raw_data = driver.findAllObjects(self._wallet_account_item.real_name) accounts = [] - for account_item in driver.findAllObjects(self._wallet_account_item.real_name): - try: + if len(raw_data) > 0: + for account_item in raw_data: name = str(account_item.title) # TODO: to fix properly with account data class implementation # color = str(account_item.asset.color.name).lower() @@ -63,9 +64,8 @@ class LeftPanel(QObject): # emoji = str(child.emojiId) # break accounts.append(constants.user.account_list_item(name, None, None)) - except (AttributeError, RuntimeError): - continue - + else: + raise LookupError("Account items were not found") return accounts @allure.step('Get total balance value from All accounts') @@ -98,8 +98,8 @@ class LeftPanel(QObject): existing_accounts_names = [account.name for account in account_items] if account_name in existing_accounts_names: self._wallet_account_item.real_name['title'] = account_name - self._wallet_account_item.click() time.sleep(0.5) + self._wallet_account_item.click() self._wallet_account_item.right_click() return ContextMenu() else: diff --git a/ui/app/AppLayouts/Wallet/views/LeftTabView.qml b/ui/app/AppLayouts/Wallet/views/LeftTabView.qml index 2c5c9f445b..b9dbd7c9ef 100644 --- a/ui/app/AppLayouts/Wallet/views/LeftTabView.qml +++ b/ui/app/AppLayouts/Wallet/views/LeftTabView.qml @@ -256,7 +256,7 @@ Rectangle { readonly property bool footerOverlayed: d.loaded && contentHeight > availableHeight delegate: StatusListItem { - objectName: "walletAccount-" + model.name + objectName: "walletAccountListItem" readonly property bool itemLoaded: !model.assetsLoading // needed for e2e tests width: ListView.view.width - Theme.padding * 2 highlighted: RootStore.selectedAddress.toLowerCase() === model.address.toLowerCase()