This commit is contained in:
Valentina Novgorodtceva 2024-03-12 18:17:00 +07:00
parent 3f714531ad
commit 42442755c4
2 changed files with 6 additions and 1 deletions

View File

@ -16,7 +16,7 @@ class ToastMessage(QObject):
@allure.step('Get toast messages')
def get_toast_messages(self) -> typing.List[str]:
messages = []
for child in walk_children(self.object):
for child in walk_children(self.object_exists):
if getattr(child, 'id', '') == 'title':
messages.append(str(child.text))
if len(messages) == 0:

View File

@ -23,6 +23,11 @@ class QObject:
def object(self):
return driver.waitForObject(self.real_name, configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
@property
@allure.step('Get object {0}')
def object_exists(self):
return driver.waitForObjectExists(self.real_name, configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
@property
@allure.step('Get object exists {0}')
def exists(self) -> bool: