Skip to content

Commit

Permalink
chore: change a bit accounts list method
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiyaig committed Feb 7, 2025
1 parent 48d886e commit 0bdfadd
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions test/e2e/gui/screens/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import configs
import constants
import driver
from constants import WalletAccount
from driver.objects_access import walk_children
from gui.components.context_menu import ContextMenu
from gui.components.wallet.add_saved_address_popup import AddressPopup, EditSavedAddressPopup
Expand Down Expand Up @@ -47,26 +48,24 @@ def is_total_balance_visible(self) -> bool:

@property
@allure.step('Get all accounts from list')
def accounts(self) -> typing.List[constants.WalletAccount]:
def accounts(self) -> typing.List[WalletAccount]:
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 for the left panel to refresh
raw_data = driver.findAllObjects(self._wallet_account_item.real_name)
accounts = []
if len(raw_data) > 0:
try:
for account_item in raw_data:
name = str(account_item.title)
color = str(account_item.asset.color.name).lower()
emoji = ''
for child in walk_children(account_item):
if hasattr(child, 'emojiId'):
emoji = str(child.emojiId)
break
accounts.append(constants.WalletAccount(name, color, emoji.split('-')[0]))
return accounts
except LookupError as err:
raise err
if raw_data:
for account_item in raw_data:
name = str(account_item.title)
color = str(account_item.asset.color.name).lower()
emoji = ''
for child in walk_children(account_item):
if hasattr(child, 'emojiId'):
emoji = str(child.emojiId)
break
accounts.append(constants.WalletAccount(name=name, color=color, emoji=emoji.split('-')[0]))
return accounts
raise LookupError('Accounts were not found')

@allure.step('Get total balance value from All accounts')
def get_total_balance_value(self):
Expand Down

0 comments on commit 0bdfadd

Please sign in to comment.