diff --git a/src/status_im/ui/components/tabbar/core.cljs b/src/status_im/ui/components/tabbar/core.cljs index 1017c0a4cb..62fc59cfa2 100644 --- a/src/status_im/ui/components/tabbar/core.cljs +++ b/src/status_im/ui/components/tabbar/core.cljs @@ -75,7 +75,8 @@ [badge/message-counter (or (:other @count) @count) true]] (pos? (:public @count)) [react/view {:style tabs.styles/counter-public-container} - [react/view {:style tabs.styles/counter-public}]]))] + [react/view {:style tabs.styles/counter-public + :accessibility-label :public-unread-badge}]]))] (when-not platform/desktop? [react/view {:style tabs.styles/tab-title-container} [react/text {:style (tabs.styles/new-tab-title active?)} diff --git a/src/status_im/ui/screens/home/views/inner_item.cljs b/src/status_im/ui/screens/home/views/inner_item.cljs index d087767a5f..57c0845e3b 100644 --- a/src/status_im/ui/screens/home/views/inner_item.cljs +++ b/src/status_im/ui/screens/home/views/inner_item.cljs @@ -49,7 +49,8 @@ (letsubs [{:keys [unviewed-messages-count public?]} [:chats/chat chat-id]] (when (pos? unviewed-messages-count) (if public? - [react/view {:style styles/public-unread}] + [react/view {:style styles/public-unread + :accessibility-label :unviewed-messages-public}] [badge/message-counter unviewed-messages-count])))) (defn home-list-item [[_ home-item]] diff --git a/test/appium/tests/atomic/chats/test_public.py b/test/appium/tests/atomic/chats/test_public.py index 93233bdc12..c2fd5f3eba 100644 --- a/test/appium/tests/atomic/chats/test_public.py +++ b/test/appium/tests/atomic/chats/test_public.py @@ -104,21 +104,21 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase): chat_2.chat_message_input.send_keys(message) chat_2.send_message_button.click() - if home_1.home_button.counter.text != '1': - self.errors.append('New messages counter is not shown on Home button') + 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_with_user('#' + chat_name) - if chat_element.new_messages_counter.text != '1': - self.errors.append('New messages counter is not shown on chat element') + 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.click() home_1.get_back_to_home_view() - if home_1.home_button.counter.is_element_displayed(): - self.errors.append('New messages counter is shown on Home button for already seen message') + 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') - if chat_element.new_messages_counter.text == '1': - self.errors.append('New messages counter is shown on chat element for already seen message') self.errors.verify_no_errors() @marks.testrail_id(6202) diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index db2f13620d..eee6dcb42a 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -92,6 +92,15 @@ class TabButton(BaseButton): return Counter(self.driver, self.locator.value) + @property + def public_unread_messages(self): + class PublicChatUnreadMessages(BaseElement): + def __init__(self, driver): + super(PublicChatUnreadMessages, self).__init__(driver) + self.locator = self.Locator.accessibility_id('unviewed-messages-public') + + return PublicChatUnreadMessages(self.driver) + class HomeButton(TabButton): def __init__(self, driver): diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index 5552ab7009..5bce899a8f 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -118,6 +118,15 @@ class ChatElement(BaseButton): return UnreadMessagesCountText(self.driver, self.locator.value) + @property + def new_messages_public_chat(self): + class UnreadMessagesPublicChat(BaseElement): + def __init__(self, driver): + super(UnreadMessagesPublicChat, self).__init__(driver) + self.locator = self.Locator.accessibility_id('public-unread-badge') + + return UnreadMessagesPublicChat(self.driver) + class ChatNameText(BaseText): def __init__(self, driver):