status-desktop/test/e2e/gui/components/settings/verify_identity_popup.py

39 lines
1.4 KiB
Python
Raw Normal View History

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
class VerifyIdentityPopup(BasePopup):
def __init__(self):
super().__init__()
self._message_input = QObject('messageInput_StatusInput')
self._identity_verification_text_field = TextEdit('profileSendContactRequestModal_sayWhoYouAreInput_TextEdit')
self._send_verification_button = TextEdit('send_verification_request_StatusButton')
@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