diff --git a/test/appium/support/api/network_api.py b/test/appium/support/api/network_api.py index 04e80e1d40..c0b91ec247 100644 --- a/test/appium/support/api/network_api.py +++ b/test/appium/support/api/network_api.py @@ -67,7 +67,7 @@ class NetworkApi: def wait_for_confirmation_of_transaction(self, address, amount): start_time = time.time() - while round(time.time() - start_time, ndigits=2) < 10: + while round(time.time() - start_time, ndigits=2) < 900: # should be < idleTimeout capability transaction = self.find_transaction_by_unique_amount(address, amount) if int(transaction['confirmations']) > 1: return diff --git a/test/appium/tests/__init__.py b/test/appium/tests/__init__.py index 54cff83c17..da29420ed9 100644 --- a/test/appium/tests/__init__.py +++ b/test/appium/tests/__init__.py @@ -169,3 +169,8 @@ mailserver_address = "enode://531e252ec966b7e83f5538c19bf1cde7381cc7949026a6e499 camera_access_error_text = "To grant the required camera permission, please go to your system settings " \ "and make sure that Status > Camera is selected." + +connection_not_secure_text = "Connection is not secure! " \ + "Do not sign transactions or send personal data on this site." +connection_is_secure_text = "Connection is secure. Make sure you really trust this site " \ + "before signing transactions or entering personal data." diff --git a/test/appium/tests/atomic/chats/test_one_to_one.py b/test/appium/tests/atomic/chats/test_one_to_one.py index 8964d6fd13..4134321da9 100644 --- a/test/appium/tests/atomic/chats/test_one_to_one.py +++ b/test/appium/tests/atomic/chats/test_one_to_one.py @@ -400,6 +400,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): self.verify_no_errors() + @marks.skip @marks.testrail_id(2781) def test_timestamp_in_chats(self): self.create_drivers(2) 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 59dc242ea6..29f7795d5f 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py @@ -1,5 +1,5 @@ import pytest -from tests import marks +from tests import marks, connection_not_secure_text, connection_is_secure_text from tests.base_test_case import SingleDeviceTestCase from views.sign_in_view import SignInView @@ -41,11 +41,30 @@ class TestBrowsing(SingleDeviceTestCase): home_view = sign_in.create_user() start_new_chat = home_view.plus_button.click() start_new_chat.open_d_app_button.click() - start_new_chat.enter_url_editbox.set_value('google.com') + start_new_chat.enter_url_editbox.set_value('www.bbc.com') start_new_chat.confirm() browsing_view = home_view.get_base_web_view() - browsing_view.find_full_text("Connection is not proven secure. Make sure you trust this site before signing " - "transactions or entering personal data.") + browsing_view.url_edit_box_lock_icon.click() + browsing_view.find_full_text(connection_not_secure_text) + + @marks.testrail_id(3814) + def test_connection_is_secure(self): + sign_in = SignInView(self.driver) + home_view = sign_in.create_user() + start_new_chat = home_view.plus_button.click() + start_new_chat.open_d_app_button.click() + start_new_chat.enter_url_editbox.set_value('https://www.bbc.com') + start_new_chat.confirm() + browsing_view = home_view.get_base_web_view() + browsing_view.url_edit_box_lock_icon.click() + browsing_view.find_full_text(connection_is_secure_text) + browsing_view.browser_cross_icon.click() + start_new_chat_view = home_view.plus_button.click() + start_new_chat_view.open_d_app_button.click() + start_new_chat_view.element_by_text('Airswap').click() + start_new_chat_view.open_button.click() + browsing_view.url_edit_box_lock_icon.click() + browsing_view.find_full_text(connection_is_secure_text) @marks.testrail_id(3731) def test_swipe_to_delete_browser_entry(self): diff --git a/test/appium/views/web_views/base_web_view.py b/test/appium/views/web_views/base_web_view.py index f82c299a31..28037562d7 100644 --- a/test/appium/views/web_views/base_web_view.py +++ b/test/appium/views/web_views/base_web_view.py @@ -9,13 +9,6 @@ class ProgressBarIcon(BaseElement): self.locator = self.Locator.xpath_selector("//android.widget.ProgressBar") -class WebLinkEditBox(BaseEditBox): - - def __init__(self, driver): - super(WebLinkEditBox, self).__init__(driver) - self.locator = self.Locator.xpath_selector("//android.widget.EditText") - - class BackToHomeButton(BaseButton): def __init__(self, driver): super(BackToHomeButton, self).__init__(driver) @@ -64,6 +57,14 @@ class BrowserCrossIcon(BaseButton): return HomeView(self.driver) +class URLEditBoxLockIcon(BaseEditBox): + + def __init__(self, driver): + super(URLEditBoxLockIcon, self).__init__(driver) + self.locator = self.Locator.xpath_selector( + "//*[@content-desc='wallet-modal-button']/../preceding-sibling::*[1]//*[@content-desc='icon']") + + class BaseWebView(BaseView): def __init__(self, driver): @@ -72,7 +73,7 @@ class BaseWebView(BaseView): self.progress_bar_icon = ProgressBarIcon(self.driver) - self.web_link_edit_box = WebLinkEditBox(self.driver) + self.url_edit_box_lock_icon = URLEditBoxLockIcon(self.driver) self.back_to_home_button = BackToHomeButton(self.driver) self.browser_previous_page_button = BrowserPreviousPageButton(self.driver) self.browser_next_page_button = BrowserNextPageButton(self.driver)