@@ -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 ):
0 commit comments