status-desktop/test/e2e/gui/components/toast_message.py

24 lines
671 B
Python
Raw Normal View History

import allure
2023-10-25 12:34:00 +00:00
import driver
from gui.elements.object import QObject
class ToastMessage(QObject):
def __init__(self):
super(ToastMessage, self).__init__('ephemeral_Notification_List')
self._toast_message = QObject('ephemeralNotificationList_StatusToastMessage')
2023-10-25 12:34:00 +00:00
@property
@allure.step('Get toast messages')
def get_toast_messages(self):
messages = []
for obj in driver.findAllObjects(self._toast_message.real_name):
2023-10-25 12:34:00 +00:00
messages.append(str(obj.primaryText))
if len(messages) == 0:
raise LookupError(
'Toast messages were not found')
else:
return messages