chore: fix for nightly fail

This commit is contained in:
Valentina Novgorodtceva 2024-06-06 13:14:30 +07:00 committed by Anastasiya
parent 51770b063d
commit 97291731ac
2 changed files with 14 additions and 6 deletions

View File

@ -1,3 +1,5 @@
import time
import allure
import configs
@ -8,7 +10,7 @@ from gui.objects_map import names
class EmojiPopup(QObject):
def __init__(self):
super(EmojiPopup, self).__init__(names.mainWallet_AddEditAccountPopup_AccountEmojiSearchBox)
super(EmojiPopup, self).__init__()
self._search_text_edit = TextEdit(names.mainWallet_AddEditAccountPopup_AccountEmojiSearchBox)
self._emoji_item = QObject(names.mainWallet_AddEditAccountPopup_AccountEmoji)
@ -17,11 +19,17 @@ class EmojiPopup(QObject):
self._search_text_edit.wait_until_appears(timeout_msec)
return self
@allure.step('Wait until hidden {0}')
def wait_until_hidden(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._search_text_edit.wait_until_hidden(timeout_msec)
return self
@allure.step('Select emoji')
def select(self, name: str, attempts: int = 2):
self._search_text_edit.text = name
self._emoji_item.real_name['objectName'] = 'statusEmoji_' + name
try:
time.sleep(0.5)
self._emoji_item.click()
except LookupError as err:
if attempts:

View File

@ -102,18 +102,18 @@ class AccountPopup(BasePopup):
@allure.step('Set private key for account')
def set_origin_private_key(self, value: str):
self._origin_combobox.click()
self.click_new_master_key(value).import_private_key(value)
self.click_new_master_key().import_private_key(value)
return self
@allure.step('Click new master key item')
def click_new_master_key(self, value: str, attempts: int = 2):
def click_new_master_key(self, attempts: int = 2):
self._new_master_key_origin_item.click()
try:
AccountPopup().verify_add_account_popup_present()
return AddNewAccountPopup()
except AssertionError as err:
if attempts:
return self.click_new_master_key(value, attempts - 1)
return self.click_new_master_key(attempts - 1)
else:
raise err
@ -130,7 +130,7 @@ class AccountPopup(BasePopup):
@allure.step('Open add new account popup')
def open_add_new_account_popup(self):
self._origin_combobox.click()
self._new_master_key_origin_item.click()
self.click_new_master_key()
return AddNewAccountPopup().wait_until_appears()
@allure.step('Set derivation path for account')
@ -154,7 +154,7 @@ class AccountPopup(BasePopup):
@allure.step('Click continue in keycard settings')
def continue_in_keycard_settings(self):
self._origin_combobox.click()
self._new_master_key_origin_item.click()
self.click_new_master_key()
self._use_keycard_button.click()
return self