desktop-qa-automation/gui/components/settings/respond_to_id_request_popup.py
Valentina1133 47d70565d5
Test/test settings messaging identity verification (#341)
* test: test_messaging_settings_identity_verification added

* chore: skipped test_settings_include_in_total_balance
2023-11-28 15:26:05 +03:00

50 lines
1.8 KiB
Python

import allure
import configs
import driver
from gui.components.base_popup import BasePopup
from gui.elements.button import Button
from gui.elements.object import QObject
from gui.elements.text_edit import TextEdit
class RespondToIDRequestPopup(BasePopup):
def __init__(self):
super().__init__()
self._message_input = QObject('messageInput_StatusInput')
self._answer_to_verification_request_field = TextEdit('edit_TextEdit')
self._send_answer_button = Button('send_Answer_StatusButton')
self._refuse_verification_button = Button('refuse_Verification_StatusButton')
self._change_answer_button = Button('change_answer_StatusFlatButton')
self._close_button = Button('close_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 answer button enabled state')
def is_send_answer_button_enabled(self) -> bool:
return driver.waitForObjectExists(self._send_answer_button.real_name,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC).enabled
@property
@allure.step('Get change answer button visible state')
def is_change_answer_button_visible(self) -> bool:
return self._change_answer_button.is_visible
@allure.step('Click send answer button')
def send_answer(self):
self._send_answer_button.click()
@allure.step('Type message in verification answer')
def type_message(self, value: str):
self._answer_to_verification_request_field.text = value
return self
@allure.step('Close identification answer popup')
def close(self):
self._close_button.click()