status-desktop/test/e2e/gui/components/community/pinned_messages_popup.py

33 lines
1.1 KiB
Python

import allure
import configs
from gui.components.base_popup import BasePopup
from gui.elements.button import Button
from gui.elements.object import QObject
from gui.objects_map import names
class PinnedMessagesPopup(BasePopup):
def __init__(self):
super().__init__()
self._close_button = Button(names.headerActionsCloseButton_StatusFlatRoundButton)
self._unpin_button = Button(names.unpinButton_StatusFlatRoundButton)
self._pinned_message_details = QObject(names.o_StatusPinMessageDetails)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._pinned_message_details.wait_until_appears(timeout_msec)
return self
@allure.step('Unpin message')
def unpin_message(self):
self._pinned_message_details.hover()
self._unpin_button.click()
return self
@allure.step('Close pinned messages popup')
def close(self):
self._close_button.click()
self._pinned_message_details.wait_until_hidden()