status-desktop/test/e2e/gui/components/wallet/authenticate_popup.py
Anastasiya Semenkevich 87b472e997 chore: add watched address is now standalone
Move the Add watched address to a separate file
Added a small verification to origin option selected
Removed steps with deletion as i plan to cover differently
The delete functionality is still being checked in another test
Added a verification for authentication button is not available for adding of watched addresses
2023-11-03 20:39:40 +03:00

31 lines
1000 B
Python

import allure
from gui.elements.button import Button
from gui.elements.object import QObject
from gui.elements.text_edit import TextEdit
class AuthenticatePopup(QObject):
def __init__(self):
super(AuthenticatePopup, self).__init__('contextMenu_PopupItem')
self._password_text_edit = TextEdit('sharedPopup_Password_Input')
self._primary_button = Button('sharedPopup_Primary_Button')
@allure.step('Authenticate action with password')
def authenticate(self, password: str, attempt: int = 2):
self._password_text_edit.text = password
self._primary_button.click()
try:
self._primary_button.wait_until_hidden()
except AssertionError as err:
if attempt:
self.authenticate(password, attempt - 1)
else:
raise err
@allure.step('Check if authenticate button is present')
def is_authenticate_button_visible(self):
return self._primary_button.is_visible