Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.

Commit 4e8ebc6

Browse files
committed
e2e: previews + uncommented pins
1 parent 7f2623a commit 4e8ebc6

7 files changed

Lines changed: 116 additions & 107 deletions

File tree

test/appium/tests/critical/chats/test_1_1_public_chats.py

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
99
from tests.users import transaction_senders, basic_user, ens_user, ens_user_message_sender
1010
from views.sign_in_view import SignInView
11+
from views.base_element import Button
1112

1213

1314
@pytest.mark.xdist_group(name="four_2")
@@ -1105,51 +1106,52 @@ def test_1_1_chat_pin_messages(self):
11051106
# workaround for 14672
11061107
chat.tap_by_coordinates(500, 100)
11071108
# Part of the test is blocked by #14637
1108-
# chat.click_system_back_button()
1109-
#
1110-
# self.home_1.just_fyi("Check that Device1 can not pin more than 3 messages and 'Unpin' dialog appears")
1111-
# self.chat_1.send_message(self.message_3)
1112-
# self.chat_1.send_message(self.message_4)
1113-
# self.chat_1.pin_message(self.message_3, 'pin-to-chat')
1114-
# self.chat_1.pin_message(self.message_4, 'pin-to-chat')
1115-
# if self.chat_1.pin_limit_popover.is_element_displayed(30):
1116-
# self.chat_1.view_pinned_messages_button.click()
1117-
# self.chat_1.pinned_messages_list.message_element_by_text(
1118-
# self.message_2).click_inside_element_by_coordinate()
1119-
# self.home_1.just_fyi("Unpin one message so that another could be pinned")
1120-
# self.chat_1.element_by_translation_id('unpin-from-chat').double_click()
1121-
# self.chat_1.chat_element_by_text(self.message_4).click()
1122-
# self.chat_1.pin_message(self.message_4, 'pin-to-chat')
1123-
# if not (self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and
1124-
# self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30)):
1125-
# self.errors.append("Message 4 is not pinned in chat after unpinning previous one")
1126-
# else:
1127-
# self.errors.append("Can pin more than 3 messages in chat")
1128-
#
1129-
# self.home_1.just_fyi("Check pinned messages are visible in Pinned panel for both users")
1130-
# for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
1131-
# count = chat.pinned_messages_count.text
1132-
# if count != '3':
1133-
# self.errors.append("Pinned messages count is not 3 for user %s" % (chat_number + 1))
1134-
#
1135-
# self.home_1.just_fyi("Unpin one message and check it's unpinned for another user")
1136-
# self.chat_2.chat_element_by_text(self.message_4).long_press_element()
1137-
# self.chat_2.element_by_translation_id("unpin-from-chat").click()
1138-
# self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element()
1139-
# if self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed():
1140-
# self.errors.append("Message_4 is not unpinned!")
1141-
#
1142-
# for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
1143-
# count = chat.pinned_messages_count.text
1144-
# if count != '2':
1145-
# self.errors.append(
1146-
# "Pinned messages count is not 2 after unpinning the last pinned message for user %s" % (
1147-
# chat_number + 1)
1148-
# )
1109+
#chat.click_system_back_button()
1110+
1111+
self.home_1.just_fyi("Check that Device1 can not pin more than 3 messages and 'Unpin' dialog appears")
1112+
for message in (self.message_3, self.message_4):
1113+
self.chat_1.send_message(message)
1114+
self.chat_1.pin_message(message, 'pin-to-chat')
1115+
if self.chat_1.pin_limit_popover.is_element_displayed(30):
1116+
self.chat_1.view_pinned_messages_button.click_until_presence_of_element(self.chat_1.pinned_messages_list)
1117+
self.chat_1.pinned_messages_list.message_element_by_text(self.message_2).click_inside_element_by_coordinate()
1118+
self.home_1.just_fyi("Unpin one message so that another could be pinned")
1119+
self.chat_1.element_by_translation_id('unpin-from-chat').double_click()
1120+
self.chat_1.chat_element_by_text(self.message_4).click()
1121+
self.chat_1.pin_message(self.message_4, 'pin-to-chat')
1122+
if not (self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and
1123+
self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30)):
1124+
self.errors.append("Message 4 is not pinned in chat after unpinning previous one")
1125+
else:
1126+
self.errors.append("Can pin more than 3 messages in chat")
1127+
1128+
self.home_1.just_fyi("Check pinned messages are visible in Pinned panel for both users")
1129+
for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
1130+
count = chat.pinned_messages_count.text
1131+
if count != '3':
1132+
self.errors.append("Pinned messages count is not 3 for user %s" % (chat_number + 1))
1133+
1134+
self.home_1.just_fyi("Unpin one message and check it's unpinned for another user")
1135+
self.chat_2.tap_by_coordinates(500, 100)
1136+
# temp solution until finding solution for distinguish system and not-system messages
1137+
message_element = Button(self.chat_1.driver, xpath="//*[starts-with(@text,'%s')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[starts-with(@text,'[:')]" % self.message_4)
1138+
message_element.long_press_element()
1139+
self.chat_1.element_by_translation_id("unpin-from-chat").click()
1140+
self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element()
1141+
if self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed():
1142+
self.errors.append("Message_4 is not unpinned!")
1143+
1144+
for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
1145+
count = chat.pinned_messages_count.text
1146+
if count != '2':
1147+
self.errors.append(
1148+
"Pinned messages count is not 2 after unpinning the last pinned message for user %s" % (
1149+
chat_number + 1)
1150+
)
11491151
self.errors.verify_no_errors()
11501152

11511153
@marks.testrail_id(702745)
1152-
@marks.xfail(reason="On profile picture failed due to #14718")
1154+
@marks.xfail(reason="On profile picture failed due to 14718")
11531155
def test_1_1_chat_non_latin_messages_stack_update_profile_photo(self):
11541156
self.home_1.click_system_back_button_until_element_is_shown()
11551157
self.home_1.browser_tab.click() # temp, until profile is on browser tab

test/appium/tests/critical/chats/test_group_chat.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ def prepare_devices(self):
311311
"Message 1", "Message 2", "Message 3", "Message 4"
312312

313313
@marks.testrail_id(702732)
314-
@marks.xfail(reason="blocked by #14637")
315314
def test_group_chat_pin_messages(self):
316315
self.home_1.just_fyi("Enter group chat and pin message there. It's pinned for both members.")
317316

@@ -325,7 +324,7 @@ def test_group_chat_pin_messages(self):
325324
self.group_chat_2.chat_element_by_text(self.message_1).long_press_element()
326325
if self.group_chat_2.element_by_translation_id("unpin-from-chat").is_element_displayed():
327326
self.errors.append("Unpin option is available for non-admin user")
328-
self.group_chat_2.click_system_back_button()
327+
self.group_chat_2.tap_by_coordinates(500, 100)
329328

330329
# not implemented yet :
331330

@@ -353,10 +352,8 @@ def test_group_chat_pin_messages(self):
353352
self.group_chat_1.send_message(self.message_4)
354353
self.group_chat_1.pin_message(self.message_4, 'pin-to-chat')
355354
if self.group_chat_1.pin_limit_popover.is_element_displayed(30):
356-
self.group_chat_1.view_pinned_messages_button.click_until_presence_of_element(
357-
self.group_chat_1.pinned_messages_list)
358-
self.group_chat_1.pinned_messages_list.message_element_by_text(
359-
self.message_2).click_inside_element_by_coordinate()
355+
self.group_chat_1.view_pinned_messages_button.click_until_presence_of_element(self.group_chat_1.pinned_messages_list)
356+
self.group_chat_1.pinned_messages_list.message_element_by_text(self.message_2).click_inside_element_by_coordinate()
360357
self.group_chat_1.element_by_translation_id('unpin-from-chat').double_click()
361358
self.group_chat_1.chat_element_by_text(self.message_4).click()
362359
self.group_chat_1.pin_message(self.message_4, 'pin-to-chat')

test/appium/tests/critical/test_public_chat_browsing.py

Lines changed: 60 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ def prepare_devices(self):
615615
self.channel_2 = self.community_2.get_chat(self.channel_name).click()
616616

617617
@marks.testrail_id(702838)
618-
@marks.xfail(reason="blocked by #14797")
618+
@marks.xfail(reason="blocked by 14797")
619619
def test_community_message_send_check_timestamps_sender_username(self):
620620
message = self.text_message
621621
sent_time_variants = self.channel_1.convert_device_time_to_chat_timestamp()
@@ -631,7 +631,7 @@ def test_community_message_send_check_timestamps_sender_username(self):
631631
self.errors.verify_no_errors()
632632

633633
@marks.testrail_id(702843)
634-
@marks.xfail(reason="blocked by #14797")
634+
@marks.xfail(reason="blocked by 14797")
635635
def test_community_message_edit(self):
636636
message_before_edit, message_after_edit = 'Message BEFORE edit', "Message AFTER edit 2"
637637
if not self.channel_2.chat_message_input.is_element_displayed():
@@ -715,54 +715,64 @@ def test_community_unread_messages_badge(self):
715715
channel_1_element.click()
716716
self.errors.verify_no_errors()
717717

718-
# @marks.testrail_id(702844)
719-
# @marks.skip("Until preview component will be developed")
720-
# def test_community_links_with_previews_github_youtube_twitter_gif_send_enable(self):
721-
# giphy_url = 'https://giphy.com/gifs/this-is-fine-QMHoU66sBXqqLqYvGO'
722-
# preview_urls = {'github_pr': {'url': 'https://github.com/status-im/status-mobile/pull/11707',
723-
# 'txt': 'Update translations by jinhojang6 · Pull Request #11707 · status-im/status-mobile',
724-
# 'subtitle': 'GitHub'},
725-
# 'yotube': {
726-
# 'url': 'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao',
727-
# 'txt': 'Status & Keycard – Hardware-Enforced Security',
728-
# 'subtitle': 'YouTube'}
729-
# # twitter link is temporary removed from check as current xpath locator in message.preview_title is not applicable for this type of links
730-
# # 'twitter': {
731-
# # 'url': 'https://twitter.com/ethdotorg/status/1445161651771162627?s=20',
732-
# # 'txt': "We've rethought how we translate content, allowing us to translate",
733-
# # 'subtitle': 'Twitter'
734-
# # }
735-
# }
736-
#
737-
# self.home_1.just_fyi("Check enabling and sending first gif")
738-
# self.channel_2.send_message(giphy_url)
739-
# # workaround to get chat view focused
740-
# self.channel_2.send_message(giphy_url)
741-
# self.channel_2.element_by_translation_id("dont-ask").click()
742-
# # workaround to get chat view focused
743-
# self.channel_1.send_message(giphy_url)
744-
# self.channel_1.element_by_text("Enable").wait_and_click()
745-
#
746-
# self.channel_1.element_by_translation_id("enable-all").wait_and_click()
747-
# self.channel_1.click_system_back_button()
748-
# if not self.channel_1.get_preview_message_by_text(giphy_url).preview_image:
749-
# self.errors.append("No preview is shown for %s" % giphy_url)
750-
# for key in preview_urls:
751-
# self.home_2.just_fyi("Checking %s preview case" % key)
752-
# data = preview_urls[key]
753-
# self.channel_2.send_message(data['url'])
754-
# message = self.channel_1.get_preview_message_by_text(data['url'])
755-
# if data['txt'] not in message.preview_title.text:
756-
# self.errors.append("Title '%s' does not match expected" % message.preview_title.text)
757-
# if message.preview_subtitle.text != data['subtitle']:
758-
# self.errors.append("Subtitle '%s' does not match expected" % message.preview_subtitle.text)
759-
#
760-
# self.home_2.just_fyi("Check if after do not ask again previews are not shown and no enable button appear")
761-
# if self.channel_2.element_by_translation_id("enable").is_element_displayed():
762-
# self.errors.append("Enable button is still shown after clicking on 'Don't ask again'")
763-
# if self.channel_2.get_preview_message_by_text(giphy_url).preview_image:
764-
# self.errors.append("Preview is shown for sender without permission")
765-
# self.errors.verify_no_errors()
718+
@marks.testrail_id(702844)
719+
def test_community_links_with_previews_github_youtube_twitter_gif_send_enable(self):
720+
giphy_url = 'https://giphy.com/gifs/this-is-fine-QMHoU66sBXqqLqYvGO'
721+
preview_urls = {'github_pr': {'url': 'https://github.com/status-im/status-mobile/pull/11707',
722+
'txt': 'Update translations by jinhojang6 · Pull Request #11707 · status-im/status-mobile',
723+
'subtitle': 'GitHub'},
724+
'yotube_short': {
725+
'url': 'https://youtu.be/Je7yErjEVt4',
726+
'txt': 'Status, your gateway to Ethereum',
727+
'subtitle': 'YouTube'}
728+
# blocked by 14865
729+
# 'yotube_full': {
730+
# 'url': 'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao',
731+
# 'txt': 'Status & Keycard – Hardware-Enforced Security',
732+
# 'subtitle': 'YouTube'}
733+
# twitter link is temporary removed from check as current xpath locator in message.preview_title is not applicable for this type of links
734+
# 'twitter': {
735+
# 'url': 'https://twitter.com/ethdotorg/status/1445161651771162627?s=20',
736+
# 'txt': "We've rethought how we translate content, allowing us to translate",
737+
# 'subtitle': 'Twitter'
738+
# }
739+
}
740+
741+
self.home_1.just_fyi("Check enabling and sending first gif")
742+
self.channel_2.send_message(giphy_url)
743+
# workaround to get chat view focused
744+
self.channel_2.send_message(giphy_url)
745+
self.channel_2.element_by_translation_id("dont-ask").click()
746+
# workaround to get chat view focused
747+
self.channel_1.send_message(giphy_url)
748+
self.channel_1.element_by_text("Enable").wait_and_click()
749+
750+
self.channel_1.element_by_translation_id("enable-all").wait_and_click()
751+
self.channel_1.click_system_back_button()
752+
if not self.channel_1.get_preview_message_by_text(giphy_url).preview_image:
753+
self.errors.append("No preview is shown for %s" % giphy_url)
754+
for key in preview_urls:
755+
self.home_2.just_fyi("Checking %s preview case" % key)
756+
data = preview_urls[key]
757+
self.channel_2.send_message(data['url'])
758+
message = self.channel_1.get_preview_message_by_text(data['url'])
759+
if message.preview_title:
760+
if data['txt'] not in message.preview_title.text:
761+
self.errors.append("Title '%s' does not match expected" % message.preview_title.text)
762+
else:
763+
self.drivers[0].fail("No preview is shown!")
764+
if message.preview_subtitle:
765+
if message.preview_subtitle.text != data['subtitle']:
766+
self.errors.append("Subtitle '%s' does not match expected" % message.preview_subtitle.text)
767+
else:
768+
self.drivers[0].fail("No preview title is shown!")
769+
770+
self.home_2.just_fyi("Check if after do not ask again previews are not shown and no enable button appear")
771+
if self.channel_2.element_by_translation_id("enable").is_element_displayed():
772+
self.errors.append("Enable button is still shown after clicking on 'Don't ask again'")
773+
if self.channel_2.get_preview_message_by_text(giphy_url).preview_image:
774+
self.errors.append("Preview is shown for sender without permission")
775+
self.errors.verify_no_errors()
766776

767777
@marks.testrail_id(702842)
768778
def test_community_mark_all_messages_as_read(self):

test/appium/tests/medium/test_activity_center.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def test_activity_center_decline_contact_request_no_pn(self):
235235
self.errors.verify_no_errors()
236236

237237
@marks.testrail_id(702851)
238-
@marks.xfail(reason='blocked by #14798')
238+
@marks.xfail(reason='blocked by 14798')
239239
def test_activity_center_mentions_in_community_jump_to(self):
240240
self.device_2.just_fyi('Device2 sends a contact request to Device1')
241241
self.home_2.browser_tab.click()

test/appium/tests/medium/test_chats_m.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def test_profile_use_history_node_disable_enable(self):
226226
self.errors.verify_no_errors()
227227

228228
@marks.testrail_id(702287)
229-
@marks.xfail(reason="may be failed due to #13333")
229+
@marks.xfail(reason="may be failed due to 13333")
230230
def test_profile_can_not_connect_to_custom_history_node_add_delete(self):
231231
self.home_1.profile_button.double_click()
232232
self.home_2.home_button.double_click()

test/appium/tests/medium/test_single_device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ def test_contacts_unblock_user_is_not_added_back_to_contacts(self):
10371037
self.driver.fail("Unblocked user not added previously in contact list added in contacts!")
10381038

10391039
@marks.testrail_id(5721)
1040-
@marks.xfail(reason="may be failed due to #14013")
1040+
@marks.xfail(reason="may be failed due to 14013")
10411041
def test_group_chat_cant_add_more_twenty_participants(self):
10421042
user_20_contacts = dict()
10431043
user_20_contacts[

0 commit comments

Comments
 (0)