diff --git a/test/appium/support/test_rerun.py b/test/appium/support/test_rerun.py index 0ef16f5114..3d4ed17608 100644 --- a/test/appium/support/test_rerun.py +++ b/test/appium/support/test_rerun.py @@ -20,7 +20,8 @@ RERUN_ERRORS = [ "http.client.RemoteDisconnected: Remote end closed connection without response", "[Errno 110] Connection timed out", "replacement transaction underpriced", - "StaleElementReferenceException" + "StaleElementReferenceException", + "No System TLS" ] diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 7acffabbe6..8c51217ff6 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -368,6 +368,9 @@ class TestProfileSingleDevice(SingleDeviceTestCase): base_web_view.open_in_webview() base_web_view.find_full_text('Frequently Asked Questions') base_web_view.click_system_back_button() + profile_view.submit_bug_button.click() + base_web_view.find_full_text('Welcome to Gmail') + base_web_view.click_system_back_button() profile_view.request_a_feature_button.click() profile_view.find_full_text('#status') diff --git a/test/appium/tests/atomic/chats/test_public.py b/test/appium/tests/atomic/chats/test_public.py index b92cd67cde..9464eb1a5b 100644 --- a/test/appium/tests/atomic/chats/test_public.py +++ b/test/appium/tests/atomic/chats/test_public.py @@ -121,6 +121,36 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase): self.errors.verify_no_errors() + @marks.testrail_id(6270) + @marks.medium + def test_mark_all_messages_as_read_public_chat(self): + self.create_drivers(2) + device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) + home_1, home_2 = device_1.create_user(), device_2.create_user() + chat_name = home_1.get_public_chat_name() + chat_1, chat_2 = home_1.join_public_chat(chat_name), home_2.join_public_chat(chat_name) + home_1.get_back_to_home_view() + message = 'test message' + chat_2.chat_message_input.send_keys(message) + chat_2.send_message_button.click() + + if not home_1.home_button.public_unread_messages.is_element_displayed(): + self.errors.append('New messages public chat badge is not shown on Home button') + chat_element = home_1.get_chat('#' + chat_name) + if not chat_element.new_messages_public_chat.is_element_displayed(): + self.errors.append('New messages counter is not shown in public chat') + + chat_element.long_press_element() + home_1.mark_all_messages_as_read_button.click() + home_1.get_back_to_home_view() + + if home_1.home_button.public_unread_messages.is_element_displayed(): + self.errors.append('New messages public chat badge is shown on Home button') + if chat_element.new_messages_public_chat.is_element_displayed(): + self.errors.append('Unread messages badge is shown in public chat while while there are no unread messages') + + self.errors.verify_no_errors() + @marks.testrail_id(6202) @marks.low def test_emoji_messages_long_press(self): diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index d082fed91b..d1092b9796 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -16,16 +16,19 @@ class PlusButton(BaseButton): super(PlusButton, self).__init__(driver) self.locator = self.Locator.accessibility_id("new-chat-button") + class DeleteChatButton(BaseButton): def __init__(self, driver): super(DeleteChatButton, self).__init__(driver) self.locator = self.Locator.accessibility_id("delete-chat-button") + class ClearHistoryButton(BaseButton): def __init__(self, driver): super(ClearHistoryButton, self).__init__(driver) self.locator = self.Locator.accessibility_id("clear-history-button") + class StartNewChatButton(BaseButton): def __init__(self, driver): super(StartNewChatButton, self).__init__(driver) @@ -69,6 +72,7 @@ class ChatsMenuInviteFriendsButton(BaseButton): super(ChatsMenuInviteFriendsButton, self).__init__(driver) self.locator = self.Locator.accessibility_id('chats-menu-invite-friends-button') + class UserNameBelowNewChatButton(BaseButton): def __init__(self, driver, username_part): super(UserNameBelowNewChatButton, self).__init__(driver) @@ -76,6 +80,7 @@ class UserNameBelowNewChatButton(BaseButton): self.locator = self.Locator.xpath_selector( "//*[@content-desc='enter-contact-code-input']/../..//*[starts-with(@text,'%s')]" % self.username) + class ChatElement(BaseButton): def __init__(self, driver, username_part): super(ChatElement, self).__init__(driver) @@ -138,6 +143,12 @@ class ChatElement(BaseButton): return UnreadMessagesPublicChat(self.driver) +class MarkAllMessagesAsReadButton(BaseButton): + def __init__(self, driver): + super().__init__(driver) + self.locator = self.Locator.accessibility_id('mark-all-read-button') + + class ChatNameText(BaseText): def __init__(self, driver): super(ChatNameText, self).__init__(driver) @@ -172,6 +183,7 @@ class HomeView(BaseView): self.chats_menu_invite_friends_button = ChatsMenuInviteFriendsButton(self.driver) self.delete_chat_button = DeleteChatButton(self.driver) self.clear_history_button = ClearHistoryButton(self.driver) + self.mark_all_messages_as_read_button = MarkAllMessagesAsReadButton(self.driver) def wait_for_syncing_complete(self): self.driver.info('Waiting for syncing complete:') @@ -188,8 +200,6 @@ class HomeView(BaseView): def get_username_below_start_new_chat_button(self, username_part): return UserNameBelowNewChatButton(self.driver, username_part) - - def add_contact(self, public_key, add_in_contacts=True): self.plus_button.click_until_presence_of_element(self.start_new_chat_button) contacts_view = self.start_new_chat_button.click() diff --git a/test/appium/views/keycard_view.py b/test/appium/views/keycard_view.py index 9a1722322e..6443061b71 100644 --- a/test/appium/views/keycard_view.py +++ b/test/appium/views/keycard_view.py @@ -81,10 +81,7 @@ class KeycardView(BaseView): def get_required_word_number(self): description = WordNumberText(self.driver) full_text = description.text - if ("11" in full_text) or ("12" in full_text): - word_number = full_text[-2:] - else: - word_number = full_text[-1] + word_number = ''.join(i for i in full_text if i.isdigit()) return word_number def backup_seed_phrase(self):