2018-07-03 12:40:44 +00:00
|
|
|
import pytest
|
2018-08-02 10:11:45 +00:00
|
|
|
from tests import marks, connection_not_secure_text, connection_is_secure_text
|
2018-07-03 12:40:44 +00:00
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.all
|
|
|
|
class TestBrowsing(SingleDeviceTestCase):
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5424)
|
|
|
|
@marks.medium
|
2018-07-03 12:40:44 +00:00
|
|
|
def test_browse_page_with_non_english_text(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
home_view = sign_in.create_user()
|
2019-03-19 12:35:15 +00:00
|
|
|
start_new_chat = home_view.dapp_tab_button.click()
|
2018-11-30 11:42:48 +00:00
|
|
|
browsing_view = start_new_chat.open_url('www.wikipedia.org')
|
2018-07-03 12:40:44 +00:00
|
|
|
wiki_texts = ['Español', '日本語', 'Français', '中文', 'Português']
|
|
|
|
for wiki_text in wiki_texts:
|
|
|
|
browsing_view.find_text_part(wiki_text, 15)
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5465)
|
|
|
|
@marks.medium
|
2018-07-03 12:40:44 +00:00
|
|
|
def test_open_invalid_link(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
home_view = sign_in.create_user()
|
2019-03-19 12:35:15 +00:00
|
|
|
start_new_chat = home_view.dapp_tab_button.click()
|
2018-11-30 11:42:48 +00:00
|
|
|
browsing_view = start_new_chat.open_url('invalid.takoe')
|
2018-07-03 12:40:44 +00:00
|
|
|
browsing_view.find_text_part('Unable to load page')
|
2018-08-01 00:16:33 +00:00
|
|
|
browsing_view.cross_icon.click()
|
2018-07-20 08:27:33 +00:00
|
|
|
if home_view.element_by_text('Browser').is_element_displayed():
|
|
|
|
pytest.fail('Browser entity is shown for an invalid link')
|
2018-07-03 12:40:44 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5430)
|
|
|
|
@marks.medium
|
2018-07-03 12:40:44 +00:00
|
|
|
def test_connection_is_not_secure(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
2018-07-20 08:27:33 +00:00
|
|
|
home_view = sign_in.create_user()
|
2019-03-19 12:35:15 +00:00
|
|
|
start_new_chat = home_view.dapp_tab_button.click()
|
2019-01-15 10:30:16 +00:00
|
|
|
browsing_view = start_new_chat.open_url('http://www.dvwa.co.uk')
|
2018-08-02 10:11:45 +00:00
|
|
|
browsing_view.url_edit_box_lock_icon.click()
|
|
|
|
browsing_view.find_full_text(connection_not_secure_text)
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5402)
|
|
|
|
@marks.high
|
2018-08-02 10:11:45 +00:00
|
|
|
def test_connection_is_secure(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
home_view = sign_in.create_user()
|
2019-03-19 12:35:15 +00:00
|
|
|
start_new_chat = home_view.dapp_tab_button.click()
|
2018-11-30 11:42:48 +00:00
|
|
|
browsing_view = start_new_chat.open_url('https://www.bbc.com')
|
2018-08-02 10:11:45 +00:00
|
|
|
browsing_view.url_edit_box_lock_icon.click()
|
|
|
|
browsing_view.find_full_text(connection_is_secure_text)
|
2018-08-01 00:16:33 +00:00
|
|
|
browsing_view.cross_icon.click()
|
2019-03-21 11:36:09 +00:00
|
|
|
|
|
|
|
start_new_chat.element_by_text('Airswap').click()
|
2018-08-02 10:11:45 +00:00
|
|
|
browsing_view.url_edit_box_lock_icon.click()
|
|
|
|
browsing_view.find_full_text(connection_is_secure_text)
|
2018-07-03 12:40:44 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5390)
|
|
|
|
@marks.high
|
2018-07-03 12:40:44 +00:00
|
|
|
def test_swipe_to_delete_browser_entry(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
home_view = sign_in.create_user()
|
2019-03-19 12:35:15 +00:00
|
|
|
start_new_chat = home_view.dapp_tab_button.click()
|
2018-11-30 11:42:48 +00:00
|
|
|
browsing_view = start_new_chat.open_url('google.com')
|
2018-08-01 00:16:33 +00:00
|
|
|
browsing_view.cross_icon.click()
|
2019-01-09 14:54:58 +00:00
|
|
|
browser_entry = home_view.get_chat_with_user('Google')
|
|
|
|
browser_entry.swipe_and_delete()
|
2018-07-03 12:40:44 +00:00
|
|
|
home_view.relogin()
|
2019-01-09 14:54:58 +00:00
|
|
|
if browser_entry.is_element_present(20):
|
|
|
|
self.driver.fail('The browser entry is present after re-login')
|
2018-07-03 18:50:18 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5320)
|
|
|
|
@marks.critical
|
2018-07-03 18:50:18 +00:00
|
|
|
def test_open_google_com_via_open_dapp(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
home = sign_in_view.create_user()
|
2019-03-13 09:36:51 +00:00
|
|
|
open_dapp_view = home.dapp_tab_button.click()
|
|
|
|
open_dapp_view.open_url('google.com')
|
|
|
|
browsing_view = open_dapp_view.get_base_web_view()
|
2018-11-30 11:42:48 +00:00
|
|
|
browsing_view.element_by_text('Google').wait_for_element(30)
|
2018-07-03 18:50:18 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5321)
|
2018-11-19 12:42:52 +00:00
|
|
|
@marks.skip
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.critical
|
2018-07-03 18:50:18 +00:00
|
|
|
def test_back_forward_buttons_browsing_website(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
home = sign_in.create_user()
|
2019-03-13 09:36:51 +00:00
|
|
|
start_new_chat = home.dapp_tab_button.click()
|
2018-11-30 11:42:48 +00:00
|
|
|
browsing_view = start_new_chat.open_url('www.wikipedia.org')
|
2018-07-03 18:50:18 +00:00
|
|
|
browsing_view.element_by_text_part('Русский', 'button').click()
|
|
|
|
browsing_view.find_text_part('Избранная статья')
|
|
|
|
browsing_view.browser_previous_page_button.click()
|
|
|
|
browsing_view.find_text_part('English', 15)
|
|
|
|
|
|
|
|
browsing_view.browser_next_page_button.click()
|
|
|
|
browsing_view.find_text_part('Избранная статья')
|
|
|
|
browsing_view.back_to_home_button.click()
|
2018-07-22 13:38:01 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5354)
|
|
|
|
@marks.critical
|
2018-07-22 13:38:01 +00:00
|
|
|
def test_refresh_button_browsing_app_webview(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
2018-12-25 15:39:05 +00:00
|
|
|
home_view = sign_in_view.create_user()
|
|
|
|
status_test_dapp = home_view.open_status_test_dapp()
|
2018-07-22 13:38:01 +00:00
|
|
|
status_test_dapp.transactions_button.click()
|
|
|
|
status_test_dapp.find_full_text('Sign message')
|
|
|
|
status_test_dapp.browser_refresh_page_button.click()
|
|
|
|
status_test_dapp.find_full_text('defaultAccount')
|