e2e: group chat unread messages

This commit is contained in:
Yevheniia Berdnyk 2023-08-02 15:17:11 +03:00
parent da8ca36369
commit 3f433d6f19
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
6 changed files with 22 additions and 20 deletions

View File

@ -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

View File

@ -539,7 +539,7 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
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)
@ -588,7 +588,7 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
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)

View File

@ -850,14 +850,14 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
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()
@ -966,12 +966,12 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
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

View File

@ -334,7 +334,7 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
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!")

View File

@ -51,7 +51,7 @@ class TestUpgradeApplication(SingleDeviceTestCase):
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")

View File

@ -101,20 +101,20 @@ class ChatElement(SilentButton):
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")
def __init__(self, driver, parent_locator):
super().__init__(driver, xpath="%s/*[@content-desc='unviewed-messages-public']" % parent_locator)
return UnreadMessagesPublicChat(self.driver)
return UnreadMessagesPublicChat(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 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):