chore: fix for 1-1 chat test

This commit is contained in:
Valentina Novgorodtceva 2024-04-08 17:48:27 +07:00 committed by Anastasiya
parent a78381bf9e
commit 531abf4cb5
2 changed files with 4 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import allure
import pytest
from allure_commons._allure import step
import driver
from gui.screens.messages import MessagesScreen, ToolBar, ChatMessagesView
from tests.settings.settings_messaging import marks
@ -110,14 +111,14 @@ def test_1x1_chat(multiple_instances):
message_objects = messages_screen.chat.messages(1)
message_items = [message.text for message in message_objects]
for message_item in message_items:
assert chat_message2 in message_item
assert driver.waitFor(lambda: chat_message2 in message_item, configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
with step(f'User {user_one.name}, received emoji from {user_two.name}'):
time.sleep(2)
message_objects = messages_screen.chat.messages(0)
message_items = [message.text for message in message_objects]
for message_item in message_items:
assert '😎' in message_item
assert driver.waitFor(lambda: '😎' in message_item, configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
with step(f'User {user_one.name}, delete own message and verify it was deleted'):
message = messages_screen.left_panel.click_chat_by_name(user_two.name).find_message_by_text(chat_message1, 2)

View File

@ -135,7 +135,7 @@ def test_group_chat(multiple_instances, user_data_one, user_data_two, user_data_
with step(f'Check that {user_three.name} is not a member of a group'):
assert driver.waitFor(lambda: group_chat_new_name in messages_screen.left_panel.get_chats_names,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f'{group_chat_new_name} is not present in chats list for {aut_three}'
10000), f'{group_chat_new_name} is not present in chats list for {aut_three}'
messages_screen.left_panel.click_chat_by_name(group_chat_new_name)
gray_message_text = messages_screen.group_chat.gray_text_from_message_area
assert gray_message_text == Messaging.YOU_NEED_TO_BE_A_MEMBER.value