e2e: fix pinned messages

This commit is contained in:
Churikova Tetiana 2023-02-27 16:38:50 +01:00
parent f84c2ec9f5
commit e1bcc8fec4
No known key found for this signature in database
GPG Key ID: EDE559EC439D18A0
4 changed files with 16 additions and 16 deletions

View File

@ -1138,7 +1138,12 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Unpin one message and check it's unpinned for another user")
self.chat_2.tap_by_coordinates(500, 100)
self.chat_1.pin_message(self.message_4, action="unpin-from-chat")
self.chat_1.view_pinned_messages_button.click_until_presence_of_element(self.chat_1.pinned_messages_list)
pinned_message = self.chat_1.pinned_messages_list.message_element_by_text(self.message_4)
element = self.chat_1.element_by_translation_id("unpin-from-chat")
pinned_message.long_press_until_element_is_shown(element)
element.click_until_absense_of_element(element)
try:
self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element()
except TimeoutException:

View File

@ -321,17 +321,14 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
self.chats[0].just_fyi("Check that a user can not pin more than 3 messages")
self.chats[0].send_message(self.message_4)
self.chats[0].pin_message(self.message_4, 'pin-to-chat')
if self.chats[0].pin_limit_popover.is_element_displayed(30):
self.chats[0].view_pinned_messages_button.click_until_presence_of_element(self.chats[0].pinned_messages_list)
self.chats[0].pinned_messages_list.message_element_by_text(self.message_2).click_inside_element_by_coordinate()
self.chats[0].element_by_translation_id('unpin-from-chat').double_click()
self.chats[0].chat_element_by_text(self.message_4).click()
self.chats[0].pin_message(self.message_4, 'pin-to-chat')
if not (self.chats[0].chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and
self.chats[1].chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30)):
self.errors.append("Message 4 is not pinned in group chat after unpinning previous one")
else:
self.errors.append("Can pin more than 3 messages in group chat")
self.chats[0].view_pinned_messages_button.click_until_presence_of_element(self.chats[0].pinned_messages_list)
self.chats[0].pinned_messages_list.message_element_by_text(self.message_2).click_inside_element_by_coordinate()
self.chats[0].element_by_translation_id('unpin-from-chat').double_click()
self.chats[0].chat_element_by_text(self.message_4).click()
self.chats[0].pin_message(self.message_4, 'pin-to-chat')
if not (self.chats[0].chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and
self.chats[1].chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30)):
self.errors.append("Message 4 is not pinned in group chat after unpinning previous one")
self.chats[0].just_fyi("Check pinned messages count and content")
for chat_number, group_chat in enumerate([self.chats[0], self.chats[1]]):

View File

@ -555,7 +555,6 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
channel_1_element.click()
self.errors.verify_no_errors()
# @marks.testrail_id(702842)
# Skipped until implemented in NEW UI
# def test_community_mark_all_messages_as_read(self):
@ -578,10 +577,9 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
# self.errors.verify_no_errors()
@marks.testrail_id(702845)
@marks.xfail(reason="blocked by 15187")
def test_community_leave(self):
self.home_2.jump_to_communities_home()
community = self.home_2.element_by_text(self.community_name)
community = self.home_2.get_chat(self.community_name, community=True)
community_to_leave = CommunityView(self.drivers[1])
community.long_press_until_element_is_shown(community_to_leave.leave_community_button)
community_to_leave.leave_community_button.click()

View File

@ -617,7 +617,7 @@ class PinnedMessagesList(BaseElement):
return len(element.find_elements())
def message_element_by_text(self, text):
message_element = Text(self.driver, prefix=self.locator, xpath="//*[starts-with(@text,'%s')]" % text)
message_element = Button(self.driver, prefix=self.locator, xpath="//*[starts-with(@text,'%s')]" % text)
self.driver.info("Looking for a pinned message by text: %s" % message_element.exclude_emoji(text))
return message_element