Skip to content

Commit 3f433d6

Browse files
committed
e2e: group chat unread messages
1 parent da8ca36 commit 3f433d6

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

src/status_im2/contexts/chat/home/chat_list_item/view.cljs

+3-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@
227227

228228
;; TODO: use the grey-dot component when chat-list-item is moved to quo2.components
229229
(and group-chat unread-messages?)
230-
[rn/view {:style (style/grey-dot)}]
230+
[rn/view
231+
{:style (style/grey-dot)
232+
:accessibility-label :unviewed-messages-public}]
231233

232234
unread-messages?
233235
[quo/info-count

test/appium/tests/critical/chats/test_group_chat.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def test_group_chat_mute_chat(self):
539539
self.chats[0].send_message(muted_message)
540540
self.homes[1].just_fyi("Member 1 checks that chat is muted and message is received")
541541
chat = self.homes[1].get_chat(self.chat_name)
542-
if chat.new_messages_counter.is_element_displayed(30):
542+
if chat.new_messages_grey_dot.is_element_displayed(30):
543543
self.errors.append("New messages counter near chat name is shown after mute")
544544
try:
545545
after_mute_counter = int(self.homes[1].chats_tab.counter.text)
@@ -588,7 +588,7 @@ def test_group_chat_mute_chat(self):
588588
initial_counter = 0
589589
self.chats[2].send_message(unmuted_message)
590590
self.homes[1].just_fyi("Member 1 checks that chat is unmuted and message is received")
591-
if not chat.new_messages_counter.is_element_displayed(30):
591+
if not chat.new_messages_grey_dot.is_element_displayed(30):
592592
self.errors.append("New messages counter near chat name is not shown after unmute")
593593
try:
594594
after_mute_counter = int(self.homes[1].chats_tab.counter.text)

test/appium/tests/critical/test_public_chat_browsing.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -850,14 +850,14 @@ def test_community_unread_messages_badge(self):
850850
self.channel_2.send_message(message)
851851
self.home_1.just_fyi('Check new messages badge is shown for community')
852852
community_element_1 = self.home_1.get_chat(self.community_name, community=True)
853-
if not community_element_1.new_messages_community.is_element_displayed(sec=30):
853+
if not community_element_1.new_messages_grey_dot.is_element_displayed(sec=30):
854854
self.errors.append('New message community badge is not shown')
855855

856856
community_1 = community_element_1.click()
857857
channel_1_element = community_1.get_channel(self.channel_name)
858858

859859
self.home_1.just_fyi('Check new messages badge is shown for community')
860-
if not community_element_1.new_messages_community.is_element_displayed():
860+
if not community_element_1.new_messages_grey_dot.is_element_displayed():
861861
self.errors.append('New messages channel badge is not shown on channel')
862862
channel_1_element.click()
863863
self.errors.verify_no_errors()
@@ -966,12 +966,12 @@ def test_community_mark_all_messages_as_read(self):
966966
self.community_2.get_channel(self.channel_name).click()
967967
self.channel_2.send_message(self.text_message)
968968
community_1_element = self.community_1.get_chat(self.community_name)
969-
if not community_1_element.new_messages_public_chat.is_element_displayed(90):
969+
if not community_1_element.new_messages_grey_dot.is_element_displayed(90):
970970
self.errors.append('New messages counter is not shown in home > Commmunity element')
971971
mark_as_read_button = self.community_1.mark_all_messages_as_read_button
972972
community_1_element.long_press_until_element_is_shown(mark_as_read_button)
973973
mark_as_read_button.click()
974-
if community_1_element.new_messages_public_chat.is_element_displayed():
974+
if community_1_element.new_messages_grey_dot.is_element_displayed():
975975
self.errors.append(
976976
'Unread messages badge is shown in community channel while there are no unread messages')
977977
# TODO: there should be one more check for community channel, which is still not ready

test/appium/tests/medium/test_profile_m.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def test_community_create_approve_membership(self):
334334
community_1.home_button.double_click()
335335
self.home_1.get_chat(community_name, community=True).click()
336336
chat_element_1 = community_1.get_chat(channel_name)
337-
if not chat_element_1.new_messages_public_chat.is_element_displayed():
337+
if not chat_element_1.new_messages_grey_dot.is_element_displayed():
338338
self.errors.append("Unread messages counter is not shown for community channel!")
339339
if not community_1.element_by_text(message_member).is_element_displayed():
340340
self.errors.append("Message from member is not shown for community channel!")

test/appium/tests/upgrade/test_upgrade.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_unread_previews_public_chat_version_upgrade(self):
5151
unread_one_to_one, unread_public = home.get_chat(unread_one_to_one_name), home.get_chat(unread_public_name)
5252
if unread_one_to_one.new_messages_counter.text != chats[unread_one_to_one_name]['unread']:
5353
self.errors.append('New messages counter is not shown on chat element')
54-
if not unread_public.new_messages_public_chat.is_element_displayed():
54+
if not unread_public.new_messages_grey_dot.is_element_displayed():
5555
self.errors.append('Unread messages badge is not shown in public chat')
5656

5757
home.just_fyi("Check images / add to contacts")

test/appium/views/home_view.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,20 @@ def __init__(self, driver, parent_locator: str):
101101
return NoMessageText(self.driver, self.locator)
102102

103103
@property
104-
def new_messages_public_chat(self):
104+
def new_messages_grey_dot(self):
105105
class UnreadMessagesPublicChat(BaseElement):
106-
def __init__(self, driver):
107-
super().__init__(driver, accessibility_id="unviewed-messages-public")
108-
109-
return UnreadMessagesPublicChat(self.driver)
106+
def __init__(self, driver, parent_locator):
107+
super().__init__(driver, xpath="%s/*[@content-desc='unviewed-messages-public']" % parent_locator)
110108

111-
@property
112-
def new_messages_community(self):
113-
class UnreadMessagesCommunity(BaseElement):
114-
def __init__(self, driver, parent_locator: str):
115-
super().__init__(driver, prefix=parent_locator, xpath="%s/android.view.ViewGroup" % parent_locator)
109+
return UnreadMessagesPublicChat(self.driver, self.locator)
116110

117-
return UnreadMessagesCommunity(self.driver, self.locator)
111+
# @property
112+
# def new_messages_community(self):
113+
# class UnreadMessagesCommunity(BaseElement):
114+
# def __init__(self, driver, parent_locator: str):
115+
# super().__init__(driver, prefix=parent_locator, xpath="%s/android.view.ViewGroup" % parent_locator)
116+
#
117+
# return UnreadMessagesCommunity(self.driver, self.locator)
118118

119119
@property
120120
def chat_image(self):

0 commit comments

Comments
 (0)