diff --git a/src/status_im/contexts/chat/messenger/messages/content/text/view.cljs b/src/status_im/contexts/chat/messenger/messages/content/text/view.cljs index e83366d8f3..4e646c0eff 100644 --- a/src/status_im/contexts/chat/messenger/messages/content/text/view.cljs +++ b/src/status_im/contexts/chat/messenger/messages/content/text/view.cljs @@ -149,8 +149,9 @@ [{:keys [content chat-id edited-at style-override on-layout]}] ^{:key (:parsed-text content)} [rn/view - {:style style-override - :on-layout on-layout} + {:style style-override + :on-layout on-layout + :accessibility-label :message-text-content} (reduce (fn [acc e] (render-block acc e chat-id style-override)) [:<>] 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 99ab162fa5..505eb8935f 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 @@ -654,13 +654,35 @@ class TestOneToOneChatMultipleSharedDevicesNewUiTwo(MultipleSharedDeviceTestCase 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.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(): + chat_history.append(element.text) + if not chat_history: + self.errors.append("No chat history was loaded") self.home_2.just_fyi("Deleting chat via delete button and check it will not reappear after relaunching app") + self.home_2.navigate_back_to_home_view() + self.home_2.chats_tab.click() self.home_2.delete_chat_long_press(username=self.username_1) - if self.home_2.get_chat_from_home_view(self.username_1).is_element_displayed(): + chat = self.home_2.get_chat_from_home_view(self.username_1) + if chat.is_element_displayed(): self.errors.append("Deleted '%s' chat is shown, but the chat has been deleted" % self.username_1) self.home_2.reopen_app() - if self.home_2.get_chat_from_home_view(self.username_1).is_element_displayed(15): + if chat.is_element_displayed(15): self.errors.append( "Deleted chat '%s' is shown after re-login, but the chat has been deleted" % self.username_1) + chat.click() + else: + self.home_2.contacts_tab.click() + chat.click() + self.chat_2.profile_send_message_button.click() + + lost_messages = list() + for message_text in chat_history: + if not self.chat_2.chat_element_by_text(message_text).is_element_displayed(): + lost_messages.append(message_text) + if lost_messages: + self.errors.append("Message(s) missed in 1-1 chat after deleting the chat and relogin: %s" % lost_messages) self.errors.verify_no_errors() diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index 814b0aa6e9..abd53b5d4b 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -325,6 +325,13 @@ class ChatElementByText(Text): return PinnedByLabelText(self.driver, self.locator) + @property + def message_text_content(self): + return Text( + self.driver, + xpath="//%s//*[@content-desc='message-text-content']/android.widget.TextView" % self.chat_item_locator + ) + class UsernameOptions(Button): def __init__(self, driver, username): diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index 427d08f8b9..bc17c85d02 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -348,7 +348,6 @@ class ProfileView(BaseView): self.node_version_text = Text(self.driver, xpath="//*[@content-desc='node-version']//android.widget.TextView[2]") - # Logout self.logout_button = LogoutButton(self.driver) self.logout_dialog = LogoutDialog(self.driver) @@ -356,7 +355,8 @@ class ProfileView(BaseView): # New profile self.profile_password_button = Button(self.driver, accessibility_id="icon, Password, label-component, icon") - self.profile_legacy_button = Button(self.driver, accessibility_id="icon, Legacy settings, label-component, icon") + self.profile_legacy_button = Button(self.driver, + accessibility_id="icon, Legacy settings, label-component, icon") def switch_network(self, network='Mainnet with upstream RPC'): self.driver.info("## Switch network to '%s'" % network, device=False) @@ -439,7 +439,8 @@ class ProfileView(BaseView): if not AbstractTestCase().environment == 'sauce': raise NotImplementedError('Test case is implemented to run on SauceLabs only') ## pointing to legacy profile until new feature is implemented - self.profile_legacy_button.scroll_and_click() + self.logout_button.scroll_to_element() + self.profile_legacy_button.click() self.profile_picture.click() if update_by == "Gallery": self.select_from_gallery_button.click()