From cfefc2d734c4f20f6777b63e9689834b2c43fa2b Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Tue, 13 Jun 2023 19:54:39 +0300 Subject: [PATCH] e2e: fixes --- test/appium/support/testrail_report.py | 1 - .../critical/chats/test_1_1_public_chats.py | 9 +++++---- .../critical/test_public_chat_browsing.py | 18 +++++++++++------- .../tests/medium/test_activity_center.py | 9 +++++++-- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/test/appium/support/testrail_report.py b/test/appium/support/testrail_report.py index f10a38d690..7a424e64d1 100644 --- a/test/appium/support/testrail_report.py +++ b/test/appium/support/testrail_report.py @@ -210,7 +210,6 @@ class TestrailReport(BaseTestReport): 'status_id': self.outcomes['undefined_fail'] if last_testrun.error else self.outcomes['passed'], 'comment': comment}) - print("RESULTS:\n%s" % "\n".join(str(i) for i in data)) results = self.post('add_results_for_cases/%s' % self.run_id, data={"results": data}) try: results[0] 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 b3f06a5b3f..6020ce9bff 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 @@ -1127,8 +1127,8 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): self.errors.append("PN are keep staying after message was seen by user") self.errors.verify_no_errors() - @marks.xfail( - reason="Message is being in status 'Sending' for a long time: https://github.com/status-im/status-mobile/issues/15385") + @marks.xfail(reason="Message is being in status 'Sending' for a long time: " \ + "https://github.com/status-im/status-mobile/issues/15385") @marks.testrail_id(702855) def test_1_1_chat_edit_message(self): [home.click_system_back_button_until_element_is_shown() for home in self.homes] @@ -1146,6 +1146,8 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): self.errors.append('No edited message in 1-1 chat displayed') self.errors.verify_no_errors() + @marks.xfail(reason="Message is being in status 'Sending' for a long time: " \ + "https://github.com/status-im/status-mobile/issues/15385") @marks.testrail_id(702733) def test_1_1_chat_text_message_delete_push_disappear(self): if not self.chat_2.chat_message_input.is_element_displayed(): @@ -1172,8 +1174,7 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): self.chat_2.chat_element_by_text(message_to_delete_for_me).wait_for_status_to_be("Delivered", timeout) self.chat_2.delete_message_in_chat(message_to_delete_for_me, everyone=False) except TimeoutException: - self.errors.append( - "Message status was not changed to 'Delivered' after %s s, https://github.com/status-im/status-mobile/issues/15385" % timeout) + self.errors.append("Message status was not changed to 'Delivered' after %s s" % timeout) else: if not self.chat_2.chat_element_by_text(message_to_delete_for_me).is_element_disappeared(20): self.errors.append("Deleted for me message is shown in chat for the author of message") diff --git a/test/appium/tests/critical/test_public_chat_browsing.py b/test/appium/tests/critical/test_public_chat_browsing.py index def86220d6..8cccb186b4 100644 --- a/test/appium/tests/critical/test_public_chat_browsing.py +++ b/test/appium/tests/critical/test_public_chat_browsing.py @@ -683,7 +683,9 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): @marks.testrail_id(702894) def test_community_contact_block_unblock_offline(self): - [home.jump_to_card_by_text('# %s' % self.channel_name) for home in self.homes] + for channel in self.channel_1, self.channel_2: + if not channel.chat_message_input.is_element_displayed(): + channel.jump_to_card_by_text('# %s' % self.channel_name) self.channel_1.send_message('message to get avatar of user 2 visible in next message') self.channel_2.just_fyi("Sending message before block") @@ -697,7 +699,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): chat_element.member_photo.click() self.channel_1.block_contact() - self.chat_1.just_fyi('messages from blocked user are hidden in public chat and close app') + self.chat_1.just_fyi('Check that messages from blocked user are hidden in public chat and close app') if self.chat_1.chat_element_by_text(message_to_disappear).is_element_displayed(): self.errors.append("Messages from blocked user is not cleared in public chat ") self.chat_1.jump_to_messages_home() @@ -705,11 +707,11 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): self.errors.append("1-1 chat from blocked user is not removed!") self.chat_1.toggle_airplane_mode() - self.home_2.just_fyi('send message to public chat while device 1 is offline') + self.home_2.just_fyi('Send message to public chat while device 1 is offline') message_blocked, message_unblocked = "Message from blocked user", "Hurray! unblocked" self.channel_2.send_message(message_blocked) - self.chat_1.just_fyi('check that new messages from blocked user are not delivered') + self.chat_1.just_fyi('Check that new messages from blocked user are not delivered') self.chat_1.toggle_airplane_mode() self.home_1.jump_to_card_by_text('# %s' % self.channel_name) for message in message_to_disappear, message_blocked: @@ -717,7 +719,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): self.errors.append( "'%s' from blocked user is fetched from offline in community channel" % message) - self.chat_2.just_fyi('Unblock user and check that can see further messages') + self.chat_1.just_fyi('Unblock user and check that can see further messages') # TODO: still no blocked users in new UI profile_1 = self.home_1.get_profile_view() self.home_1.jump_to_messages_home() @@ -735,14 +737,16 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): if not self.chat_1.chat_element_by_text(message_unblocked).is_element_displayed(120): self.errors.append("Message was not received in public chat after user unblock!") - self.home_2.just_fyi("Add blocked user to contacts again after removing(removed automatically when blocked)") + self.home_1.just_fyi("Add blocked user to contacts again after removing(removed automatically when blocked)") chat_element = self.channel_1.chat_element_by_text(message_unblocked) chat_element.find_element() chat_element.member_photo.click() self.channel_1.profile_add_to_contacts_button.click() + self.home_2.just_fyi("Accept contact request after being unblocked") self.home_2.jump_to_messages_home() self.home_2.handle_contact_request(self.username_1) - self.channel_1.profile_send_message_button.wait_and_click() + self.channel_1.profile_send_message_button.click_until_absense_of_element( + desired_element=self.channel_1.profile_send_message_button) self.chat_1.send_message("piy") self.home_2.just_fyi("Check message in 1-1 chat after unblock") diff --git a/test/appium/tests/medium/test_activity_center.py b/test/appium/tests/medium/test_activity_center.py index cf0a5199c5..84e5670f30 100644 --- a/test/appium/tests/medium/test_activity_center.py +++ b/test/appium/tests/medium/test_activity_center.py @@ -251,8 +251,12 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase): @marks.testrail_id(702957) def test_activity_center_mentions(self): + if not self.channel_2.chat_message_input.is_element_displayed(): + self.home_2.click_system_back_button_until_element_is_shown() + self.home_2.communities_tab.click() + self.home_2.get_chat(self.community_name, community=True).click() + self.community_2.get_channel(self.channel_name).click() self.home_1.jump_to_communities_home() - self.home_2.jump_to_card_by_text('# %s' % self.channel_name) self.device_2.just_fyi("Invited member sends a message with a mention") self.channel_2.mention_user(self.username_1) @@ -286,7 +290,8 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase): @marks.testrail_id(702958) def test_activity_center_admin_notification_accept_swipe(self): self.home_2.just_fyi("Clearing history") - self.home_2.jump_to_messages_home() + self.home_2.click_system_back_button_until_element_is_shown() + self.home_2.chats_tab.click() self.home_2.clear_chat_long_press(self.username_1) [home.jump_to_communities_home() for home in (self.home_1, self.home_2)]