Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: group chat unread messages #16838

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/status_im2/contexts/chat/home/chat_list_item/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@

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

unread-messages?
[quo/info-count
Expand Down
4 changes: 2 additions & 2 deletions test/appium/tests/critical/chats/test_group_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def test_group_chat_mute_chat(self):
self.chats[0].send_message(muted_message)
self.homes[1].just_fyi("Member 1 checks that chat is muted and message is received")
chat = self.homes[1].get_chat(self.chat_name)
if chat.new_messages_counter.is_element_displayed(30):
if chat.new_messages_grey_dot.is_element_displayed(30):
self.errors.append("New messages counter near chat name is shown after mute")
try:
after_mute_counter = int(self.homes[1].chats_tab.counter.text)
Expand Down Expand Up @@ -588,7 +588,7 @@ def test_group_chat_mute_chat(self):
initial_counter = 0
self.chats[2].send_message(unmuted_message)
self.homes[1].just_fyi("Member 1 checks that chat is unmuted and message is received")
if not chat.new_messages_counter.is_element_displayed(30):
if not chat.new_messages_grey_dot.is_element_displayed(30):
self.errors.append("New messages counter near chat name is not shown after unmute")
try:
after_mute_counter = int(self.homes[1].chats_tab.counter.text)
Expand Down
8 changes: 4 additions & 4 deletions test/appium/tests/critical/test_public_chat_browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,14 +850,14 @@ def test_community_unread_messages_badge(self):
self.channel_2.send_message(message)
self.home_1.just_fyi('Check new messages badge is shown for community')
community_element_1 = self.home_1.get_chat(self.community_name, community=True)
if not community_element_1.new_messages_community.is_element_displayed(sec=30):
if not community_element_1.new_messages_grey_dot.is_element_displayed(sec=30):
self.errors.append('New message community badge is not shown')

community_1 = community_element_1.click()
channel_1_element = community_1.get_channel(self.channel_name)

self.home_1.just_fyi('Check new messages badge is shown for community')
if not community_element_1.new_messages_community.is_element_displayed():
if not community_element_1.new_messages_grey_dot.is_element_displayed():
self.errors.append('New messages channel badge is not shown on channel')
channel_1_element.click()
self.errors.verify_no_errors()
Expand Down Expand Up @@ -966,12 +966,12 @@ def test_community_mark_all_messages_as_read(self):
self.community_2.get_channel(self.channel_name).click()
self.channel_2.send_message(self.text_message)
community_1_element = self.community_1.get_chat(self.community_name)
if not community_1_element.new_messages_public_chat.is_element_displayed(90):
if not community_1_element.new_messages_grey_dot.is_element_displayed(90):
self.errors.append('New messages counter is not shown in home > Commmunity element')
mark_as_read_button = self.community_1.mark_all_messages_as_read_button
community_1_element.long_press_until_element_is_shown(mark_as_read_button)
mark_as_read_button.click()
if community_1_element.new_messages_public_chat.is_element_displayed():
if community_1_element.new_messages_grey_dot.is_element_displayed():
self.errors.append(
'Unread messages badge is shown in community channel while there are no unread messages')
# TODO: there should be one more check for community channel, which is still not ready
Expand Down
2 changes: 1 addition & 1 deletion test/appium/tests/medium/test_profile_m.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def test_community_create_approve_membership(self):
community_1.home_button.double_click()
self.home_1.get_chat(community_name, community=True).click()
chat_element_1 = community_1.get_chat(channel_name)
if not chat_element_1.new_messages_public_chat.is_element_displayed():
if not chat_element_1.new_messages_grey_dot.is_element_displayed():
self.errors.append("Unread messages counter is not shown for community channel!")
if not community_1.element_by_text(message_member).is_element_displayed():
self.errors.append("Message from member is not shown for community channel!")
Expand Down
2 changes: 1 addition & 1 deletion test/appium/tests/upgrade/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_unread_previews_public_chat_version_upgrade(self):
unread_one_to_one, unread_public = home.get_chat(unread_one_to_one_name), home.get_chat(unread_public_name)
if unread_one_to_one.new_messages_counter.text != chats[unread_one_to_one_name]['unread']:
self.errors.append('New messages counter is not shown on chat element')
if not unread_public.new_messages_public_chat.is_element_displayed():
if not unread_public.new_messages_grey_dot.is_element_displayed():
self.errors.append('Unread messages badge is not shown in public chat')

home.just_fyi("Check images / add to contacts")
Expand Down
22 changes: 11 additions & 11 deletions test/appium/views/home_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,20 @@ def __init__(self, driver, parent_locator: str):
return NoMessageText(self.driver, self.locator)

@property
def new_messages_public_chat(self):
def new_messages_grey_dot(self):
class UnreadMessagesPublicChat(BaseElement):
def __init__(self, driver):
super().__init__(driver, accessibility_id="unviewed-messages-public")

return UnreadMessagesPublicChat(self.driver)
def __init__(self, driver, parent_locator):
super().__init__(driver, xpath="%s/*[@content-desc='unviewed-messages-public']" % parent_locator)

@property
def new_messages_community(self):
class UnreadMessagesCommunity(BaseElement):
def __init__(self, driver, parent_locator: str):
super().__init__(driver, prefix=parent_locator, xpath="%s/android.view.ViewGroup" % parent_locator)
return UnreadMessagesPublicChat(self.driver, self.locator)

return UnreadMessagesCommunity(self.driver, self.locator)
# @property
# def new_messages_community(self):
# class UnreadMessagesCommunity(BaseElement):
# def __init__(self, driver, parent_locator: str):
# super().__init__(driver, prefix=parent_locator, xpath="%s/android.view.ViewGroup" % parent_locator)
#
# return UnreadMessagesCommunity(self.driver, self.locator)

@property
def chat_image(self):
Expand Down