Added connection secure and updated connection not secure tests

Signed-off-by: yevh-berdnyk <ie.berdnyk@gmail.com>
This commit is contained in:
yevh-berdnyk 2018-08-02 12:11:45 +02:00
parent 6dd4064b70
commit eaa4ef985b
No known key found for this signature in database
GPG Key ID: E9B425FDFC4DEA9C
5 changed files with 39 additions and 13 deletions

View File

@ -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

View File

@ -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."

View File

@ -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)

View File

@ -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):

View File

@ -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)