status-react/test/appium/tests/medium/test_activity_center.py

319 lines
18 KiB
Python
Raw Normal View History

2022-05-16 09:07:23 +00:00
import pytest
2022-12-29 13:49:00 +00:00
from tests import marks, run_in_parallel
2022-05-16 09:07:23 +00:00
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
from views.sign_in_view import SignInView
2022-12-29 13:49:00 +00:00
from views.chat_view import CommunityView
2023-03-01 11:33:58 +00:00
from selenium.common.exceptions import TimeoutException
2022-05-16 09:07:23 +00:00
2022-05-19 13:40:40 +00:00
@pytest.mark.xdist_group(name="four_2")
2022-05-16 09:07:23 +00:00
@marks.medium
class TestActivityCenterMultipleDeviceMedium(MultipleSharedDeviceTestCase):
def prepare_devices(self):
self.drivers, self.loop = create_shared_drivers(2)
self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
self.home_1, self.home_2 = self.device_1.create_user(enable_notifications=True), self.device_2.create_user()
self.public_key_user_1, self.username_1 = self.home_1.get_public_key_and_username(return_username=True)
self.public_key_user_2, self.username_2 = self.home_2.get_public_key_and_username(return_username=True)
2022-09-20 08:08:30 +00:00
[self.group_chat_name_1, self.group_chat_name_2] = "GroupChat1", "GroupChat2"
self.message_from_sender = "Message sender"
self.home_2.home_button.double_click()
self.device_2_one_to_one_chat = self.home_2.add_contact(self.public_key_user_1)
2022-05-16 09:07:23 +00:00
2022-05-19 13:40:40 +00:00
@marks.testrail_id(702185)
def test_activity_center_notifications_on_mentions_in_groups_and_empty_state(self):
[home.home_button.double_click() for home in [self.home_1, self.home_2]]
2022-09-23 13:42:04 +00:00
if not self.home_1.element_by_text_part(self.username_2).is_element_displayed():
self.home_1.handle_contact_request(self.username_2)
self.home_1.home_button.double_click()
2022-05-19 13:40:40 +00:00
self.device_2.just_fyi('Device2 creates Group chat 3')
2022-09-20 08:08:30 +00:00
self.home_2.create_group_chat([self.username_1], group_chat_name=self.group_chat_name_1)
2022-05-19 13:40:40 +00:00
self.home_2.home_button.double_click()
self.home_1.just_fyi("Device1 joins Group chat 3")
2022-09-20 08:08:30 +00:00
group_chat_1 = self.home_1.get_chat(self.group_chat_name_1).click()
2022-06-28 15:54:14 +00:00
group_chat_1.join_chat_button.click_if_shown()
2022-05-19 13:40:40 +00:00
group_chat_1.home_button.double_click()
self.home_2.just_fyi("Device2 mentions Device1 in Group chat 3")
2022-09-20 08:08:30 +00:00
chat_2 = self.home_2.get_chat_from_home_view(self.group_chat_name_1).click()
2022-05-19 13:40:40 +00:00
chat_2.select_mention_from_suggestion_list(self.username_1, self.username_1[:2])
chat_2.send_as_keyevent("group")
group_chat_message = self.username_1 + " group"
chat_2.send_message_button.click()
self.home_1.just_fyi("Device1 checks unread indicator on Activity center bell")
if not self.home_1.notifications_unread_badge.is_element_displayed():
self.errors.append("Unread badge is NOT shown after receiving mentions from Group")
2022-09-23 10:05:40 +00:00
self.home_1.notifications_unread_badge.click_until_absense_of_element(self.home_1.plus_button, 6)
2022-05-19 13:40:40 +00:00
self.home_1.just_fyi("Check that notification from group is presented in Activity Center")
2023-03-13 13:29:18 +00:00
if not self.home_1.get_element_from_activity_center_view(
self.username_2).chat_message_preview == group_chat_message:
2022-05-19 13:40:40 +00:00
self.errors.append("No mention in Activity Center for Group Chat")
self.home_1.just_fyi("Open group chat where user mentioned")
2023-03-13 13:29:18 +00:00
self.home_1.get_element_from_activity_center_view(self.username_2).click()
2022-05-19 13:40:40 +00:00
self.home_1.home_button.double_click()
self.home_1.just_fyi("Check there are no unread messages counter on chats after message is read")
2022-10-04 15:44:55 +00:00
if (self.home_1.notifications_unread_badge.is_element_displayed() or
2022-09-20 08:08:30 +00:00
self.home_1.get_chat_from_home_view(self.group_chat_name_1).new_messages_counter.text == "1"):
2022-05-19 13:40:40 +00:00
self.errors.append("Unread message indicator is kept after message is read in chat")
self.home_1.just_fyi("Check there is an empty view on Activity Center")
self.home_1.notifications_button.click()
2022-10-04 15:44:55 +00:00
if not self.home_1.element_by_translation_id('empty-activity-center').is_element_displayed():
2022-09-23 10:05:40 +00:00
self.errors.append("Activity Center still has some chats after user has opened all of them")
2022-05-19 13:40:40 +00:00
self.errors.verify_no_errors()
2022-12-29 13:49:00 +00:00
2023-03-13 13:29:18 +00:00
@pytest.mark.xdist_group(name="new_two_2")
2022-12-29 13:49:00 +00:00
@marks.new_ui_critical
2023-03-09 11:06:03 +00:00
class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestCase):
2022-12-29 13:49:00 +00:00
def prepare_devices(self):
self.drivers, self.loop = create_shared_drivers(2)
self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
self.loop.run_until_complete(run_in_parallel(((self.device_1.create_user,), (self.device_2.create_user,))))
self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view()
self.profile_1, self.profile_2 = self.home_1.get_profile_view(), self.home_2.get_profile_view()
users = self.loop.run_until_complete(run_in_parallel(
((self.home_1.get_public_key_and_username, True),
(self.home_2.get_public_key_and_username, True))
))
self.public_key_1, self.default_username_1 = users[0]
self.public_key_2, self.default_username_2 = users[1]
self.profile_1.just_fyi("Enabling PNs")
self.profile_1.switch_push_notifications()
[home.click_system_back_button_until_element_is_shown() for home in [self.home_1, self.home_2]]
2023-03-09 11:06:03 +00:00
[home.chats_tab.click() for home in [self.home_1, self.home_2]]
2022-12-29 13:49:00 +00:00
2023-03-01 11:33:58 +00:00
@marks.testrail_id(702871)
2023-03-09 11:06:03 +00:00
def test_activity_center_contact_request_cancel_outgoing_no_pn(self):
2022-12-29 13:49:00 +00:00
self.device_1.put_app_to_background()
self.device_2.just_fyi('Device2 sends a contact request to Device1')
2023-03-01 11:33:58 +00:00
self.home_2.add_contact(self.public_key_1)
2022-12-29 13:49:00 +00:00
self.device_1.just_fyi("Device 2: check there is no PN when receiving new message to activity centre")
self.device_1.open_notification_bar()
if self.home_1.element_by_text_part("Please add me to your contacts").is_element_displayed():
self.errors.append("Push notification with text was received for new message in activity centre")
self.device_1.click_system_back_button(2)
2023-03-01 11:33:58 +00:00
self.profile_2.just_fyi("Check outgoing contact request and cancel it")
for indicator in (self.home_2.notifications_unread_badge, self.home_2.contact_new_badge):
if not indicator.is_element_displayed():
self.errors.append("Unread indicator on contacts tab or on activity center is not shown for outgoing CR!")
self.home_2.contacts_tab.click()
if self.home_2.pending_contact_request_text.text != '1':
self.errors.append("The amount of contact requests is not shown for outgoing CR!")
self.home_2.pending_contact_request_button.click()
2023-03-13 13:29:18 +00:00
outgoing_cr = self.home_2.get_element_from_activity_center_view(self.default_username_1)
2023-03-01 11:33:58 +00:00
outgoing_cr.cancel_contact_request()
self.home_2.close_activity_centre.click()
self.profile_1.just_fyi("Check there is no unread indicator and pending CR")
self.device_1.chats_tab.click()
try:
self.home_1.pending_contact_request_button.wait_for_invisibility_of_element(30)
self.home_1.notifications_unread_badge.wait_for_invisibility_of_element(30)
except TimeoutException:
self.errors.append("Cancelled request is not disappeared!")
self.errors.verify_no_errors()
@marks.testrail_id(702850)
2023-03-09 11:06:03 +00:00
def test_activity_center_contact_request_decline(self):
2023-03-01 11:33:58 +00:00
[home.chats_tab.click() for home in [self.home_1, self.home_2]]
self.home_2.just_fyi("Device2 sends pending contact request after cancelling")
self.home_2.add_contact(self.public_key_1)
2022-12-29 13:49:00 +00:00
self.device_1.just_fyi('Device1 verifies pending contact request')
self.home_1.contacts_tab.click()
for indicator in (self.home_1.notifications_unread_badge, self.home_1.contact_new_badge):
if not indicator.is_element_displayed():
2023-03-01 11:33:58 +00:00
self.errors.append("Unread indicator on contacts tab or on activity center is not shown for incoming CR!")
2022-12-29 13:49:00 +00:00
if self.home_1.pending_contact_request_text.text != '1':
2023-03-01 11:33:58 +00:00
self.errors.append("The amount of contact requests is not shown for incoming CR!")
2022-12-29 13:49:00 +00:00
self.device_1.just_fyi('Device1 declines pending contact request')
2023-03-01 11:33:58 +00:00
self.home_1.handle_contact_request(username=self.default_username_2, action='decline')
2022-12-29 13:49:00 +00:00
for indicator in (self.home_1.notifications_unread_badge, self.home_1.contact_new_badge, self.home_1.pending_contact_request_text):
if indicator.is_element_displayed():
self.errors.append("Unread indicator on contacts tab or on activity center is shown after declining contact request!")
self.errors.verify_no_errors()
@marks.testrail_id(702851)
2023-03-09 11:06:03 +00:00
def test_activity_center_contact_request_accept(self):
2023-02-24 19:05:30 +00:00
self.device_2.just_fyi('Device2 re-sends a contact request to Device1')
2023-03-01 11:33:58 +00:00
self.home_2.add_contact(self.public_key_1, remove_from_contacts=True)
2022-12-29 13:49:00 +00:00
self.device_1.just_fyi('Device1 accepts pending contact request and check contact list')
self.home_1.chats_tab.click()
self.home_1.handle_contact_request(username=self.default_username_2)
self.home_1.contacts_tab.click()
if not self.home_1.contact_details(username=self.default_username_2).is_element_displayed(20):
2023-03-09 11:06:03 +00:00
self.errors.append("Contact was not added to contact list after accepting contact request (as receiver)")
self.device_2.just_fyi('Device1 check that contact appeared in contact list mutually')
self.home_2.chats_tab.click()
self.home_2.contacts_tab.click()
if not self.home_2.contact_details(username=self.default_username_1).is_element_displayed(20):
self.errors.append("Contact was not added to contact list after accepting contact request (as sender)")
self.errors.verify_no_errors()
2023-03-13 13:29:18 +00:00
@pytest.mark.xdist_group(name="new_one_3")
2023-03-09 11:06:03 +00:00
@marks.new_ui_critical
class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase):
def prepare_devices(self):
self.drivers, self.loop = create_shared_drivers(2)
self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
self.loop.run_until_complete(
run_in_parallel(((self.device_1.create_user,), (self.device_2.create_user,))))
self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view()
self.profile_1, self.profile_2 = self.home_1.get_profile_view(), self.home_2.get_profile_view()
users = self.loop.run_until_complete(run_in_parallel(
((self.home_1.get_public_key_and_username, True),
(self.home_2.get_public_key_and_username, True))
))
self.public_key_1, self.default_username_1 = users[0]
self.public_key_2, self.default_username_2 = users[1]
[home.click_system_back_button_until_element_is_shown() for home in (self.home_1, self.home_2)]
[home.chats_tab.click() for home in (self.home_1, self.home_2)]
self.home_1.add_contact(self.public_key_2)
self.home_2.handle_contact_request(self.default_username_1)
self.text_message = 'hello'
self.one_to_one_message = 'one-t-one message'
self.home_2.just_fyi("Send message to contact (need for jump to) test")
self.chat_1 = self.home_1.get_chat(self.default_username_2).click()
self.chat_1.send_message(self.one_to_one_message)
self.chat_2 = self.home_2.get_chat(self.default_username_1).click()
self.chat_2.send_message(self.text_message)
[home.click_system_back_button_until_element_is_shown() for home in (self.home_1, self.home_2)]
2022-12-29 13:49:00 +00:00
2023-03-09 11:06:03 +00:00
self.home_1.just_fyi("Open community to message")
self.home_1.communities_tab.click()
2022-12-29 13:49:00 +00:00
self.community_name = self.home_1.get_random_chat_name()
self.channel_name = self.home_1.get_random_chat_name()
self.home_1.create_community(name=self.community_name, description='community to test', require_approval=False)
self.community_1 = CommunityView(self.drivers[0])
self.community_1.send_invite_to_community(self.default_username_2)
2023-03-09 11:06:03 +00:00
self.channel_1 = self.community_1.add_channel(self.channel_name)
2022-12-29 13:49:00 +00:00
self.chat_2 = self.home_2.get_chat(self.default_username_1).click()
self.chat_2.element_by_text_part('View').click()
self.community_2 = CommunityView(self.drivers[1])
self.community_2.join_button.click()
2023-03-13 13:29:18 +00:00
self.channel_1.send_message(self.text_message)
2022-12-29 13:49:00 +00:00
2023-03-09 11:06:03 +00:00
self.home_1.just_fyi("Reopen community view to use new interface")
for home in (self.home_1, self.home_2):
home.jump_to_communities_home()
home.get_chat(self.community_name, community=True).click()
community_view = home.get_community_view()
community_view.get_channel(self.channel_name).click()
self.channel_2 = self.home_2.get_chat_view()
@marks.testrail_id(702936)
def test_navigation_jump_to(self):
self.community_1.just_fyi("Check Jump to screen and redirect on tap")
self.community_1.jump_to_button.click()
for card in (self.community_name, self.default_username_2):
if not self.community_1.element_by_text_part(card).is_element_displayed(20):
2022-12-29 13:49:00 +00:00
self.errors.append("Card %s is not shown on Jump to screen!" % card)
2023-03-09 11:06:03 +00:00
self.community_1.element_by_translation_id("community-channel").click()
if not self.channel_1.chat_element_by_text(self.text_message).is_element_displayed(20):
self.errors.append("User was not redirected to community channel after tapping on community channel card!")
self.channel_1.click_system_back_button()
self.community_1.jump_to_button.click()
self.community_1.element_by_text_part(self.default_username_2).click()
if not self.chat_1.chat_element_by_text(self.one_to_one_message).is_element_displayed(20):
2022-12-29 13:49:00 +00:00
self.errors.append("User was not redirected to 1-1 chat after tapping card!")
self.errors.verify_no_errors()
2023-03-13 13:29:18 +00:00
@marks.testrail_id(702947)
def test_activity_center_reply_read_unread_delete_filter(self):
message_to_reply, reply_to_message_from_sender = 'something to reply to', 'this is a reply'
self.home_1.jump_to_communities_home()
self.home_1.get_chat(self.community_name, community=True).click()
self.community_1.get_channel(self.channel_name).click()
self.channel_1.send_message(message_to_reply)
self.home_1.jump_to_communities_home()
self.channel_2.chat_element_by_text(message_to_reply).wait_for_visibility_of_element(60)
self.channel_2.quote_message(message_to_reply)
self.channel_2.send_message(reply_to_message_from_sender)
self.home_1.just_fyi("Checking unread indicators")
community_element_1 = self.home_1.get_chat(self.community_name, community=True)
for unread_counter in community_element_1.new_messages_counter, self.home_1.communities_tab.counter:
if not unread_counter.is_element_displayed(60):
self.errors.append('New message counter badge is not shown!')
if unread_counter.text != '1':
self.errors.append('New message counter badge is not 1, it is %s!' % unread_counter.text)
self.home_1.just_fyi("Checking reply attributes in activity center")
self.home_1.open_activity_center_button.click()
reply_element = self.home_1.get_element_from_activity_center_view(reply_to_message_from_sender)
if reply_element.title.text != 'Reply':
self.errors.append("Expected title is not shown, '%s' is instead!" % reply_element.title)
if not reply_element.unread_indicator.is_element_displayed():
self.errors.append("No unread dot is shown on activity center element!")
self.home_1.just_fyi("Swiping to 'Replies' on activity center and check unread there")
self.home_1.mention_activity_tab_button.click()
if reply_element.is_element_displayed(2):
self.errors.append("Filter on mentions is not working in Activity centre!")
self.home_1.reply_activity_tab_button.click()
if not self.home_1.reply_activity_tab_button.counter.is_element_displayed(2):
self.errors.append("No unread dot is shown on activity center tab element!")
if not reply_element.is_element_displayed():
self.errors.append("Filter on replies tab is not working in Activity centre!")
self.home_1.just_fyi("Mark it as read and check filter")
reply_element.swipe_right_on_element()
Swipe gestures for Activity Center notifications with CTA (#15284) Implements swipe actions for notifications with call to action (e.g. pending contact requests, unverified identity verifications, etc). Fixes https://github.com/status-im/status-mobile/issues/15118 According to the Design team, the goal is to deliver a consistent experience to users, so whenever the user sees a notification with buttons, the same actions can be taken via the swipe buttons. Note: swipe buttons are using placeholder icons while the Design team works out which ones to use Additionally, a bunch of fixes: - Fix: outgoing pending contact requests were not being removed from the UI when cancelled. - Fix: Membership tab not showing unread indicator. - Fix: dismissed membership notification not marked as read. - Fix: dismissed membership notification was displaying decline/accept buttons. Regression came from changes in status-go related to soft deletion of notifications. - Fix: incorrect check for the pending state of a contact request. - Fixed lots of bugs for identity verification notifications, as it was completely broken. Unfortunately, somebody made lots of changes without actually testing the flows. - Add basic error handling and log if accepting, declining or canceling contact requests fail. The demo shows an identity verification with swipe actions to reply or decline. [identity-verification-swipe-to-reply.webm](https://user-images.githubusercontent.com/46027/223565755-b2ca3f68-12e2-4e1e-9e52-edd52cfcc971.webm) Out of scope: The old quo input is still in use in the identity verification notification. This will eventually be solved by issue https://github.com/status-im/status-mobile/issues/14364 ### Steps to test Notifications with one or more buttons (actions) are affected by this change, because now the user can also swipe left/right to act on them. - Membership notifications: private group chat. The following PR explains how to generate them https://github.com/status-im/status-mobile/pull/14785 - Contact requests, and community gated requests to join (Admin tab). - Identity verifications. I believe the only way to test identity verification flows at the moment is to use the Desktop app, since initiating the challenge is not implemented in Mobile yet. - Mentions and replies don't have new swipe buttons because they don't have call to action buttons throughout their lifecycle. Steps to test identity verification flows: #### Identity verification flow 1 - `A` and `B` are mutual contacts. - `A` sends a verification request to `B`. - `A` should not see any notification yet. - `B` should receive an identity verification notification. `B` can either decline or reply. - `B` declines and the status `Declined` is shown instead of buttons. - `B` can now either swipe to toggle read/unread or swipe delete the notification. - `A` should not receive any notification after `A` declined. #### Identity verification flow 2 - `A` and `B` are mutual contacts. - `A` sends a verification request to `B`. - `A` should not see any notification yet. - `B` should receive an identity verification notification. `B` can either decline or reply. - `B` press `Reply` and a bottom sheet is displayed with a text input. - `B` sends the reply/answer message and the status `Replied` is shown instead of buttons. - `B` can now either swipe to toggle read/unread or swipe to delete the notification. - `A` should receive a notification with the reply from `B`. - `A` can either mark the answer as untrustworthy or accept it (trust it) via the normal buttons, as well as via the swipe left/right buttons. - If `A` accepts the answer, then the status `Confirmed` is shown instead of buttons. On the other hand, if `A` marks as untrustworthy, then the status `Untrustworthy` is shown instead of buttons. - `B` should receive no further notifications due to `A`s actions. - `A` can now either swipe to toggle read/unread or swipe delete the notification.
2023-03-14 15:34:13 +00:00
self.home_1.activity_notification_swipe_button.click()
2023-03-13 13:29:18 +00:00
if reply_element.is_element_displayed(2):
self.errors.append("Message is not marked as read!")
self.home_1.activity_unread_filter_button.click()
if not reply_element.is_element_displayed(2):
self.errors.append("Read filter is not displayed read message!")
self.home_1.just_fyi("Mark it as unread and check filter via right swipe")
reply_element.swipe_right_on_element()
Swipe gestures for Activity Center notifications with CTA (#15284) Implements swipe actions for notifications with call to action (e.g. pending contact requests, unverified identity verifications, etc). Fixes https://github.com/status-im/status-mobile/issues/15118 According to the Design team, the goal is to deliver a consistent experience to users, so whenever the user sees a notification with buttons, the same actions can be taken via the swipe buttons. Note: swipe buttons are using placeholder icons while the Design team works out which ones to use Additionally, a bunch of fixes: - Fix: outgoing pending contact requests were not being removed from the UI when cancelled. - Fix: Membership tab not showing unread indicator. - Fix: dismissed membership notification not marked as read. - Fix: dismissed membership notification was displaying decline/accept buttons. Regression came from changes in status-go related to soft deletion of notifications. - Fix: incorrect check for the pending state of a contact request. - Fixed lots of bugs for identity verification notifications, as it was completely broken. Unfortunately, somebody made lots of changes without actually testing the flows. - Add basic error handling and log if accepting, declining or canceling contact requests fail. The demo shows an identity verification with swipe actions to reply or decline. [identity-verification-swipe-to-reply.webm](https://user-images.githubusercontent.com/46027/223565755-b2ca3f68-12e2-4e1e-9e52-edd52cfcc971.webm) Out of scope: The old quo input is still in use in the identity verification notification. This will eventually be solved by issue https://github.com/status-im/status-mobile/issues/14364 ### Steps to test Notifications with one or more buttons (actions) are affected by this change, because now the user can also swipe left/right to act on them. - Membership notifications: private group chat. The following PR explains how to generate them https://github.com/status-im/status-mobile/pull/14785 - Contact requests, and community gated requests to join (Admin tab). - Identity verifications. I believe the only way to test identity verification flows at the moment is to use the Desktop app, since initiating the challenge is not implemented in Mobile yet. - Mentions and replies don't have new swipe buttons because they don't have call to action buttons throughout their lifecycle. Steps to test identity verification flows: #### Identity verification flow 1 - `A` and `B` are mutual contacts. - `A` sends a verification request to `B`. - `A` should not see any notification yet. - `B` should receive an identity verification notification. `B` can either decline or reply. - `B` declines and the status `Declined` is shown instead of buttons. - `B` can now either swipe to toggle read/unread or swipe delete the notification. - `A` should not receive any notification after `A` declined. #### Identity verification flow 2 - `A` and `B` are mutual contacts. - `A` sends a verification request to `B`. - `A` should not see any notification yet. - `B` should receive an identity verification notification. `B` can either decline or reply. - `B` press `Reply` and a bottom sheet is displayed with a text input. - `B` sends the reply/answer message and the status `Replied` is shown instead of buttons. - `B` can now either swipe to toggle read/unread or swipe to delete the notification. - `A` should receive a notification with the reply from `B`. - `A` can either mark the answer as untrustworthy or accept it (trust it) via the normal buttons, as well as via the swipe left/right buttons. - If `A` accepts the answer, then the status `Confirmed` is shown instead of buttons. On the other hand, if `A` marks as untrustworthy, then the status `Untrustworthy` is shown instead of buttons. - `B` should receive no further notifications due to `A`s actions. - `A` can now either swipe to toggle read/unread or swipe delete the notification.
2023-03-14 15:34:13 +00:00
self.home_1.activity_notification_swipe_button.click()
2023-03-13 13:29:18 +00:00
if not reply_element.unread_indicator.is_element_displayed():
self.errors.append("No unread dot is shown on activity center element after marking it as unread!")
self.home_1.just_fyi("Tap on it and check it marked as read")
reply_element.click()
if not self.channel_1.chat_element_by_text(reply_to_message_from_sender).is_element_displayed():
self.errors.append("Was not redirected to chat after tapping on reply!")
self.home_1.jump_to_communities_home()
if self.home_1.notifications_unread_badge.is_element_displayed():
self.errors.append("Notification was not marked as read after opening it in community channel!")
self.home_1.just_fyi("Delete it from unread via left swipe")
self.home_1.open_activity_center_button.click()
reply_element.swipe_left_on_element()
Swipe gestures for Activity Center notifications with CTA (#15284) Implements swipe actions for notifications with call to action (e.g. pending contact requests, unverified identity verifications, etc). Fixes https://github.com/status-im/status-mobile/issues/15118 According to the Design team, the goal is to deliver a consistent experience to users, so whenever the user sees a notification with buttons, the same actions can be taken via the swipe buttons. Note: swipe buttons are using placeholder icons while the Design team works out which ones to use Additionally, a bunch of fixes: - Fix: outgoing pending contact requests were not being removed from the UI when cancelled. - Fix: Membership tab not showing unread indicator. - Fix: dismissed membership notification not marked as read. - Fix: dismissed membership notification was displaying decline/accept buttons. Regression came from changes in status-go related to soft deletion of notifications. - Fix: incorrect check for the pending state of a contact request. - Fixed lots of bugs for identity verification notifications, as it was completely broken. Unfortunately, somebody made lots of changes without actually testing the flows. - Add basic error handling and log if accepting, declining or canceling contact requests fail. The demo shows an identity verification with swipe actions to reply or decline. [identity-verification-swipe-to-reply.webm](https://user-images.githubusercontent.com/46027/223565755-b2ca3f68-12e2-4e1e-9e52-edd52cfcc971.webm) Out of scope: The old quo input is still in use in the identity verification notification. This will eventually be solved by issue https://github.com/status-im/status-mobile/issues/14364 ### Steps to test Notifications with one or more buttons (actions) are affected by this change, because now the user can also swipe left/right to act on them. - Membership notifications: private group chat. The following PR explains how to generate them https://github.com/status-im/status-mobile/pull/14785 - Contact requests, and community gated requests to join (Admin tab). - Identity verifications. I believe the only way to test identity verification flows at the moment is to use the Desktop app, since initiating the challenge is not implemented in Mobile yet. - Mentions and replies don't have new swipe buttons because they don't have call to action buttons throughout their lifecycle. Steps to test identity verification flows: #### Identity verification flow 1 - `A` and `B` are mutual contacts. - `A` sends a verification request to `B`. - `A` should not see any notification yet. - `B` should receive an identity verification notification. `B` can either decline or reply. - `B` declines and the status `Declined` is shown instead of buttons. - `B` can now either swipe to toggle read/unread or swipe delete the notification. - `A` should not receive any notification after `A` declined. #### Identity verification flow 2 - `A` and `B` are mutual contacts. - `A` sends a verification request to `B`. - `A` should not see any notification yet. - `B` should receive an identity verification notification. `B` can either decline or reply. - `B` press `Reply` and a bottom sheet is displayed with a text input. - `B` sends the reply/answer message and the status `Replied` is shown instead of buttons. - `B` can now either swipe to toggle read/unread or swipe to delete the notification. - `A` should receive a notification with the reply from `B`. - `A` can either mark the answer as untrustworthy or accept it (trust it) via the normal buttons, as well as via the swipe left/right buttons. - If `A` accepts the answer, then the status `Confirmed` is shown instead of buttons. On the other hand, if `A` marks as untrustworthy, then the status `Untrustworthy` is shown instead of buttons. - `B` should receive no further notifications due to `A`s actions. - `A` can now either swipe to toggle read/unread or swipe delete the notification.
2023-03-14 15:34:13 +00:00
self.home_1.activity_notification_swipe_button.click()
2023-03-13 13:29:18 +00:00
if reply_element.is_element_displayed():
self.errors.append("Reply is still shown after removing from activity centre!")
self.errors.verify_no_errors()