e2e: enabled tests for pinning messages

This commit is contained in:
Yevheniia Berdnyk 2024-01-03 21:20:10 +02:00
parent 4ff5e4da8b
commit 85c928f862
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
3 changed files with 19 additions and 19 deletions

View File

@ -174,7 +174,6 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.xfail(reason="Pin feature is in development", run=False)
@marks.testrail_id(702731)
def test_1_1_chat_pin_messages(self):
self.home_1.just_fyi("Check that Device1 can pin own message in 1-1 chat")
@ -190,10 +189,10 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
"messages are in Device1 profile")
self.chat_2.pin_message(self.message_2, 'pin-to-chat')
for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
chat.pinned_messages_count.wait_for_element_text("2",
chat.pinned_messages_count.wait_for_element_text(text="2",
message="Pinned messages count is not 2 as expected!")
chat.just_fyi("Check pinned message are visible in Pinned panel for user %s" % (chat_number + 1))
chat.just_fyi("Check pinned messages are visible in Pinned panel for user %s" % (chat_number + 1))
chat.pinned_messages_count.click()
for message in self.message_1, self.message_2:
pinned_by = chat.pinned_messages_list.get_message_pinned_by_text(message)
@ -219,18 +218,17 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
self.chat_1.send_message(message)
self.chat_1.chat_element_by_text(message).wait_for_status_to_be("Delivered")
self.chat_1.pin_message(message, 'pin-to-chat')
# if self.chat_1.pin_limit_popover.is_element_displayed(30):
# if not self.chat_1.pin_limit_popover.is_element_displayed():
# self.errors.append("Pin limit popover is not displayed when pinning more than 3 messages")
self.chat_1.view_pinned_messages_button.click_until_presence_of_element(self.chat_1.pinned_messages_list)
# temp solution instead of getting pin_limit_popover:
if self.chat_1.pinned_messages_list.get_pinned_messages_number() > 3 \
or self.chat_1.pinned_messages_list.message_element_by_text(self.message_4).is_element_displayed():
self.errors.append("Can pin more than 3 messages in chat")
else:
self.chat_1.pinned_messages_list.message_element_by_text(
self.message_2).click_inside_element_by_coordinate()
self.chat_1.pinned_messages_list.message_element_by_text(self.message_2).long_press_element()
self.home_1.just_fyi("Unpin one message so that another could be pinned")
self.chat_1.element_by_translation_id('unpin-from-chat').click()
self.chat_1.chat_element_by_text(self.message_4).click()
unpin_element = self.chat_1.element_by_translation_id('unpin-from-chat')
unpin_element.click_until_absense_of_element(desired_element=unpin_element)
self.chat_1.pin_message(self.message_4, 'pin-to-chat')
if not (self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and
self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30)):
@ -248,13 +246,13 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
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:
self.errors.append("Message_4 is not unpinned!")
unpin_element = self.chat_1.element_by_translation_id("unpin-from-chat")
pinned_message.long_press_until_element_is_shown(unpin_element)
unpin_element.click_until_absense_of_element(unpin_element)
# try:
# self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element()
# except TimeoutException:
# self.errors.append("Message_4 is not unpinned!")
for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
count = chat.pinned_messages_count.text

View File

@ -323,7 +323,6 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
self.errors.append('%s if not shown for device %s' % (message, str(i)))
self.errors.verify_no_errors()
@marks.xfail(reason="Pin feature is in development", run=False)
@marks.testrail_id(702732)
def test_group_chat_pin_messages(self):
[self.homes[i].navigate_back_to_home_view() for i in range(3)]
@ -371,8 +370,9 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
self.chats[0].send_message(self.message_4)
self.chats[0].pin_message(self.message_4, 'pin-to-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').click()
self.chats[0].pinned_messages_list.message_element_by_text(self.message_2).long_press_element()
unpin_element = self.chats[0].element_by_translation_id('unpin-from-chat')
unpin_element.click_until_absense_of_element(desired_element=unpin_element)
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

View File

@ -1070,6 +1070,8 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(703629)
@marks.xfail(
reason="Can't join a community if admin goes offline, https://github.com/status-im/status-mobile/issues/17678")
def test_community_join_when_node_owner_offline(self):
for home in self.homes:
home.navigate_back_to_home_view()