mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 08:37:12 +00:00
chore: fix for nightly fail
This commit is contained in:
parent
51770b063d
commit
97291731ac
@ -1,3 +1,5 @@
|
|||||||
|
import time
|
||||||
|
|
||||||
import allure
|
import allure
|
||||||
|
|
||||||
import configs
|
import configs
|
||||||
@ -8,7 +10,7 @@ from gui.objects_map import names
|
|||||||
|
|
||||||
class EmojiPopup(QObject):
|
class EmojiPopup(QObject):
|
||||||
def __init__(self):
|
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._search_text_edit = TextEdit(names.mainWallet_AddEditAccountPopup_AccountEmojiSearchBox)
|
||||||
self._emoji_item = QObject(names.mainWallet_AddEditAccountPopup_AccountEmoji)
|
self._emoji_item = QObject(names.mainWallet_AddEditAccountPopup_AccountEmoji)
|
||||||
|
|
||||||
@ -17,11 +19,17 @@ class EmojiPopup(QObject):
|
|||||||
self._search_text_edit.wait_until_appears(timeout_msec)
|
self._search_text_edit.wait_until_appears(timeout_msec)
|
||||||
return self
|
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')
|
@allure.step('Select emoji')
|
||||||
def select(self, name: str, attempts: int = 2):
|
def select(self, name: str, attempts: int = 2):
|
||||||
self._search_text_edit.text = name
|
self._search_text_edit.text = name
|
||||||
self._emoji_item.real_name['objectName'] = 'statusEmoji_' + name
|
self._emoji_item.real_name['objectName'] = 'statusEmoji_' + name
|
||||||
try:
|
try:
|
||||||
|
time.sleep(0.5)
|
||||||
self._emoji_item.click()
|
self._emoji_item.click()
|
||||||
except LookupError as err:
|
except LookupError as err:
|
||||||
if attempts:
|
if attempts:
|
||||||
|
@ -102,18 +102,18 @@ class AccountPopup(BasePopup):
|
|||||||
@allure.step('Set private key for account')
|
@allure.step('Set private key for account')
|
||||||
def set_origin_private_key(self, value: str):
|
def set_origin_private_key(self, value: str):
|
||||||
self._origin_combobox.click()
|
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
|
return self
|
||||||
|
|
||||||
@allure.step('Click new master key item')
|
@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()
|
self._new_master_key_origin_item.click()
|
||||||
try:
|
try:
|
||||||
AccountPopup().verify_add_account_popup_present()
|
AccountPopup().verify_add_account_popup_present()
|
||||||
return AddNewAccountPopup()
|
return AddNewAccountPopup()
|
||||||
except AssertionError as err:
|
except AssertionError as err:
|
||||||
if attempts:
|
if attempts:
|
||||||
return self.click_new_master_key(value, attempts - 1)
|
return self.click_new_master_key(attempts - 1)
|
||||||
else:
|
else:
|
||||||
raise err
|
raise err
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ class AccountPopup(BasePopup):
|
|||||||
@allure.step('Open add new account popup')
|
@allure.step('Open add new account popup')
|
||||||
def open_add_new_account_popup(self):
|
def open_add_new_account_popup(self):
|
||||||
self._origin_combobox.click()
|
self._origin_combobox.click()
|
||||||
self._new_master_key_origin_item.click()
|
self.click_new_master_key()
|
||||||
return AddNewAccountPopup().wait_until_appears()
|
return AddNewAccountPopup().wait_until_appears()
|
||||||
|
|
||||||
@allure.step('Set derivation path for account')
|
@allure.step('Set derivation path for account')
|
||||||
@ -154,7 +154,7 @@ class AccountPopup(BasePopup):
|
|||||||
@allure.step('Click continue in keycard settings')
|
@allure.step('Click continue in keycard settings')
|
||||||
def continue_in_keycard_settings(self):
|
def continue_in_keycard_settings(self):
|
||||||
self._origin_combobox.click()
|
self._origin_combobox.click()
|
||||||
self._new_master_key_origin_item.click()
|
self.click_new_master_key()
|
||||||
self._use_keycard_button.click()
|
self._use_keycard_button.click()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user