@@ -984,24 +984,29 @@ def test_community_mark_all_messages_as_read(self):
984
984
self .home_2 .get_chat (self .community_name , community = True ).click ()
985
985
self .community_2 .get_channel (self .channel_name ).click ()
986
986
self .channel_2 .send_message (self .text_message )
987
- community_1_element = self .community_1 .get_chat (self .community_name )
987
+ community_1_element = self .community_1 .get_chat (self .community_name , community = True )
988
988
if not community_1_element .new_messages_grey_dot .is_element_displayed (90 ):
989
- self .errors .append ('New messages counter is not shown in home > Commmunity element' )
989
+ self .errors .append ('New messages counter is not shown in home > Community element' )
990
+ community_1_element .click ()
991
+ channel_1_element = self .community_1 .get_chat (self .channel_name , community_channel = True )
992
+ if not channel_1_element .new_messages_grey_dot .is_element_displayed ():
993
+ self .errors .append ("New messages counter is not shown in community channel element" )
994
+ self .community_1 .click_system_back_button ()
990
995
mark_as_read_button = self .community_1 .mark_all_messages_as_read_button
991
996
community_1_element .long_press_until_element_is_shown (mark_as_read_button )
992
997
mark_as_read_button .click ()
993
998
if community_1_element .new_messages_grey_dot .is_element_displayed ():
994
999
self .errors .append (
995
- 'Unread messages badge is shown in community channel while there are no unread messages' )
996
- # TODO: there should be one more check for community channel, which is still not ready
997
-
998
- # self.community_1.click_system_back_button_until_element_is_shown()
999
- # community_1_element = self.home_1.get_chat(self.community_name, community=True)
1000
- # if community_1_element.new_messages_community.is_element_displayed():
1001
- # self.errors.append('New messages community badge is shown on community after marking messages as read')
1000
+ 'Unread messages badge is shown in community element while there are no unread messages' )
1001
+ community_1_element .click ()
1002
+ if channel_1_element .new_messages_grey_dot .is_element_displayed ():
1003
+ self .errors .append (
1004
+ "New messages badge is shown in community channel element while there are no unread messages" )
1002
1005
self .errors .verify_no_errors ()
1003
1006
1004
1007
@marks .testrail_id (702786 )
1008
+ @marks .xfail (
1009
+ reason = "Issue with username in PN, issue #6 in https://github.com/status-im/status-mobile/issues/15500" )
1005
1010
def test_community_mentions_push_notification (self ):
1006
1011
self .home_1 .navigate_back_to_home_view ()
1007
1012
if not self .channel_2 .chat_message_input .is_element_displayed ():
@@ -1030,6 +1035,8 @@ def test_community_mentions_push_notification(self):
1030
1035
else :
1031
1036
self .errors .append ("Push notification with the mention was not received by admin" )
1032
1037
1038
+ self .channel_1 .click_system_back_button ()
1039
+
1033
1040
if message_received :
1034
1041
self .channel_1 .just_fyi ("Set reaction for the message with a mention" )
1035
1042
self .channel_1 .set_reaction (message = self .username_1 , emoji = "sad" )
@@ -1039,46 +1046,45 @@ def test_community_mentions_push_notification(self):
1039
1046
except (Failed , NoSuchElementException ):
1040
1047
self .errors .append ("Message reaction is not shown for the sender" )
1041
1048
1042
- # ToDo: this part is skipped because of an issue - sent messages stuck without any status for a long time
1043
- # and can not be edited during that time
1044
- # self.device_2.just_fyi("Sender edits the message with a mention")
1045
- # self.channel_2.chat_element_by_text(self.username_1).wait_for_sent_state()
1046
- # self.channel_2.chat_element_by_text(self.username_1).long_press_element_by_coordinate(rel_y=0)
1047
- # try:
1048
- # self.channel_2.element_by_translation_id("edit-message").click()
1049
- # for i in range(29, 32):
1050
- # self.channel_2.driver.press_keycode(i)
1051
- # self.channel_2.send_message_button.click()
1052
- # edited_message = self.username_1 + " abc"
1053
- # if not self.channel_2.chat_element_by_text(edited_message).is_element_displayed():
1054
- # self.errors.append("Edited message is not shown correctly for the sender")
1055
- # if not self.channel_1.chat_element_by_text(edited_message).is_element_displayed():
1056
- # self.errors.append("Edited message is not shown correctly for the (receiver) admin")
1057
- # except NoSuchElementException:
1058
- # self.errors.append("Can not edit a message with a mention")
1059
-
1060
- # ToDo: enable when https://github.com/status-im/status-mobile/issues/14956 is fixed
1061
- # self.home_2.click_system_back_button_until_element_is_shown()
1062
- # if not self.channel_1.chat_message_input.is_element_displayed():
1063
- # self.channel_1.click_system_back_button_until_element_is_shown()
1064
- # self.home_1.communities_tab.click()
1065
- # self.home_1.get_chat(self.community_name, community=True).click()
1066
- # self.community_1.get_channel(self.channel_name).click()
1067
- #
1068
- # self.device_1.just_fyi("Admin sends a message with a mention")
1069
- # self.channel_1.mention_user(self.username_2)
1070
- # self.channel_1.send_message_button.click()
1071
- # self.device_2.just_fyi("Invited member gets push notification with the mention and tap it")
1072
- # self.device_2.open_notification_bar()
1073
- # if not self.home_2.get_pn(self.username_2):
1074
- # self.device_2.driver.fail("Push notification with the mention was not received by the invited member")
1075
- # self.device_2.click_upon_push_notification_by_text(self.username_2)
1076
- # if not self.channel_2.chat_element_by_text(self.username_2).is_element_displayed():
1077
- # if self.channel_2.chat_message_input.is_element_displayed():
1078
- # self.device_2.driver.fail("Message with the mention is not shown in the chat for the invited member")
1079
- # else:
1080
- # self.device_2.driver.fail(
1081
- # "Channel did not open by clicking on a notification with the mention for the invited member")
1049
+ self .device_2 .just_fyi ("Sender edits the message with a mention" )
1050
+ self .channel_2 .chat_element_by_text (self .username_1 ).wait_for_sent_state ()
1051
+ self .channel_2 .chat_element_by_text (self .username_1 ).long_press_element_by_coordinate (rel_y = 0 )
1052
+ try :
1053
+ self .channel_2 .element_by_translation_id ("edit-message" ).click ()
1054
+ for i in range (29 , 32 ):
1055
+ self .channel_2 .driver .press_keycode (i )
1056
+ self .channel_2 .send_message_button .click ()
1057
+ edited_message = self .username_1 + " abc"
1058
+ if not self .channel_2 .chat_element_by_text (edited_message ).is_element_displayed ():
1059
+ self .errors .append ("Edited message is not shown correctly for the sender" )
1060
+ if not self .channel_1 .chat_element_by_text (edited_message ).is_element_displayed ():
1061
+ self .errors .append ("Edited message is not shown correctly for the (receiver) admin" )
1062
+ except NoSuchElementException :
1063
+ self .errors .append ("Can not edit a message with a mention" )
1064
+
1065
+ self .home_2 .navigate_back_to_home_view ()
1066
+ if not self .channel_1 .chat_message_input .is_element_displayed ():
1067
+ self .channel_1 .navigate_back_to_home_view ()
1068
+ self .home_1 .communities_tab .click ()
1069
+ self .home_1 .get_chat (self .community_name , community = True ).click ()
1070
+ self .community_1 .get_channel (self .channel_name ).click ()
1071
+
1072
+ self .device_1 .just_fyi ("Admin sends a message with a mention" )
1073
+ self .channel_1 .mention_user (self .username_2 )
1074
+ self .channel_1 .send_message_button .click ()
1075
+ self .device_2 .just_fyi ("Invited member gets push notification with the mention and tap it" )
1076
+ self .device_2 .open_notification_bar ()
1077
+ push_notification_element = self .home_2 .get_pn (self .username_2 )
1078
+ if push_notification_element :
1079
+ push_notification_element .click ()
1080
+ if not self .channel_2 .chat_element_by_text (self .username_2 ).is_element_displayed ():
1081
+ if self .channel_2 .chat_message_input .is_element_displayed ():
1082
+ self .errors .append ("Message with the mention is not shown in the chat for the invited member" )
1083
+ else :
1084
+ self .errors .append (
1085
+ "Channel did not open by clicking on a notification with the mention for the invited member" )
1086
+ else :
1087
+ self .errors .append ("Push notification with the mention was not received by the invited member" )
1082
1088
self .errors .verify_no_errors ()
1083
1089
1084
1090
@marks .testrail_id (702809 )
0 commit comments