2023-09-11 18:24:13 +00:00
|
|
|
import allure
|
|
|
|
|
|
|
|
import configs
|
|
|
|
from gui.components.base_popup import BasePopup
|
2023-10-06 08:33:42 +00:00
|
|
|
from gui.elements.button import Button
|
|
|
|
from gui.elements.object import QObject
|
|
|
|
from gui.elements.text_edit import TextEdit
|
2024-02-13 09:04:24 +00:00
|
|
|
from gui.objects_map import names
|
2023-09-11 18:24:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AuthenticatePopup(BasePopup):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
2024-02-13 09:04:24 +00:00
|
|
|
self._content = QObject(names.keycardSharedPopupContent_KeycardPopupContent)
|
2024-03-26 06:39:37 +00:00
|
|
|
self._password_text_edit = TextEdit(names.password_PlaceholderText)
|
2024-02-13 09:04:24 +00:00
|
|
|
self._authenticate_button = Button(names.authenticate_StatusButton)
|
|
|
|
self._close_button = Button(names.headerCloseButton_StatusFlatRoundButton)
|
2023-09-11 18:24:13 +00:00
|
|
|
|
|
|
|
@allure.step('Wait until appears {0}')
|
|
|
|
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
|
|
|
|
self._content.wait_until_appears(timeout_msec)
|
|
|
|
return self
|
|
|
|
|
|
|
|
@allure.step('Authenticate actions with password {0}')
|
|
|
|
def authenticate(self, password: str):
|
2024-03-26 06:39:37 +00:00
|
|
|
self._password_text_edit.type_text(password)
|
2023-09-11 18:24:13 +00:00
|
|
|
self._authenticate_button.click()
|
2024-05-03 09:36:51 +00:00
|
|
|
self._authenticate_button.wait_until_hidden(10000)
|
2023-11-27 10:44:30 +00:00
|
|
|
|
|
|
|
@allure.step('Close authenticate popup by close button')
|
|
|
|
def close_authenticate_popup(self):
|
|
|
|
self._close_button.click()
|