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
This commit is contained in:
Anastasiya 2023-11-02 19:07:12 +03:00 committed by GitHub
parent f402140d2f
commit 950b9dfa8a
3 changed files with 19 additions and 9 deletions

View File

@ -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()

View File

@ -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):

View File

@ -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)