2023-11-28 12:26:05 +00:00
|
|
|
import allure
|
|
|
|
|
|
|
|
import configs
|
|
|
|
import driver
|
|
|
|
from gui.components.base_popup import BasePopup
|
|
|
|
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-11-28 12:26:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
class VerifyIdentityPopup(BasePopup):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
2024-02-13 09:04:24 +00:00
|
|
|
self._message_input = QObject(names.messageInput_StatusInput)
|
|
|
|
self._identity_verification_text_field = TextEdit(names.profileSendContactRequestModal_sayWhoYouAreInput_TextEdit)
|
|
|
|
self._send_verification_button = TextEdit(names.send_verification_request_StatusButton)
|
2023-11-28 12:26:05 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
@allure.step('Get message note from identity verification request')
|
|
|
|
def message_note(self) -> str:
|
|
|
|
return str(self._message_input.object.placeholderText)
|
|
|
|
|
|
|
|
@property
|
|
|
|
@allure.step('Get send verification button enabled state')
|
|
|
|
def is_send_verification_button_enabled(self) -> bool:
|
|
|
|
return driver.waitForObjectExists(self._send_verification_button.real_name,
|
|
|
|
configs.timeouts.UI_LOAD_TIMEOUT_MSEC).enabled
|
|
|
|
|
|
|
|
@allure.step('Click send verification button')
|
|
|
|
def send_verification(self):
|
|
|
|
self._send_verification_button.click()
|
|
|
|
self.wait_until_hidden()
|
|
|
|
return self
|
|
|
|
|
|
|
|
@allure.step('Type message in verification request')
|
|
|
|
def type_message(self, value: str):
|
|
|
|
self._identity_verification_text_field.text = value
|
|
|
|
return self
|