From b18547c16e85f94f6065b86208665fa000c3c975 Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Fri, 3 Jun 2022 10:38:43 +0200 Subject: [PATCH] e2e: fix failures --- .../tests/critical/chats/test_1_1_public_chats.py | 15 +++++++-------- .../tests/critical/chats/test_group_chat.py | 6 ++---- test/appium/tests/medium/test_browser_profile.py | 12 ++++++------ test/appium/tests/medium/test_chats_m.py | 4 ++-- .../tests/medium/test_pairing_devices_sync_m.py | 1 + 5 files changed, 18 insertions(+), 20 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 b14d8a7742..31f72d5519 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 @@ -705,6 +705,7 @@ class TestContactBlockMigrateKeycardMultipleSharedDevices(MultipleSharedDeviceTe wallet_1 = self.chat_1.wallet_button.click() wallet_1.find_transaction_in_history(amount=amount) + self.home_2.put_app_to_background_and_back() self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], amount, confirmations=3) wallet_1.home_button.click(desired_view='chat') @@ -1110,7 +1111,7 @@ class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase): else: self.errors.append('No PN on mention in public chat! ') self.home_2.click_system_back_button(2) - if self.home_2.element_starts_with_text(self.reciever['ens']).is_element_differs_from_template('ment_new.png'): + if self.home_2.element_starts_with_text(self.reciever['ens']).is_element_differs_from_template('ment_new.png', 2): self.errors.append('Mention is not highlighted!') self.errors.verify_no_errors() @@ -1118,17 +1119,17 @@ class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase): def test_sticker_1_1_public_chat(self): self.home_2.status_in_background_button.click_if_shown() [home.home_button.double_click() for home in (self.home_1, self.home_2)] - (profile_1, profile_2) = (home.profile_button.click() for home in (self.home_1, self.home_2)) - [profile.switch_network() for profile in (profile_1, profile_2)] + profile_2 = self.home_2.profile_button.click() + profile_2.switch_network() - self.home_2.just_fyi('Check that can use purchased stickerpack') + self.home_2.just_fyi('Check that can use purchased stickerpack on Mainnet') self.home_2.get_chat('#%s' % self.pub_chat_name).click() self.chat_2.install_sticker_pack_by_name('Tozemoon') self.chat_2.sticker_icon.click() if not self.chat_2.chat_item.is_element_displayed(): self.errors.append('Cannot use purchased stickers') - self.home_1.just_fyi('Install free sticker pack and use it in 1-1 chat') + self.home_1.just_fyi('Install free sticker pack and use it in 1-1 chat on Ropsten') self.home_1.get_chat(self.ens).click() self.chat_1.install_sticker_pack_by_name('Status Cat') self.chat_1.sticker_icon.click() @@ -1150,9 +1151,7 @@ class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase): self.home_2.home_button.double_click() self.home_2.get_chat(self.sender['username']).click() self.chat_2.chat_item.click() - if not self.chat_2.element_by_text_part('Status Cat').is_element_displayed(): - self.errors.append('Stickerpack is not available for installation after tapping on sticker message') - self.chat_2.element_by_text_part('Free').click() + self.chat_2.element_by_text_part('Free').wait_and_click(40) if self.chat_2.element_by_text_part('Free').is_element_displayed(): self.errors.append('Stickerpack was not installed') diff --git a/test/appium/tests/critical/chats/test_group_chat.py b/test/appium/tests/critical/chats/test_group_chat.py index 8706a36b94..8575ee3d69 100644 --- a/test/appium/tests/critical/chats/test_group_chat.py +++ b/test/appium/tests/critical/chats/test_group_chat.py @@ -143,14 +143,12 @@ class TestGroupChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): self.homes[0].just_fyi("Put admin device to online and check that messages and PNs will be fetched") self.homes[0].toggle_airplane_mode() self.homes[0].connection_offline_icon.wait_for_invisibility_of_element(60) - unread_group = self.homes[0].get_chat(chat_name) - unread_group.new_messages_counter.wait_for_element_text('2', 60) self.homes[0].open_notification_bar() for message in (message_1, message_2): - if not self.homes[0].get_pn(message): + if not self.homes[0].element_by_text(message).is_element_displayed(30): self.errors.append('%s PN was not fetched from offline' % message) self.homes[0].click_system_back_button() - unread_group.click() + self.homes[0].get_chat(chat_name).click() self.homes[0].just_fyi("check that messages are shown for every member") for i in range(3): diff --git a/test/appium/tests/medium/test_browser_profile.py b/test/appium/tests/medium/test_browser_profile.py index 7334c4ce14..c8684b2655 100644 --- a/test/appium/tests/medium/test_browser_profile.py +++ b/test/appium/tests/medium/test_browser_profile.py @@ -95,8 +95,8 @@ class TestBrowserProfileOneDevice(MultipleSharedDeviceTestCase): self.home.just_fyi('Opening url containing ipns name') dapp = self.home.dapp_tab_button.click() web_page = dapp.open_url(ipns_url) - if not dapp.allow_button.is_element_displayed(30): - self.driver.fail('No permission is asked for dapp, so IPNS name is not resolved') + if not dapp.allow_button.is_element_displayed(60): + self.home.driver.fail('No permission is asked for dapp, so IPNS name is not resolved') dapp.allow_button.click() # Switching back to ropsten @@ -129,7 +129,7 @@ class TestBrowserProfileOneDevice(MultipleSharedDeviceTestCase): browsing.allow_button.click() browsing.options_button.click() if not browsing.connected_account_button.is_element_displayed(): - self.driver.fail("Account is not connected") + self.home.driver.fail("Account is not connected") browsing.click_system_back_button() profile = browsing.profile_button.click() profile.privacy_and_security_button.click() @@ -161,7 +161,7 @@ class TestBrowserProfileOneDevice(MultipleSharedDeviceTestCase): browsing.open_chat_from_dapp_button.click() public_chat = browsing.get_chat_view() if not public_chat.element_by_text('#wikipedia-org').is_element_displayed(): - self.driver.fail("No redirect to public chat") + self.home.driver.fail("No redirect to public chat") message = public_chat.get_random_message() public_chat.send_message(message) public_chat.dapp_tab_button.click(desired_element_text=self.wiki_texts[0]) @@ -212,7 +212,7 @@ class TestBrowserProfileOneDevice(MultipleSharedDeviceTestCase): self.home.profile_button.click() profile.contacts_button.click() if not profile.add_new_contact_button.is_element_displayed(): - self.driver.fail('No expected element on contacts view') + self.home.driver.fail('No expected element on contacts view') users = { 'scanning_ens_with_stateofus_domain_deep_link': { @@ -280,8 +280,8 @@ class TestBrowserProfileOneDevice(MultipleSharedDeviceTestCase): @marks.testrail_id(702166) def test_profile_add_custom_network(self): - profile = self.home.profile_button.click() self.home.get_back_to_home_view() + profile = self.home.profile_button.click() profile.add_custom_network() self.sign_in.sign_in() self.home.profile_button.click() diff --git a/test/appium/tests/medium/test_chats_m.py b/test/appium/tests/medium/test_chats_m.py index b0d8d2c281..69e3d7223b 100644 --- a/test/appium/tests/medium/test_chats_m.py +++ b/test/appium/tests/medium/test_chats_m.py @@ -696,7 +696,7 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase): @pytest.mark.xdist_group(name="one_3") @marks.medium -class TestGroupChatMultipleDevice(MultipleSharedDeviceTestCase): +class TestGroupChatMultipleDeviceMediumMerged(MultipleSharedDeviceTestCase): @classmethod def setup_class(cls): cls.drivers, cls.loop = create_shared_drivers(3) @@ -712,10 +712,10 @@ class TestGroupChatMultipleDevice(MultipleSharedDeviceTestCase): for member in (cls.public_keys[1], cls.public_keys[2]): cls.homes[0].add_contact(member) cls.homes[0].home_button.click() + [SignInView(cls.drivers[i]).put_app_to_background_and_back() for i in range(1, 3)] cls.chat_name = cls.homes[0].get_random_chat_name() cls.invite_chat_name = '%s_invite' % cls.homes[0].get_random_chat_name() cls.chats[0] = cls.homes[0].create_group_chat([], cls.invite_chat_name) - [SignInView(cls.drivers[i]).put_app_to_background_and_back() for i in range(1, 3)] cls.link = cls.chats[0].get_group_invite_via_group_info() cls.chats[0].home_button.double_click() diff --git a/test/appium/tests/medium/test_pairing_devices_sync_m.py b/test/appium/tests/medium/test_pairing_devices_sync_m.py index 75f77773d6..bfb592b632 100644 --- a/test/appium/tests/medium/test_pairing_devices_sync_m.py +++ b/test/appium/tests/medium/test_pairing_devices_sync_m.py @@ -36,6 +36,7 @@ class TestPairingSyncMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase): cls.channel_before_1 = cls.comm_before_1.add_channel(cls.channel) cls.channel_before_1.send_message(cls.message) cls.home_1.home_button.double_click() + cls.device_3.put_app_to_background_and_back() cls.device_1.just_fyi('Edit profile picture') cls.home_1.profile_button.double_click()