e2e: Fixes for nightly failures

This commit is contained in:
Yevheniia Berdnyk 2023-06-08 05:06:43 +03:00
parent 5aa91359e1
commit f3b5a9db67
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
4 changed files with 21 additions and 13 deletions

View File

@ -15,7 +15,7 @@ from sauceclient import SauceException
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.support.wait import WebDriverWait
from urllib3.exceptions import MaxRetryError
from urllib3.exceptions import MaxRetryError, ProtocolError
from support.api.network_api import NetworkApi
from support.github_report import GithubHtmlReport
@ -143,7 +143,7 @@ class AbstractTestCase:
test_suite_data.current_test.testruns[-1].error = "%s; also Unexpected Alert is shown: '%s'" % (
test_suite_data.current_test.testruns[-1].error, alert_text
)
except RemoteDisconnected:
except (RemoteDisconnected, ProtocolError):
test_suite_data.current_test.testruns[-1].error = "%s; \n RemoteDisconnected" % \
test_suite_data.current_test.testruns[-1].error
@ -302,10 +302,10 @@ def create_shared_drivers(quantity):
print('SC Executor: %s' % executor_sauce_lab)
try:
drivers = loop.run_until_complete(start_threads(quantity,
Driver,
drivers,
executor_sauce_lab,
update_capabilities_sauce_lab(capabilities)))
Driver,
drivers,
executor_sauce_lab,
update_capabilities_sauce_lab(capabilities)))
for i in range(quantity):
test_suite_data.current_test.testruns[-1].jobs[drivers[i].session_id] = i + 1
drivers[i].implicitly_wait(implicit_wait)

View File

@ -1036,6 +1036,9 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
self.chat_2.just_fyi("Send messages with non-latin symbols")
self.home_1.jump_to_card_by_text(self.username_2)
self.chat_1.send_message("just a text") # Sending a message here so the next ones will be in a separate line
self.home_2.click_system_back_button_until_element_is_shown()
self.home_2.jump_to_card_by_text(self.username_1)
messages = ['hello', '¿Cómo estás tu año?', 'ё, доброго вечерочка', '® æ ç ♥']
[self.chat_2.send_message(message) for message in messages]
for message in messages:

View File

@ -244,8 +244,10 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
self.homes[0].connection_offline_icon.wait_for_invisibility_of_element(60)
self.homes[0].open_notification_bar()
for message in (message_1, message_2):
if not self.homes[0].element_by_text(message).is_element_displayed(30):
self.errors.append('%s PN was not fetched from offline' % message)
if self.homes[0].element_by_text(message).is_element_displayed(30):
break
else:
self.errors.append('Messages PN was not fetched from offline')
self.homes[0].click_system_back_button()
self.homes[0].chats_tab.click()
self.homes[0].get_chat(self.chat_name).click()

View File

@ -452,8 +452,11 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
if timestamp not in sent_time_variants:
self.errors.append("Timestamp is not shown, expected: '%s', in fact: '%s'" %
(", ".join(sent_time_variants), timestamp))
for channel in self.channel_1, self.channel_2:
channel.verify_message_is_under_today_text(message, self.errors)
self.channel_1.verify_message_is_under_today_text(message, self.errors)
new_message = "new message"
self.channel_1.send_message(message)
self.channel_1.chat_element_by_text(message).wait_for_status_to_be('Delivered', timeout=120)
self.channel_2.verify_message_is_under_today_text(new_message, self.errors)
if self.channel_2.chat_element_by_text(message).username.text != self.username_1:
self.errors.append("Default username '%s' is not shown next to the received message" % self.username_1)
self.errors.verify_no_errors()
@ -499,9 +502,9 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.home_1.just_fyi('Send image in 1-1 chat from Gallery')
image_description = 'description'
self.channel_1.send_images_with_description(image_description)
self.channel_1.chat_message_input.click()
self.channel_1.chat_element_by_text(image_description).wait_for_status_to_be('Delivered', timeout=120)
self.channel_1.chat_element_by_text(image_description).image_in_message.click()
self.channel_1.click_system_back_button()
self.channel_1.click_system_back_button_until_element_is_shown(element='chat')
# TODO: options for image are still WIP; add case with edit description of image and after 15901 fix
self.home_2.just_fyi('check image, description and options for receiver')
@ -730,7 +733,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.home_2.just_fyi("Check that can send message in community after unblock")
[home.jump_to_card_by_text('# %s' % self.channel_name) for home in [self.home_1, self.home_2]]
self.chat_2.send_message(message_unblocked)
if not self.chat_1.chat_element_by_text(message_unblocked).is_element_displayed(30):
if not self.chat_1.chat_element_by_text(message_unblocked).is_element_displayed(120):
self.errors.append("Message was not received in public chat after user unblock!")
self.home_2.just_fyi("Add blocked user to contacts again after removing(removed automatically when blocked)")