chore: fix get chats list method (maybe)
This commit is contained in:
parent
058f4b529b
commit
fba46c09c6
|
@ -41,15 +41,15 @@ class LeftPanel(QObject):
|
||||||
|
|
||||||
@allure.step('Open chat')
|
@allure.step('Open chat')
|
||||||
def get_chats_list(self):
|
def get_chats_list(self):
|
||||||
|
started_at = time.monotonic()
|
||||||
chats_list = []
|
chats_list = []
|
||||||
for obj in driver.findAllObjects(self._chat_list_item.real_name):
|
while True:
|
||||||
chats_list.append(str(obj.name))
|
for obj in driver.findAllObjects(self._chat_list_item.real_name):
|
||||||
|
chats_list.append(str(obj.name))
|
||||||
if len(chats_list) == 0:
|
if time.monotonic() - started_at > 10 and len(chats_list) == 0:
|
||||||
raise LookupError(
|
raise LookupError('Chats list is empty')
|
||||||
'Chats list is empty')
|
else:
|
||||||
else:
|
return chats_list
|
||||||
return chats_list
|
|
||||||
|
|
||||||
@allure.step('Click chat item')
|
@allure.step('Click chat item')
|
||||||
def click_chat_by_name(self, chat_name: str):
|
def click_chat_by_name(self, chat_name: str):
|
||||||
|
|
Loading…
Reference in New Issue