From 2f446a73bb1ef1007ff0f1a214918120cc85544e Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Thu, 19 Mar 2020 17:34:20 +0100 Subject: [PATCH] fix e2e + disable e2e deep links Signed-off-by: Churikova Tetiana --- .../atomic/account_management/test_profile.py | 2 +- .../tests/atomic/chats/test_chats_management.py | 15 +++++++-------- .../atomic/dapps_and_browsing/test_browsing.py | 1 + .../atomic/dapps_and_browsing/test_deep_links.py | 2 ++ test/appium/views/base_view.py | 2 +- test/appium/views/home_view.py | 11 +++++++++++ 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index d2f836d8af..6d33c1594e 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -314,7 +314,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase): home.invite_friends_button.click() home.share_via_messenger() home.find_text_part("Get Status at http://status.im") - home.click_system_back_button(2) + home.click_system_back_button() home.plus_button.click() home.chats_menu_invite_friends_button.click() home.share_via_messenger() diff --git a/test/appium/tests/atomic/chats/test_chats_management.py b/test/appium/tests/atomic/chats/test_chats_management.py index 453240012b..e0b761a7bf 100644 --- a/test/appium/tests/atomic/chats/test_chats_management.py +++ b/test/appium/tests/atomic/chats/test_chats_management.py @@ -16,7 +16,7 @@ class TestChatManagement(SingleDeviceTestCase): home = sign_in.create_user() chat = home.add_contact(basic_user['public_key']) - one_to_one, public, group = basic_user['username'], '#public', 'group' + one_to_one, public, group = basic_user['username'], '#public-clear-options', 'group' message = 'test message' chat.get_back_to_home_view() @@ -56,7 +56,7 @@ class TestChatManagement(SingleDeviceTestCase): home = sign_in.create_user() chat = home.add_contact(basic_user['public_key']) - one_to_one, public, group = basic_user['username'], '#public', 'group' + one_to_one, public, group = basic_user['username'], '#public-clear-long-press', 'group' message = 'test message' chat.get_back_to_home_view() @@ -95,7 +95,7 @@ class TestChatManagement(SingleDeviceTestCase): home = sign_in.create_user() chat = home.add_contact(basic_user['public_key']) - one_to_one, public, group = basic_user['username'], '#public', 'group' + one_to_one, public, group = basic_user['username'], '#public-delete-long-press', 'group' chat.get_back_to_home_view() home.create_group_chat([basic_user['username']], group) @@ -147,7 +147,7 @@ class TestChatManagement(SingleDeviceTestCase): home = sign_in.create_user() chat = home.add_contact(basic_user['public_key']) - one_to_one, public, group = basic_user['username'], '#public', 'group' + one_to_one, public, group = basic_user['username'], '#public-delete-options', 'group' chat.get_back_to_home_view() home.create_group_chat([basic_user['username']], group) @@ -363,16 +363,15 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase): # TODO: next line is added temporary to avoid navigation issue #7437 - should be deleted after fix home_1.profile_button.click() if profile_1.element_by_text(username).is_element_displayed(): - profile_1.driver.fail('List of contacts in profile contains removed user') + self.errors.append('List of contacts in profile contains removed user') profile_1.home_button.click() if not chat_1.add_to_contacts.is_element_displayed(): self.errors.append('"Add to contacts" button is not shown in 1-1 after removing user from contacts') home_1.get_back_to_home_view() home_1.plus_button.click() home_1.start_new_chat_button.click() - if home_1.element_by_text(username).is_element_displayed(): - home_1.driver.fail('List of contacts below "Start new chat" contains removed user') - + if home_1.get_username_below_start_new_chat_button(username).is_element_displayed(): + self.errors.append('List of contacts below "Start new chat" contains removed user') self.errors.verify_no_errors() @marks.testrail_id(5786) diff --git a/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py b/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py index 1647e02ee3..6a8c1a5908 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py @@ -140,6 +140,7 @@ class TestBrowsing(SingleDeviceTestCase): home = sign_in.create_user() daap_view = home.dapp_tab_button.click() browsing_view = daap_view.open_url('dap.ps') + browsing_view.wait_for_element_starts_with_text('View all', 30) browsing_view.element_by_text_part('View all', 'button').click() if browsing_view.element_by_text_part('View all').is_element_displayed(20): self.driver.fail("Failed to access Categories using ''View all'") diff --git a/test/appium/tests/atomic/dapps_and_browsing/test_deep_links.py b/test/appium/tests/atomic/dapps_and_browsing/test_deep_links.py index 2bcc4cde4f..17e50ad6ba 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_deep_links.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_deep_links.py @@ -10,6 +10,8 @@ class TestDeepLinks(SingleDeviceTestCase): @marks.testrail_id(5396) @marks.high + @marks.skip + # TODO: skipped because universal links won't work in emulators regardless of OS version def test_open_public_chat_using_deep_link(self): sign_in_view = SignInView(self.driver) sign_in_view.create_user() diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index e97176642a..01e47107a2 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -676,7 +676,7 @@ class BaseView(object): def open_universal_web_link(self, deep_link): start_web_browser(self.driver) - self.search_in_google_edit_box.send_keys(deep_link) + self.search_in_google_edit_box.set_value(deep_link) self.confirm() self.open_in_status_button.click() diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index 6585130c69..7e49a3a56b 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -69,6 +69,12 @@ class ChatsMenuInviteFriendsButton(BaseButton): super(ChatsMenuInviteFriendsButton, self).__init__(driver) self.locator = self.Locator.accessibility_id('chats-menu-invite-friends-button') +class UserNameBelowNewChatButton(BaseButton): + def __init__(self, driver, username_part): + super(UserNameBelowNewChatButton, self).__init__(driver) + self.username = username_part + self.locator = self.Locator.xpath_selector( + "//*[@content-desc='enter-contact-code-input']/../..//*[starts-with(@text,'%s')]" % self.username) class ChatElement(BaseButton): def __init__(self, driver, username_part): @@ -179,6 +185,11 @@ class HomeView(BaseView): def get_chat(self, username): return ChatElement(self.driver, username[:25]) + def get_username_below_start_new_chat_button(self, username_part): + return UserNameBelowNewChatButton(self.driver, username_part) + + + def add_contact(self, public_key, add_in_contacts=True): self.plus_button.click_until_presence_of_element(self.start_new_chat_button) contacts_view = self.start_new_chat_button.click()