From 433be1daef3739fec103a91071275dc09d8da660 Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Wed, 10 Jan 2024 16:10:31 +0200 Subject: [PATCH] e2e: fixes 10.01 --- test/appium/tests/conftest.py | 2 +- test/appium/tests/critical/chats/test_1_1_public_chats.py | 1 + .../tests/critical/chats/test_public_chat_browsing.py | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/appium/tests/conftest.py b/test/appium/tests/conftest.py index c89eb64707b..a7ccca17880 100644 --- a/test/appium/tests/conftest.py +++ b/test/appium/tests/conftest.py @@ -196,7 +196,7 @@ def _upload_and_check_response_with_retries(apk_file_path, retries=3): try: _upload_and_check_response(apk_file_path) break - except (ConnectionError, RemoteDisconnected): + except (ConnectionError, RemoteDisconnected, c_er): time.sleep(10) diff --git a/test/appium/tests/critical/chats/test_1_1_public_chats.py b/test/appium/tests/critical/chats/test_1_1_public_chats.py index 505eb8935f7..b06360ee3d5 100644 --- a/test/appium/tests/critical/chats/test_1_1_public_chats.py +++ b/test/appium/tests/critical/chats/test_1_1_public_chats.py @@ -655,6 +655,7 @@ def test_1_1_chat_delete_via_long_press_relogin(self): self.home_2.navigate_back_to_home_view() self.home_2.chats_tab.click() self.home_2.get_chat(self.username_1).click() + self.chat_2.chat_message_input.wait_for_visibility_of_element() self.home_2.just_fyi("Getting chat history") chat_history = list() for element in self.chat_2.chat_element_by_text(text='').message_text_content.find_elements(): diff --git a/test/appium/tests/critical/chats/test_public_chat_browsing.py b/test/appium/tests/critical/chats/test_public_chat_browsing.py index 1f8fc336779..ea2be2700ee 100644 --- a/test/appium/tests/critical/chats/test_public_chat_browsing.py +++ b/test/appium/tests/critical/chats/test_public_chat_browsing.py @@ -5,7 +5,7 @@ import pytest from _pytest.outcomes import Failed from appium.webdriver.connectiontype import ConnectionType -from selenium.common.exceptions import NoSuchElementException, TimeoutException +from selenium.common.exceptions import NoSuchElementException, TimeoutException, StaleElementReferenceException from tests import marks, run_in_parallel, pytest_config_global, transl from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase @@ -108,7 +108,10 @@ def test_community_undo_delete_message(self): message_to_delete = "message to delete and undo" self.channel.send_message(message_to_delete) self.channel.delete_message_in_chat(message_to_delete) - self.channel.element_by_text("Undo").click() + try: + self.channel.element_by_text("Undo").click() + except StaleElementReferenceException: + pytest.fail("Can't press Undo button, not enough time") try: self.channel.chat_element_by_text(message_to_delete).wait_for_visibility_of_element() except TimeoutException: