mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 10:42:53 +00:00
e2e: previews + uncommented pins
This commit is contained in:
parent
7f2623a23e
commit
4e8ebc6d85
@ -8,6 +8,7 @@ from tests import marks, common_password, run_in_parallel
|
||||
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
|
||||
from tests.users import transaction_senders, basic_user, ens_user, ens_user_message_sender
|
||||
from views.sign_in_view import SignInView
|
||||
from views.base_element import Button
|
||||
|
||||
|
||||
@pytest.mark.xdist_group(name="four_2")
|
||||
@ -1105,51 +1106,52 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
|
||||
# workaround for 14672
|
||||
chat.tap_by_coordinates(500, 100)
|
||||
# Part of the test is blocked by #14637
|
||||
# chat.click_system_back_button()
|
||||
#
|
||||
# self.home_1.just_fyi("Check that Device1 can not pin more than 3 messages and 'Unpin' dialog appears")
|
||||
# self.chat_1.send_message(self.message_3)
|
||||
# self.chat_1.send_message(self.message_4)
|
||||
# self.chat_1.pin_message(self.message_3, 'pin-to-chat')
|
||||
# self.chat_1.pin_message(self.message_4, 'pin-to-chat')
|
||||
# if self.chat_1.pin_limit_popover.is_element_displayed(30):
|
||||
# self.chat_1.view_pinned_messages_button.click()
|
||||
# self.chat_1.pinned_messages_list.message_element_by_text(
|
||||
# self.message_2).click_inside_element_by_coordinate()
|
||||
# self.home_1.just_fyi("Unpin one message so that another could be pinned")
|
||||
# self.chat_1.element_by_translation_id('unpin-from-chat').double_click()
|
||||
# self.chat_1.chat_element_by_text(self.message_4).click()
|
||||
# self.chat_1.pin_message(self.message_4, 'pin-to-chat')
|
||||
# if not (self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and
|
||||
# self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30)):
|
||||
# self.errors.append("Message 4 is not pinned in chat after unpinning previous one")
|
||||
# else:
|
||||
# self.errors.append("Can pin more than 3 messages in chat")
|
||||
#
|
||||
# self.home_1.just_fyi("Check pinned messages are visible in Pinned panel for both users")
|
||||
# for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
|
||||
# count = chat.pinned_messages_count.text
|
||||
# if count != '3':
|
||||
# self.errors.append("Pinned messages count is not 3 for user %s" % (chat_number + 1))
|
||||
#
|
||||
# self.home_1.just_fyi("Unpin one message and check it's unpinned for another user")
|
||||
# self.chat_2.chat_element_by_text(self.message_4).long_press_element()
|
||||
# self.chat_2.element_by_translation_id("unpin-from-chat").click()
|
||||
# self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element()
|
||||
# if self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed():
|
||||
# self.errors.append("Message_4 is not unpinned!")
|
||||
#
|
||||
# for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
|
||||
# count = chat.pinned_messages_count.text
|
||||
# if count != '2':
|
||||
# self.errors.append(
|
||||
# "Pinned messages count is not 2 after unpinning the last pinned message for user %s" % (
|
||||
# chat_number + 1)
|
||||
# )
|
||||
#chat.click_system_back_button()
|
||||
|
||||
self.home_1.just_fyi("Check that Device1 can not pin more than 3 messages and 'Unpin' dialog appears")
|
||||
for message in (self.message_3, self.message_4):
|
||||
self.chat_1.send_message(message)
|
||||
self.chat_1.pin_message(message, 'pin-to-chat')
|
||||
if self.chat_1.pin_limit_popover.is_element_displayed(30):
|
||||
self.chat_1.view_pinned_messages_button.click_until_presence_of_element(self.chat_1.pinned_messages_list)
|
||||
self.chat_1.pinned_messages_list.message_element_by_text(self.message_2).click_inside_element_by_coordinate()
|
||||
self.home_1.just_fyi("Unpin one message so that another could be pinned")
|
||||
self.chat_1.element_by_translation_id('unpin-from-chat').double_click()
|
||||
self.chat_1.chat_element_by_text(self.message_4).click()
|
||||
self.chat_1.pin_message(self.message_4, 'pin-to-chat')
|
||||
if not (self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and
|
||||
self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30)):
|
||||
self.errors.append("Message 4 is not pinned in chat after unpinning previous one")
|
||||
else:
|
||||
self.errors.append("Can pin more than 3 messages in chat")
|
||||
|
||||
self.home_1.just_fyi("Check pinned messages are visible in Pinned panel for both users")
|
||||
for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
|
||||
count = chat.pinned_messages_count.text
|
||||
if count != '3':
|
||||
self.errors.append("Pinned messages count is not 3 for user %s" % (chat_number + 1))
|
||||
|
||||
self.home_1.just_fyi("Unpin one message and check it's unpinned for another user")
|
||||
self.chat_2.tap_by_coordinates(500, 100)
|
||||
# temp solution until finding solution for distinguish system and not-system messages
|
||||
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)
|
||||
message_element.long_press_element()
|
||||
self.chat_1.element_by_translation_id("unpin-from-chat").click()
|
||||
self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element()
|
||||
if self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed():
|
||||
self.errors.append("Message_4 is not unpinned!")
|
||||
|
||||
for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
|
||||
count = chat.pinned_messages_count.text
|
||||
if count != '2':
|
||||
self.errors.append(
|
||||
"Pinned messages count is not 2 after unpinning the last pinned message for user %s" % (
|
||||
chat_number + 1)
|
||||
)
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702745)
|
||||
@marks.xfail(reason="On profile picture failed due to #14718")
|
||||
@marks.xfail(reason="On profile picture failed due to 14718")
|
||||
def test_1_1_chat_non_latin_messages_stack_update_profile_photo(self):
|
||||
self.home_1.click_system_back_button_until_element_is_shown()
|
||||
self.home_1.browser_tab.click() # temp, until profile is on browser tab
|
||||
|
@ -311,7 +311,6 @@ class TestGroupChatMediumMultipleDeviceNewUI(MultipleSharedDeviceTestCase):
|
||||
"Message 1", "Message 2", "Message 3", "Message 4"
|
||||
|
||||
@marks.testrail_id(702732)
|
||||
@marks.xfail(reason="blocked by #14637")
|
||||
def test_group_chat_pin_messages(self):
|
||||
self.home_1.just_fyi("Enter group chat and pin message there. It's pinned for both members.")
|
||||
|
||||
@ -325,7 +324,7 @@ class TestGroupChatMediumMultipleDeviceNewUI(MultipleSharedDeviceTestCase):
|
||||
self.group_chat_2.chat_element_by_text(self.message_1).long_press_element()
|
||||
if self.group_chat_2.element_by_translation_id("unpin-from-chat").is_element_displayed():
|
||||
self.errors.append("Unpin option is available for non-admin user")
|
||||
self.group_chat_2.click_system_back_button()
|
||||
self.group_chat_2.tap_by_coordinates(500, 100)
|
||||
|
||||
# not implemented yet :
|
||||
|
||||
@ -353,10 +352,8 @@ class TestGroupChatMediumMultipleDeviceNewUI(MultipleSharedDeviceTestCase):
|
||||
self.group_chat_1.send_message(self.message_4)
|
||||
self.group_chat_1.pin_message(self.message_4, 'pin-to-chat')
|
||||
if self.group_chat_1.pin_limit_popover.is_element_displayed(30):
|
||||
self.group_chat_1.view_pinned_messages_button.click_until_presence_of_element(
|
||||
self.group_chat_1.pinned_messages_list)
|
||||
self.group_chat_1.pinned_messages_list.message_element_by_text(
|
||||
self.message_2).click_inside_element_by_coordinate()
|
||||
self.group_chat_1.view_pinned_messages_button.click_until_presence_of_element(self.group_chat_1.pinned_messages_list)
|
||||
self.group_chat_1.pinned_messages_list.message_element_by_text(self.message_2).click_inside_element_by_coordinate()
|
||||
self.group_chat_1.element_by_translation_id('unpin-from-chat').double_click()
|
||||
self.group_chat_1.chat_element_by_text(self.message_4).click()
|
||||
self.group_chat_1.pin_message(self.message_4, 'pin-to-chat')
|
||||
|
@ -615,7 +615,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
self.channel_2 = self.community_2.get_chat(self.channel_name).click()
|
||||
|
||||
@marks.testrail_id(702838)
|
||||
@marks.xfail(reason="blocked by #14797")
|
||||
@marks.xfail(reason="blocked by 14797")
|
||||
def test_community_message_send_check_timestamps_sender_username(self):
|
||||
message = self.text_message
|
||||
sent_time_variants = self.channel_1.convert_device_time_to_chat_timestamp()
|
||||
@ -631,7 +631,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702843)
|
||||
@marks.xfail(reason="blocked by #14797")
|
||||
@marks.xfail(reason="blocked by 14797")
|
||||
def test_community_message_edit(self):
|
||||
message_before_edit, message_after_edit = 'Message BEFORE edit', "Message AFTER edit 2"
|
||||
if not self.channel_2.chat_message_input.is_element_displayed():
|
||||
@ -715,54 +715,64 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
|
||||
channel_1_element.click()
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
# @marks.testrail_id(702844)
|
||||
# @marks.skip("Until preview component will be developed")
|
||||
# def test_community_links_with_previews_github_youtube_twitter_gif_send_enable(self):
|
||||
# giphy_url = 'https://giphy.com/gifs/this-is-fine-QMHoU66sBXqqLqYvGO'
|
||||
# preview_urls = {'github_pr': {'url': 'https://github.com/status-im/status-mobile/pull/11707',
|
||||
# 'txt': 'Update translations by jinhojang6 · Pull Request #11707 · status-im/status-mobile',
|
||||
# 'subtitle': 'GitHub'},
|
||||
# 'yotube': {
|
||||
# 'url': 'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao',
|
||||
# 'txt': 'Status & Keycard – Hardware-Enforced Security',
|
||||
# 'subtitle': 'YouTube'}
|
||||
# # twitter link is temporary removed from check as current xpath locator in message.preview_title is not applicable for this type of links
|
||||
# # 'twitter': {
|
||||
# # 'url': 'https://twitter.com/ethdotorg/status/1445161651771162627?s=20',
|
||||
# # 'txt': "We've rethought how we translate content, allowing us to translate",
|
||||
# # 'subtitle': 'Twitter'
|
||||
# # }
|
||||
# }
|
||||
#
|
||||
# self.home_1.just_fyi("Check enabling and sending first gif")
|
||||
# self.channel_2.send_message(giphy_url)
|
||||
# # workaround to get chat view focused
|
||||
# self.channel_2.send_message(giphy_url)
|
||||
# self.channel_2.element_by_translation_id("dont-ask").click()
|
||||
# # workaround to get chat view focused
|
||||
# self.channel_1.send_message(giphy_url)
|
||||
# self.channel_1.element_by_text("Enable").wait_and_click()
|
||||
#
|
||||
# self.channel_1.element_by_translation_id("enable-all").wait_and_click()
|
||||
# self.channel_1.click_system_back_button()
|
||||
# if not self.channel_1.get_preview_message_by_text(giphy_url).preview_image:
|
||||
# self.errors.append("No preview is shown for %s" % giphy_url)
|
||||
# for key in preview_urls:
|
||||
# self.home_2.just_fyi("Checking %s preview case" % key)
|
||||
# data = preview_urls[key]
|
||||
# self.channel_2.send_message(data['url'])
|
||||
# message = self.channel_1.get_preview_message_by_text(data['url'])
|
||||
# if data['txt'] not in message.preview_title.text:
|
||||
# self.errors.append("Title '%s' does not match expected" % message.preview_title.text)
|
||||
# if message.preview_subtitle.text != data['subtitle']:
|
||||
# self.errors.append("Subtitle '%s' does not match expected" % message.preview_subtitle.text)
|
||||
#
|
||||
# self.home_2.just_fyi("Check if after do not ask again previews are not shown and no enable button appear")
|
||||
# if self.channel_2.element_by_translation_id("enable").is_element_displayed():
|
||||
# self.errors.append("Enable button is still shown after clicking on 'Don't ask again'")
|
||||
# if self.channel_2.get_preview_message_by_text(giphy_url).preview_image:
|
||||
# self.errors.append("Preview is shown for sender without permission")
|
||||
# self.errors.verify_no_errors()
|
||||
@marks.testrail_id(702844)
|
||||
def test_community_links_with_previews_github_youtube_twitter_gif_send_enable(self):
|
||||
giphy_url = 'https://giphy.com/gifs/this-is-fine-QMHoU66sBXqqLqYvGO'
|
||||
preview_urls = {'github_pr': {'url': 'https://github.com/status-im/status-mobile/pull/11707',
|
||||
'txt': 'Update translations by jinhojang6 · Pull Request #11707 · status-im/status-mobile',
|
||||
'subtitle': 'GitHub'},
|
||||
'yotube_short': {
|
||||
'url': 'https://youtu.be/Je7yErjEVt4',
|
||||
'txt': 'Status, your gateway to Ethereum',
|
||||
'subtitle': 'YouTube'}
|
||||
# blocked by 14865
|
||||
# 'yotube_full': {
|
||||
# 'url': 'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao',
|
||||
# 'txt': 'Status & Keycard – Hardware-Enforced Security',
|
||||
# 'subtitle': 'YouTube'}
|
||||
# twitter link is temporary removed from check as current xpath locator in message.preview_title is not applicable for this type of links
|
||||
# 'twitter': {
|
||||
# 'url': 'https://twitter.com/ethdotorg/status/1445161651771162627?s=20',
|
||||
# 'txt': "We've rethought how we translate content, allowing us to translate",
|
||||
# 'subtitle': 'Twitter'
|
||||
# }
|
||||
}
|
||||
|
||||
self.home_1.just_fyi("Check enabling and sending first gif")
|
||||
self.channel_2.send_message(giphy_url)
|
||||
# workaround to get chat view focused
|
||||
self.channel_2.send_message(giphy_url)
|
||||
self.channel_2.element_by_translation_id("dont-ask").click()
|
||||
# workaround to get chat view focused
|
||||
self.channel_1.send_message(giphy_url)
|
||||
self.channel_1.element_by_text("Enable").wait_and_click()
|
||||
|
||||
self.channel_1.element_by_translation_id("enable-all").wait_and_click()
|
||||
self.channel_1.click_system_back_button()
|
||||
if not self.channel_1.get_preview_message_by_text(giphy_url).preview_image:
|
||||
self.errors.append("No preview is shown for %s" % giphy_url)
|
||||
for key in preview_urls:
|
||||
self.home_2.just_fyi("Checking %s preview case" % key)
|
||||
data = preview_urls[key]
|
||||
self.channel_2.send_message(data['url'])
|
||||
message = self.channel_1.get_preview_message_by_text(data['url'])
|
||||
if message.preview_title:
|
||||
if data['txt'] not in message.preview_title.text:
|
||||
self.errors.append("Title '%s' does not match expected" % message.preview_title.text)
|
||||
else:
|
||||
self.drivers[0].fail("No preview is shown!")
|
||||
if message.preview_subtitle:
|
||||
if message.preview_subtitle.text != data['subtitle']:
|
||||
self.errors.append("Subtitle '%s' does not match expected" % message.preview_subtitle.text)
|
||||
else:
|
||||
self.drivers[0].fail("No preview title is shown!")
|
||||
|
||||
self.home_2.just_fyi("Check if after do not ask again previews are not shown and no enable button appear")
|
||||
if self.channel_2.element_by_translation_id("enable").is_element_displayed():
|
||||
self.errors.append("Enable button is still shown after clicking on 'Don't ask again'")
|
||||
if self.channel_2.get_preview_message_by_text(giphy_url).preview_image:
|
||||
self.errors.append("Preview is shown for sender without permission")
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702842)
|
||||
def test_community_mark_all_messages_as_read(self):
|
||||
|
@ -235,7 +235,7 @@ class TestActivityCenterMultipleDevicePR(MultipleSharedDeviceTestCase):
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702851)
|
||||
@marks.xfail(reason='blocked by #14798')
|
||||
@marks.xfail(reason='blocked by 14798')
|
||||
def test_activity_center_mentions_in_community_jump_to(self):
|
||||
self.device_2.just_fyi('Device2 sends a contact request to Device1')
|
||||
self.home_2.browser_tab.click()
|
||||
|
@ -226,7 +226,7 @@ class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleShared
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702287)
|
||||
@marks.xfail(reason="may be failed due to #13333")
|
||||
@marks.xfail(reason="may be failed due to 13333")
|
||||
def test_profile_can_not_connect_to_custom_history_node_add_delete(self):
|
||||
self.home_1.profile_button.double_click()
|
||||
self.home_2.home_button.double_click()
|
||||
|
@ -1037,7 +1037,7 @@ class TestChatManagement(SingleDeviceTestCase):
|
||||
self.driver.fail("Unblocked user not added previously in contact list added in contacts!")
|
||||
|
||||
@marks.testrail_id(5721)
|
||||
@marks.xfail(reason="may be failed due to #14013")
|
||||
@marks.xfail(reason="may be failed due to 14013")
|
||||
def test_group_chat_cant_add_more_twenty_participants(self):
|
||||
user_20_contacts = dict()
|
||||
user_20_contacts[
|
||||
|
@ -400,7 +400,7 @@ class CommunityView(HomeView):
|
||||
class PreviewMessage(ChatElementByText):
|
||||
def __init__(self, driver, text: str):
|
||||
super().__init__(driver, text=text)
|
||||
self.locator += "/android.view.ViewGroup/android.view.ViewGroup"
|
||||
# self.locator += "/android.view.ViewGroup/android.view.ViewGroup"
|
||||
|
||||
@staticmethod
|
||||
def return_element_or_empty(obj):
|
||||
@ -413,7 +413,7 @@ class PreviewMessage(ChatElementByText):
|
||||
def preview_image(self):
|
||||
class PreviewImage(SilentButton):
|
||||
def __init__(self, driver, parent_locator: str):
|
||||
super().__init__(driver, prefix=parent_locator, xpath="/android.widget.ImageView")
|
||||
super().__init__(driver, prefix=parent_locator, xpath="//*[@content-desc='member-photo']")
|
||||
|
||||
return PreviewMessage.return_element_or_empty(PreviewImage(self.driver, self.locator))
|
||||
|
||||
@ -421,7 +421,7 @@ class PreviewMessage(ChatElementByText):
|
||||
def preview_title(self):
|
||||
class PreviewTitle(SilentButton):
|
||||
def __init__(self, driver, parent_locator: str):
|
||||
super().__init__(driver, prefix=parent_locator, xpath="//android.widget.ImageView[@content-desc='member-photo']/following-sibling::android.widget.TextView[1]")
|
||||
super().__init__(driver, prefix=parent_locator, xpath="//*[@content-desc='member-photo']/preceding-sibling::android.widget.TextView[2]")
|
||||
|
||||
return PreviewMessage.return_element_or_empty(PreviewTitle(self.driver, self.locator))
|
||||
|
||||
@ -429,7 +429,7 @@ class PreviewMessage(ChatElementByText):
|
||||
def preview_subtitle(self):
|
||||
class PreviewSubTitle(SilentButton):
|
||||
def __init__(self, driver, parent_locator: str):
|
||||
super().__init__(driver, prefix=parent_locator, xpath="/android.widget.TextView[2]")
|
||||
super().__init__(driver, prefix=parent_locator, xpath="//*[@content-desc='member-photo']/preceding-sibling::android.widget.TextView[3]")
|
||||
|
||||
return PreviewMessage.return_element_or_empty(PreviewSubTitle(self.driver, self.locator))
|
||||
|
||||
@ -744,8 +744,8 @@ class ChatView(BaseView):
|
||||
self.pinned_messages_count = Button(self.driver,
|
||||
xpath="//*[@content-desc='pins-count']//android.widget.TextView")
|
||||
self.pinned_messages_list = PinnedMessagesList(self.driver)
|
||||
self.pin_limit_popover = BaseElement(self.driver, accessibility_id="pin-limit-popover")
|
||||
self.view_pinned_messages_button = Button(self.driver, accessibility_id="view-pinned-messages")
|
||||
self.pin_limit_popover = BaseElement(self.driver, translation_id="pin-limit-reached")
|
||||
self.view_pinned_messages_button = Button(self.driver, accessibility_id="pinned-banner")
|
||||
|
||||
def get_outgoing_transaction(self, account=None, transaction_value=None) -> object:
|
||||
if account is None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user