From b211d70b6ea2abe1d3e755029a3fd79231ff10f3 Mon Sep 17 00:00:00 2001 From: Anastasiya <82375995+anastasiyaig@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:07:12 +0300 Subject: [PATCH] Chore: improve emoji popup and syncing settings option selection (#253) * chore: emoji popup for wallet account has verification for popup is hidden * chore: add one more attempt to open syncing screen --- gui/components/emoji_popup.py | 16 +++++++++++----- gui/screens/settings.py | 10 ++++++++-- .../test_wallet_main_saved_addresses.py | 2 -- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/gui/components/emoji_popup.py b/gui/components/emoji_popup.py index 128255b..c8ab88c 100644 --- a/gui/components/emoji_popup.py +++ b/gui/components/emoji_popup.py @@ -6,9 +6,9 @@ from gui.elements.text_edit import TextEdit from .base_popup import BasePopup -class EmojiPopup(BasePopup): +class EmojiPopup(QObject): def __init__(self): - super(EmojiPopup, self).__init__() + super(EmojiPopup, self).__init__('mainWallet_AddEditAccountPopup_AccountEmojiSearchBox') self._search_text_edit = TextEdit('mainWallet_AddEditAccountPopup_AccountEmojiSearchBox') self._emoji_item = QObject('mainWallet_AddEditAccountPopup_AccountEmoji') @@ -18,8 +18,14 @@ class EmojiPopup(BasePopup): return self @allure.step('Select emoji') - def select(self, name: str): + def select(self, name: str, attempts: int = 2): self._search_text_edit.text = name self._emoji_item.real_name['objectName'] = 'statusEmoji_' + name - self._emoji_item.click() - self._search_text_edit.wait_until_hidden() + try: + self._emoji_item.click() + except LookupError as err: + if attempts: + return self.select(name, attempts - 1) + else: + raise err + EmojiPopup().wait_until_hidden() diff --git a/gui/screens/settings.py b/gui/screens/settings.py index 5fc8709..3f0e15a 100644 --- a/gui/screens/settings.py +++ b/gui/screens/settings.py @@ -55,9 +55,15 @@ class LeftPanel(QObject): return BackUpYourSeedPhrasePopUp() @allure.step('Open syncing settings') - def open_syncing_settings(self): + def open_syncing_settings(self, attempts: int = 2): self._open_settings('8-MainMenuItem') - return SyncingSettingsView() + try: + return SyncingSettingsView().wait_until_appears() + except AssertionError: + if attempts: + return self.open_syncing_settings(attempts - 1) + else: + raise f"Sync settings was not opened" @allure.step('Choose sign out and quit in settings') def sign_out_and_quit(self): diff --git a/tests/wallet_main_screen/test_wallet_main_saved_addresses.py b/tests/wallet_main_screen/test_wallet_main_saved_addresses.py index 17673dc..c7c55c6 100644 --- a/tests/wallet_main_screen/test_wallet_main_saved_addresses.py +++ b/tests/wallet_main_screen/test_wallet_main_saved_addresses.py @@ -7,8 +7,6 @@ import driver from gui.components.signing_phrase_popup import SigningPhrasePopup from gui.main_window import MainWindow -pytestmark = allure.suite("Wallet") - @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703021', 'Manage a saved address') @pytest.mark.case(703021)