Skip to content

Commit 4dd5d88

Browse files
committed
e2e: updated community tests 703086 and 702786
1 parent 27f11fc commit 4dd5d88

File tree

2 files changed

+56
-49
lines changed

2 files changed

+56
-49
lines changed

test/appium/tests/critical/test_public_chat_browsing.py

Lines changed: 55 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -984,24 +984,29 @@ def test_community_mark_all_messages_as_read(self):
984984
self.home_2.get_chat(self.community_name, community=True).click()
985985
self.community_2.get_channel(self.channel_name).click()
986986
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)
988988
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()
990995
mark_as_read_button = self.community_1.mark_all_messages_as_read_button
991996
community_1_element.long_press_until_element_is_shown(mark_as_read_button)
992997
mark_as_read_button.click()
993998
if community_1_element.new_messages_grey_dot.is_element_displayed():
994999
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")
10021005
self.errors.verify_no_errors()
10031006

10041007
@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")
10051010
def test_community_mentions_push_notification(self):
10061011
self.home_1.navigate_back_to_home_view()
10071012
if not self.channel_2.chat_message_input.is_element_displayed():
@@ -1030,6 +1035,8 @@ def test_community_mentions_push_notification(self):
10301035
else:
10311036
self.errors.append("Push notification with the mention was not received by admin")
10321037

1038+
self.channel_1.click_system_back_button()
1039+
10331040
if message_received:
10341041
self.channel_1.just_fyi("Set reaction for the message with a mention")
10351042
self.channel_1.set_reaction(message=self.username_1, emoji="sad")
@@ -1039,46 +1046,45 @@ def test_community_mentions_push_notification(self):
10391046
except (Failed, NoSuchElementException):
10401047
self.errors.append("Message reaction is not shown for the sender")
10411048

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")
10821088
self.errors.verify_no_errors()
10831089

10841090
@marks.testrail_id(702809)

test/appium/views/home_view.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ def get_contact_rows_count(self):
546546
def get_public_key_via_share_profile_tab(self):
547547
self.driver.info("Getting public key via Share tab")
548548
self.show_qr_code_button.click()
549+
self.link_to_profile_text.wait_for_visibility_of_element()
549550
self.link_to_profile_text.click()
550551
c_text = self.driver.get_clipboard_text()
551552
self.click_system_back_button()

0 commit comments

Comments
 (0)