chore(@e2e): change object name for AccountListItem

This commit is contained in:
Anastasiya Semenkevich 2024-10-28 12:54:23 +03:00 committed by Anastasiya
parent d511c25d2e
commit 4409c20264
3 changed files with 9 additions and 9 deletions

View File

@ -9,7 +9,7 @@ mainWallet_Saved_Addresses_Button = {"container": mainWindow_RighPanel, "objectN
walletAccounts_StatusListView = {"container": statusDesktop_mainWindow, "objectName": "walletAccountsListView", "type": "StatusListView", "visible": True} 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_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} 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} mainWallet_All_Accounts_Balance = {"container": mainWallet_All_Accounts_Button, "objectName": "walletLeftListAmountValue", "type": "StatusTextWithLoadingState", "visible": True}
# Saved Address View # Saved Address View

View File

@ -50,10 +50,11 @@ class LeftPanel(QObject):
def accounts(self) -> typing.List[constants.user.account_list_item]: def accounts(self) -> typing.List[constants.user.account_list_item]:
if 'title' in self._wallet_account_item.real_name.keys(): if 'title' in self._wallet_account_item.real_name.keys():
del self._wallet_account_item.real_name['title'] 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 = [] accounts = []
for account_item in driver.findAllObjects(self._wallet_account_item.real_name): if len(raw_data) > 0:
try: for account_item in raw_data:
name = str(account_item.title) name = str(account_item.title)
# TODO: to fix properly with account data class implementation # TODO: to fix properly with account data class implementation
# color = str(account_item.asset.color.name).lower() # color = str(account_item.asset.color.name).lower()
@ -63,9 +64,8 @@ class LeftPanel(QObject):
# emoji = str(child.emojiId) # emoji = str(child.emojiId)
# break # break
accounts.append(constants.user.account_list_item(name, None, None)) accounts.append(constants.user.account_list_item(name, None, None))
except (AttributeError, RuntimeError): else:
continue raise LookupError("Account items were not found")
return accounts return accounts
@allure.step('Get total balance value from All 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] existing_accounts_names = [account.name for account in account_items]
if account_name in existing_accounts_names: if account_name in existing_accounts_names:
self._wallet_account_item.real_name['title'] = account_name self._wallet_account_item.real_name['title'] = account_name
self._wallet_account_item.click()
time.sleep(0.5) time.sleep(0.5)
self._wallet_account_item.click()
self._wallet_account_item.right_click() self._wallet_account_item.right_click()
return ContextMenu() return ContextMenu()
else: else:

View File

@ -256,7 +256,7 @@ Rectangle {
readonly property bool footerOverlayed: d.loaded && contentHeight > availableHeight readonly property bool footerOverlayed: d.loaded && contentHeight > availableHeight
delegate: StatusListItem { delegate: StatusListItem {
objectName: "walletAccount-" + model.name objectName: "walletAccountListItem"
readonly property bool itemLoaded: !model.assetsLoading // needed for e2e tests readonly property bool itemLoaded: !model.assetsLoading // needed for e2e tests
width: ListView.view.width - Theme.padding * 2 width: ListView.view.width - Theme.padding * 2
highlighted: RootStore.selectedAddress.toLowerCase() === model.address.toLowerCase() highlighted: RootStore.selectedAddress.toLowerCase() === model.address.toLowerCase()