From 70d6291c57a003897be4d7522050e355b5fac17e Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Thu, 21 Sep 2023 02:05:07 +0300 Subject: [PATCH] e2e: some todos and updates --- .../critical/chats/test_1_1_public_chats.py | 3 +- .../tests/critical/chats/test_group_chat.py | 1 + .../critical/test_public_chat_browsing.py | 51 ++++++++++++------ .../tests/medium/test_activity_center.py | 5 +- test/appium/views/chat_view.py | 2 +- .../discovery_general_channel.png | Bin 1811 -> 1791 bytes test/appium/views/home_view.py | 3 ++ 7 files changed, 43 insertions(+), 22 deletions(-) diff --git a/test/appium/tests/critical/chats/test_1_1_public_chats.py b/test/appium/tests/critical/chats/test_1_1_public_chats.py index b0e435167e..ab9c4ac3c3 100644 --- a/test/appium/tests/critical/chats/test_1_1_public_chats.py +++ b/test/appium/tests/critical/chats/test_1_1_public_chats.py @@ -1365,12 +1365,13 @@ class TestOneToOneChatMultipleSharedDevicesNewUiTwo(MultipleSharedDeviceTestCase "Message 1", "Message 2", "Message 3", "Message 4" @marks.testrail_id(702783) + @marks.xfail(reason="Data delivery issue") def test_1_1_chat_is_shown_message_sent_delivered_from_offline(self): # self.chat_2.jump_to_card_by_text(self.username_1) # self.chat_1.jump_to_card_by_text(self.username_2) self.home_1.just_fyi('Turn on airplane mode and check that offline status is shown on home view') + app_package = self.home_1.driver.current_package for home in self.homes: - app_package = self.home_1.driver.current_package home.toggle_airplane_mode() if not home.chats_tab.is_element_displayed() and not home.chat_floating_screen.is_element_displayed(): home.driver.activate_app(app_package) diff --git a/test/appium/tests/critical/chats/test_group_chat.py b/test/appium/tests/critical/chats/test_group_chat.py index 7b1fb471c1..29f2d1a2c8 100644 --- a/test/appium/tests/critical/chats/test_group_chat.py +++ b/test/appium/tests/critical/chats/test_group_chat.py @@ -402,6 +402,7 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase): self.errors.verify_no_errors() @marks.testrail_id(702808) + @marks.xfail(reason="Data delivery issue") def test_group_chat_offline_pn(self): for i in range(1, 3): self.homes[i].navigate_back_to_home_view() diff --git a/test/appium/tests/critical/test_public_chat_browsing.py b/test/appium/tests/critical/test_public_chat_browsing.py index 5760cb6435..128658e6c8 100644 --- a/test/appium/tests/critical/test_public_chat_browsing.py +++ b/test/appium/tests/critical/test_public_chat_browsing.py @@ -309,7 +309,6 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase): self.drivers, self.loop = create_shared_drivers(1) self.sign_in = SignInView(self.drivers[0]) self.username = 'first user' - self.discovery_community_attributes = "Contributors' test community", 'test anything here', 'Web3', 'Software dev' self.home = self.sign_in.create_user(username=self.username) self.home.communities_tab.click_until_presence_of_element(self.home.plus_community_button) @@ -322,23 +321,41 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase): self.channel = self.community_view.get_channel(self.channel_name).click() @marks.testrail_id(703503) - @marks.xfail(reason="https://github.com/status-im/status-mobile/issues/17175", run=False) + @marks.xfail( + reason="Request to Join Community button color issue: https://github.com/status-im/status-mobile/issues/17295") def test_community_discovery(self): self.home.navigate_back_to_home_view() self.home.communities_tab.click() self.home.discover_communities_button.click() - for text in self.discovery_community_attributes: - if not self.home.element_by_text(text).is_element_displayed(10): - self.errors.append("%s in not in Discovery!" % text) - self.home.element_by_text(self.discovery_community_attributes[0]).click() - element_templates = { - self.community_view.join_button: 'discovery_join_button.png', - self.community_view.get_channel_avatar(): 'discovery_general_channel.png', - } - for element, template in element_templates.items(): - if element.is_element_differs_from_template(template): - element.save_new_screenshot_of_element('%s_different.png' % element.name) - self.errors.append("Element %s is different from expected template %s!" % (element.locator, template)) + self.home.community_card_item.wait_for_visibility_of_element(30) + + if len(self.home.community_card_item.find_elements()) > 1: + contributors_test_community_attributes = "Contributors' test community", 'test anything here', \ + 'Web3', 'Software dev' + for text in contributors_test_community_attributes: + if not self.home.element_by_text(text).is_element_displayed(10): + self.errors.append("'%s' text is not in Discovery!" % text) + self.home.element_by_text(contributors_test_community_attributes[0]).click() + element_templates = { + self.community_view.join_button: 'discovery_join_button.png', + self.community_view.get_channel_avatar(): 'discovery_general_channel.png', + } + for element, template in element_templates.items(): + if element.is_element_differs_from_template(template): + element.save_new_screenshot_of_element('%s_different.png' % template.split('.')[0]) + self.errors.append( + "Element %s is different from expected template %s!" % (element.locator, template)) + self.community_view.navigate_back_to_home_view() + self.home.communities_tab.click() + self.home.discover_communities_button.click() + self.home.community_card_item.wait_for_visibility_of_element(30) + self.home.swipe_up() + + status_ccs_community_attributes = '(old) Status CCs', 'Community for Status CCs', 'Ethereum', \ + 'Software dev', 'Web3' + for text in status_ccs_community_attributes: + if not self.community_view.element_by_text(text).is_element_displayed(10): + self.errors.append("'%s' text is not shown for (old) Status CCs!" % text) self.errors.verify_no_errors() @marks.testrail_id(702846) @@ -839,8 +856,8 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): self.channel_2.send_message_button.click() message = self.channel_1.get_preview_message_by_text(url) message.wait_for_element(60) - # if not message.preview_image: - # self.errors.append("No preview is shown for %s" % link_data['url']) + if not message.preview_image: + self.errors.append("No preview image is shown for %s" % url) shown_title = message.preview_title.text if shown_title != data['title']: self.errors.append("Title is not equal expected for '%s', actual is '%s'" % (url, shown_title)) @@ -1072,7 +1089,7 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase): self.channel_2 = self.community_2.get_channel(self.channel_name).click() @marks.testrail_id(702786) - @marks.xfail(reason="Issue with username in PN, issue #6 in 15500") + @marks.xfail(reason="Issue with username in PN, https://github.com/status-im/status-mobile/issues/17396") def test_community_mentions_push_notification(self): self.home_1.navigate_back_to_home_view() self.device_1.open_notification_bar() diff --git a/test/appium/tests/medium/test_activity_center.py b/test/appium/tests/medium/test_activity_center.py index 0b06f9baac..40651cca99 100644 --- a/test/appium/tests/medium/test_activity_center.py +++ b/test/appium/tests/medium/test_activity_center.py @@ -33,9 +33,8 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC self.home_2.add_a_contact_chat_bottom_sheet_button.click() self.home_2.element_by_translation_id("paste").click() self.home_2.element_by_translation_id("user-found").wait_for_visibility_of_element(10) - # TODO: Blocked by 15500 - # if not self.home_2.element_by_text(self.username_1).is_element_displayed(): - # self.errors.append("Username is not shown on 'Add contact' page after entering valid public key") + if not self.home_2.element_by_text(self.username_1).is_element_displayed(30): + self.errors.append("Username is not shown on 'Add contact' page after entering valid public key") chat = self.home_2.get_chat_view() chat.view_profile_new_contact_button.click_until_presence_of_element(chat.profile_block_contact_button) diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index 735167a764..e8bf478c24 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -517,7 +517,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="//*[@content-desc='member-photo']") + super().__init__(driver, prefix=parent_locator, xpath="//*[@content-desc='thumbnail']") return PreviewMessage.return_element_or_empty(PreviewImage(self.driver, self.locator)) diff --git a/test/appium/views/elements_templates/discovery_general_channel.png b/test/appium/views/elements_templates/discovery_general_channel.png index 81b1aa15bf96c48a4095c3d4c6813539496ef89e..49f435e3eb9eee426e51dba7abf6ec02375a7ae3 100644 GIT binary patch delta 1775 zcmViUp0tq8lWHS{5KgkVvEi;Q(#Yum}yG0FeNZ zkCS-(!S-}I~^v8O?5 z0;Z=I)|a0TQ6wEwAUOe|So{l~7R=73{D_GOkoWn;0)LMuse7K7fMVR|vwXlY62vQeEY?UnVC4tRueEgTe!d`ABaTa7IuXIIjmjmm>0Gy1bDrR zYvD@J(VKArj|DFH=;c))UKO6>n zdx0A_fPeme;Kd8d>p2`iLj$m52hi3=@qCW5zDY56M!`vn`aFWL(G2j0mJpv9KP$wzYuLqi%D53fEDbU@mcEV1b0uCQ$J1&a_ zoHRZzFZ9-zIQlmvj98sPkSpru7^<}Y6Y9e*7(MF5%_*RBystY9*MM>x#x1psjN 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&kE`$rX%lk+s&Nx;-p?HrqhKsr5dVYdme+}cMSbKG{DfN1p5 zTKMw83f#=XCSWleJf$K_Rv{pfP#4CkM*5GYZX&#Z0%pb49pw2i|`l zhK35a3x#0cKIrRHKc?1JG&2%0mGA$5`~d?4&LG8x4X|;e1T_Er6E0kE8e#kQ!>(Ow z$L0580X*o_b2kLLi++SGxa>joH`BmcbKGsC!m9 zFn>+d>R9%wziL(PHYZNN-o5$nF*sOw+EfU=TF1;ek*!^d6CKKereUD#DBB5ITkY$+ zcXPK{zaHLu&#p%zaO#v@SGf@Cx?%#>uC=f4-IKjO9Co&O?l~zIu3mK#(A=zMYyi5B zu2eNQZ6Mj1mLZ=?E1lj_8y-Lkq8_+X4hYP zP2Jc43zj?sJ-fe!mzi^>{)Y2)I)FXe`dT!7H2_9L@;e-quXdmM;4HdeP=+`TRV=Xte&) zV+;d2I$SmV_`q>){Vj%_24oAjZfz%f-f>!&^BsYvCNUK1DNDrV)EpWf$$tpn-`C65 z?q`U_rx_i)!RfEhFgkXFq2UpFy1O!ca!;t{=K5I>HO=)7b#`zVfS&FyUU~5a+S{55 zhl1?b)=ht3F91WAM;v`}6JQu>{qR!I*yy^c_4a$VbTNKEk}0wHH0#!O0x&vu!_gMq2ZB?@IBpKtXtDbI26RU)H!ux z@oDbepWxTuuQ7C4`h-^oU53S5TV*k-g(eg+e5^&Sr@M4I8dS$lI;{@(b6qrSYoC3F3F z=&?-S(j%fipO~Zz_0d!+m6w3=`?ke8mw*rUA9d6}`}D({_bAV;G7M;M7h9o@+0 zAFe7uWij!lCea9$AAC;E%#;(y(SJ-!$$+aVkZ@;~x0w70L2^63Bo002ovPDHLkV1g5CcEA7t diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index e44145fbae..2695de7e1e 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -317,6 +317,9 @@ class HomeView(BaseView): self.driver, xpath="(//*[@content-desc='link-to-profile']/preceding-sibling::*[1]/android.widget.TextView)[1]") + # Discover communities + self.community_card_item = BaseElement(self.driver, accessibility_id="community-card-item") + def wait_for_syncing_complete(self): self.driver.info('Waiting for syncing to complete') while True: