Skip to content

Commit

Permalink
e2e: Fixes for nightly failures
Browse files Browse the repository at this point in the history
  • Loading branch information
yevh-berdnyk committed Jun 8, 2023
1 parent 5aa9135 commit f3b5a9d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
12 changes: 6 additions & 6 deletions test/appium/tests/base_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
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
Expand Down Expand Up @@ -143,7 +143,7 @@ def add_alert_text_to_report(self, driver):
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

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions test/appium/tests/critical/chats/test_1_1_public_chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,9 @@ def test_1_1_chat_non_latin_messages_stack_update_profile_photo(self):
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:
Expand Down
6 changes: 4 additions & 2 deletions test/appium/tests/critical/chats/test_group_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ def test_group_chat_offline_pn(self):
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()
Expand Down
13 changes: 8 additions & 5 deletions test/appium/tests/critical/test_public_chat_browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,11 @@ def test_community_message_send_check_timestamps_sender_username(self):
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()
Expand Down Expand Up @@ -499,9 +502,9 @@ def test_community_one_image_send_reply(self):
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')
Expand Down Expand Up @@ -730,7 +733,7 @@ def test_community_contact_block_unblock_offline(self):
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)")
Expand Down

0 comments on commit f3b5a9d

Please sign in to comment.