From a7eb8d9c77263e09f1e984ddbb52204c84200dd0 Mon Sep 17 00:00:00 2001 From: Anastasiya Semenkevich Date: Tue, 24 Sep 2024 12:18:09 +0300 Subject: [PATCH] chore: fix test for sending transaction --- test/e2e/gui/components/wallet/send_popup.py | 2 +- test/e2e/gui/components/wallet/token_selector_popup.py | 7 ++++--- test/e2e/gui/objects_map/names.py | 1 + .../AppLayouts/Wallet/views/TokenSelectorAssetDelegate.qml | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/e2e/gui/components/wallet/send_popup.py b/test/e2e/gui/components/wallet/send_popup.py index faef716736..491f0f800b 100644 --- a/test/e2e/gui/components/wallet/send_popup.py +++ b/test/e2e/gui/components/wallet/send_popup.py @@ -34,7 +34,7 @@ class SendPopup(BasePopup): self._fiat_fees_label = TextLabel(names.fiatFees_StatusBaseText) self._send_button = Button(names.send_StatusFlatButton) self._account_selector = QObject(names.accountSelector_AccountSelectorHeader) - self._holding_selector = QObject(names.holdingSelector_TokenSelectorNew) + self._holding_selector = Button(names.tokenSelectorButton) @allure.step('Wait until appears {0}') def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC): diff --git a/test/e2e/gui/components/wallet/token_selector_popup.py b/test/e2e/gui/components/wallet/token_selector_popup.py index b8ffead76c..edbd1d968a 100644 --- a/test/e2e/gui/components/wallet/token_selector_popup.py +++ b/test/e2e/gui/components/wallet/token_selector_popup.py @@ -1,12 +1,13 @@ import driver +from gui.components.base_popup import BasePopup from gui.elements.object import QObject from gui.elements.text_edit import TextEdit from gui.objects_map import names -class TokenSelectorPopup(QObject): +class TokenSelectorPopup(BasePopup): def __init__(self): - super().__init__(names.tokenSelectorPanel_TokenSelectorNew) + super().__init__() self.token_selector_panel = QObject(names.tokenSelectorPanel_TokenSelectorNew) self.tab_bar = QObject(names.tokensTabBar_StatusTabBar) self.assets_tab = QObject(names.tokenSelectorPanel_AssetsTab) @@ -19,7 +20,7 @@ class TokenSelectorPopup(QObject): assets_list = driver.findAllObjects(self.asset_list_item.real_name) assert assets_list, f'Assets are not displayed' for item in assets_list: - if getattr(item, 'tokensKey', '') == asset_name: + if getattr(item, 'symbol', '') == asset_name: QObject(item).click() break return self diff --git a/test/e2e/gui/objects_map/names.py b/test/e2e/gui/objects_map/names.py index ec957158a5..bc3f8a4d0d 100644 --- a/test/e2e/gui/objects_map/names.py +++ b/test/e2e/gui/objects_map/names.py @@ -543,6 +543,7 @@ networkSelectorDelegate_Arbitrum_NetworkSelectItemDelegate = {"container": statu # Bridge popup holdingSelector_TokenSelectorNew = {"container": statusDesktop_mainWindow_overlay, "objectName": "holdingSelector", "type": "TokenSelectorNew", "visible": True} +tokenSelectorButton = {"container": statusDesktop_mainWindow_overlay, "id": "tokenSelectorButton", "type": "TokenSelectorButton", "unnamed": 1, "visible": True} modalHeader_HeaderTitleText = {"container": statusDesktop_mainWindow_overlay, "objectName": "modalHeader", "type": "HeaderTitleText", "visible": True} # Token Selector popup diff --git a/ui/app/AppLayouts/Wallet/views/TokenSelectorAssetDelegate.qml b/ui/app/AppLayouts/Wallet/views/TokenSelectorAssetDelegate.qml index 605fb14759..f686ba5887 100644 --- a/ui/app/AppLayouts/Wallet/views/TokenSelectorAssetDelegate.qml +++ b/ui/app/AppLayouts/Wallet/views/TokenSelectorAssetDelegate.qml @@ -11,6 +11,8 @@ import utils 1.0 ItemDelegate { id: root + objectName: "tokenSelectorAssetDelegate_" + name + required property string name required property string symbol required property string currencyBalanceAsString