Skip to content

Commit

Permalink
e2e: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yevh-berdnyk committed Jun 13, 2023
1 parent 2932bbe commit be61818
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
9 changes: 5 additions & 4 deletions test/appium/tests/critical/chats/test_1_1_public_chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,8 +1127,8 @@ def test_1_1_chat_push_emoji(self):
self.errors.append("PN are keep staying after message was seen by user")
self.errors.verify_no_errors()

@marks.xfail(
reason="Message is being in status 'Sending' for a long time: https://github.com/status-im/status-mobile/issues/15385")
@marks.xfail(reason="Message is being in status 'Sending' for a long time: " \
"https://github.com/status-im/status-mobile/issues/15385")
@marks.testrail_id(702855)
def test_1_1_chat_edit_message(self):
[home.click_system_back_button_until_element_is_shown() for home in self.homes]
Expand All @@ -1146,6 +1146,8 @@ def test_1_1_chat_edit_message(self):
self.errors.append('No edited message in 1-1 chat displayed')
self.errors.verify_no_errors()

@marks.xfail(reason="Message is being in status 'Sending' for a long time: " \
"https://github.com/status-im/status-mobile/issues/15385")
@marks.testrail_id(702733)
def test_1_1_chat_text_message_delete_push_disappear(self):
if not self.chat_2.chat_message_input.is_element_displayed():
Expand All @@ -1172,8 +1174,7 @@ def test_1_1_chat_text_message_delete_push_disappear(self):
self.chat_2.chat_element_by_text(message_to_delete_for_me).wait_for_status_to_be("Delivered", timeout)
self.chat_2.delete_message_in_chat(message_to_delete_for_me, everyone=False)
except TimeoutException:
self.errors.append(
"Message status was not changed to 'Delivered' after %s s, https://github.com/status-im/status-mobile/issues/15385" % timeout)
self.errors.append("Message status was not changed to 'Delivered' after %s s" % timeout)
else:
if not self.chat_2.chat_element_by_text(message_to_delete_for_me).is_element_disappeared(20):
self.errors.append("Deleted for me message is shown in chat for the author of message")
Expand Down
18 changes: 11 additions & 7 deletions test/appium/tests/critical/test_public_chat_browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,9 @@ def test_community_unread_messages_badge(self):

@marks.testrail_id(702894)
def test_community_contact_block_unblock_offline(self):
[home.jump_to_card_by_text('# %s' % self.channel_name) for home in self.homes]
for channel in self.channel_1, self.channel_2:
if not channel.chat_message_input.is_element_displayed():
channel.jump_to_card_by_text('# %s' % self.channel_name)
self.channel_1.send_message('message to get avatar of user 2 visible in next message')

self.channel_2.just_fyi("Sending message before block")
Expand All @@ -697,27 +699,27 @@ def test_community_contact_block_unblock_offline(self):
chat_element.member_photo.click()
self.channel_1.block_contact()

self.chat_1.just_fyi('messages from blocked user are hidden in public chat and close app')
self.chat_1.just_fyi('Check that messages from blocked user are hidden in public chat and close app')
if self.chat_1.chat_element_by_text(message_to_disappear).is_element_displayed():
self.errors.append("Messages from blocked user is not cleared in public chat ")
self.chat_1.jump_to_messages_home()
if self.home_1.element_by_text(self.username_2).is_element_displayed():
self.errors.append("1-1 chat from blocked user is not removed!")
self.chat_1.toggle_airplane_mode()

self.home_2.just_fyi('send message to public chat while device 1 is offline')
self.home_2.just_fyi('Send message to public chat while device 1 is offline')
message_blocked, message_unblocked = "Message from blocked user", "Hurray! unblocked"
self.channel_2.send_message(message_blocked)

self.chat_1.just_fyi('check that new messages from blocked user are not delivered')
self.chat_1.just_fyi('Check that new messages from blocked user are not delivered')
self.chat_1.toggle_airplane_mode()
self.home_1.jump_to_card_by_text('# %s' % self.channel_name)
for message in message_to_disappear, message_blocked:
if self.chat_1.chat_element_by_text(message).is_element_displayed(30):
self.errors.append(
"'%s' from blocked user is fetched from offline in community channel" % message)

self.chat_2.just_fyi('Unblock user and check that can see further messages')
self.chat_1.just_fyi('Unblock user and check that can see further messages')
# TODO: still no blocked users in new UI
profile_1 = self.home_1.get_profile_view()
self.home_1.jump_to_messages_home()
Expand All @@ -735,14 +737,16 @@ def test_community_contact_block_unblock_offline(self):
if not self.chat_1.chat_element_by_text(message_unblocked).is_element_displayed(120):
self.errors.append("Message was not received in public chat after user unblock!")

self.home_2.just_fyi("Add blocked user to contacts again after removing(removed automatically when blocked)")
self.home_1.just_fyi("Add blocked user to contacts again after removing(removed automatically when blocked)")
chat_element = self.channel_1.chat_element_by_text(message_unblocked)
chat_element.find_element()
chat_element.member_photo.click()
self.channel_1.profile_add_to_contacts_button.click()
self.home_2.just_fyi("Accept contact request after being unblocked")
self.home_2.jump_to_messages_home()
self.home_2.handle_contact_request(self.username_1)
self.channel_1.profile_send_message_button.wait_and_click()
self.channel_1.profile_send_message_button.click_until_absense_of_element(
desired_element=self.channel_1.profile_send_message_button)
self.chat_1.send_message("piy")

self.home_2.just_fyi("Check message in 1-1 chat after unblock")
Expand Down
9 changes: 7 additions & 2 deletions test/appium/tests/medium/test_activity_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,12 @@ def test_activity_center_reply_read_unread_delete_filter_swipe(self):

@marks.testrail_id(702957)
def test_activity_center_mentions(self):
if not self.channel_2.chat_message_input.is_element_displayed():
self.home_2.click_system_back_button_until_element_is_shown()
self.home_2.communities_tab.click()
self.home_2.get_chat(self.community_name, community=True).click()
self.community_2.get_channel(self.channel_name).click()
self.home_1.jump_to_communities_home()
self.home_2.jump_to_card_by_text('# %s' % self.channel_name)

self.device_2.just_fyi("Invited member sends a message with a mention")
self.channel_2.mention_user(self.username_1)
Expand Down Expand Up @@ -286,7 +290,8 @@ def test_activity_center_mentions(self):
@marks.testrail_id(702958)
def test_activity_center_admin_notification_accept_swipe(self):
self.home_2.just_fyi("Clearing history")
self.home_2.jump_to_messages_home()
self.home_2.click_system_back_button_until_element_is_shown()
self.home_2.chats_tab.click()
self.home_2.clear_chat_long_press(self.username_1)

[home.jump_to_communities_home() for home in (self.home_1, self.home_2)]
Expand Down

0 comments on commit be61818

Please sign in to comment.