From 734abc221cae85a214cb71bea580f6492bb73818 Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Tue, 26 Dec 2023 13:52:10 +0200 Subject: [PATCH] e2e: tests fixes --- .../activity_center/test_activity_center.py | 20 ++++++++++++++----- .../critical/chats/test_1_1_public_chats.py | 6 +++--- .../chats/test_public_chat_browsing.py | 6 ++++-- test/appium/views/chat_view.py | 2 +- test/appium/views/dbs/waku_backup/user.py | 4 ++-- test/appium/views/sign_in_view.py | 19 +++++------------- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/test/appium/tests/activity_center/test_activity_center.py b/test/appium/tests/activity_center/test_activity_center.py index 21d792644d..9b0a604468 100644 --- a/test/appium/tests/activity_center/test_activity_center.py +++ b/test/appium/tests/activity_center/test_activity_center.py @@ -92,8 +92,6 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC @marks.testrail_id(702851) def test_activity_center_contact_request_accept_swipe_mark_all_as_read(self): self.device_2.just_fyi('Creating a new user on Device2') - # self.home_2.navigate_back_to_home_view() - # self.home_2.profile_button.click() self.home_2.reopen_app(sign_in=False) new_username = "new user" self.device_2.create_user(username=new_username, first_user=False) @@ -153,10 +151,22 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC self.username_2, self.profile_link_2, decoded_username)) public_key_2 = self.profile_link_2.split("#")[-1] - self.home_1.just_fyi("Device 1 creates a new user") - self.profile_1.driver.reset() new_username_1 = "test user 123" - self.device_1.create_user(username=new_username_1) + + def _device_1_creates_user(): + self.home_1.just_fyi("Device 1 creates a new user") + self.profile_1.driver.reset() + self.device_1.create_user(username=new_username_1) + + def _device_2_sign_in(): + self.home_2.just_fyi("Device 2 sign in, user name is " + self.username_2) + self.home_2.reopen_app(sign_in=False) + self.device_2.show_profiles_button.wait_and_click() + self.device_2.get_user(username=self.username_2).click() + self.device_2.sign_in() + + self.loop.run_until_complete(run_in_parallel(((_device_1_creates_user, {}), + (_device_2_sign_in, {})))) self.device_1.just_fyi('Device1 sends a contact request to Device2 using his profile link') self.home_1.chats_tab.click() 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 658ec56f60..071a1531df 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 @@ -282,7 +282,7 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): messages = ['hello', '¿Cómo estás tu año?', 'ё, доброго вечерочка', '® æ ç ♥'] for message in messages: self.chat_2.send_message(message) - if not self.chat_1.chat_element_by_text(message).is_element_displayed(10): + if not self.chat_1.chat_element_by_text(message).is_element_displayed(30): self.errors.append("Message with text '%s' was not received" % message) self.chat_2.just_fyi("Checking updated member photo, timestamp and username on message") @@ -348,9 +348,9 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): chat_2.send_message(emoji.emojize(emoji_message)) self.device_1.just_fyi("Device 1 checks PN with emoji") - if not self.device_1.element_by_text_part(emoji_unicode).is_element_displayed(60): + if not self.device_1.element_by_text_part(emoji_unicode).is_element_displayed(120): self.device_1.click_system_back_button() - self.device_2.driver.activate_app(app_package) + self.device_1.driver.activate_app(app_package) self.device_1.driver.fail("Push notification with emoji was not received") chat_1 = self.device_1.click_upon_push_notification_by_text(emoji_unicode) diff --git a/test/appium/tests/critical/chats/test_public_chat_browsing.py b/test/appium/tests/critical/chats/test_public_chat_browsing.py index 5cb48a2a30..41ac72edae 100644 --- a/test/appium/tests/critical/chats/test_public_chat_browsing.py +++ b/test/appium/tests/critical/chats/test_public_chat_browsing.py @@ -682,6 +682,8 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): profile_1 = self.home_1.get_profile_view() self.home_1.navigate_back_to_home_view() self.chat_1.profile_button.click() + profile_1.logout_button.scroll_to_element() + profile_1.profile_legacy_button.click() profile_1.contacts_button.wait_and_click() profile_1.blocked_users_button.wait_and_click() profile_1.element_by_text(self.username_2).click() @@ -773,8 +775,8 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): self.community_1.get_channel(self.channel_name).click() self.channel_1.just_fyi("Receiver is checking if initial messages were delivered") for message in message_to_edit, message_to_delete: - if not self.channel_2.chat_element_by_text(message).is_element_displayed(30): - self.channel_2.driver.fail("Message '%s' was not received") + if not self.channel_1.chat_element_by_text(message).is_element_displayed(30): + self.channel_1.driver.fail("Message '%s' was not received") self.channel_2.just_fyi("Turning on airplane mode and editing/deleting messages") self.channel_2.driver.set_network_connection(ConnectionType.AIRPLANE_MODE) diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index 9c06a6beca..a4008bd6a5 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -1083,7 +1083,7 @@ class ChatView(BaseView): self.driver.info("Adding one more '%s' reaction or removing an added one" % emoji) key = emojis[emoji] element = Button(self.driver, accessibility_id='emoji-reaction-%s' % key) - element.click() + element.wait_and_click() def view_profile_long_press(self, message=str): self.chat_element_by_text(message).long_press_element() diff --git a/test/appium/views/dbs/waku_backup/user.py b/test/appium/views/dbs/waku_backup/user.py index 3ef4f2ae71..5c6d8bc09f 100644 --- a/test/appium/views/dbs/waku_backup/user.py +++ b/test/appium/views/dbs/waku_backup/user.py @@ -1,7 +1,7 @@ seed = 'staff actress trash route grab crime leaf uniform dizzy reform issue keep' display_name = 'End to end' communities = { - 'admin_open': 'Open-comm-adm', + 'admin_open': 'open community', 'member_open': 'e2e_open', 'admin_closed': 'closed community', 'member_closed': 'test_comm_enc', @@ -10,5 +10,5 @@ communities = { # contacts = ['Test_contact', 'MyCustomNickname'] # enable back when https://github.com/status-im/status-mobile/issues/15500 is fixed -contacts = ['zQ3...pJN5P', 'zQ3...UxXqE'] +contacts = ['zQ3...dWXh5', 'zQ3...Vacac'] blocked_user = 'Clear Flat Milkweedbug' diff --git a/test/appium/views/sign_in_view.py b/test/appium/views/sign_in_view.py index e18bf5208a..6b30674e9e 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -285,20 +285,11 @@ class SignInView(BaseView): self.driver.info("## Multiaccount is recovered successfully!", device=False) return self.get_home_view() - def sign_in(self, password=common_password, keycard=False, position=1): - self.driver.info("## Sign in (password:%s, keycard:%s)" % (password, str(keycard)), device=False) - - if keycard: - from views.keycard_view import KeycardView - keycard_view = KeycardView(self.driver) - keycard_view.one_button.wait_for_visibility_of_element(10) - keycard_view.enter_default_pin() - if keycard_view.connect_selected_card_button.is_element_displayed(): - keycard_view.connect_selected_card_button.click() - else: - self.password_input.wait_for_visibility_of_element(10) - self.password_input.send_keys(password) - self.login_button.click() + def sign_in(self, password=common_password): + self.driver.info("## Sign in (password: %s)" % password, device=False) + self.password_input.wait_for_visibility_of_element(10) + self.password_input.send_keys(password) + self.login_button.click() self.driver.info("## Signed in successfully!", device=False) return self.get_home_view()