2018-09-05 19:50:48 +00:00
|
|
|
from tests import marks
|
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
|
|
|
class TestLinksVerifications(SingleDeviceTestCase):
|
|
|
|
|
|
|
|
@marks.testrail_id(5453)
|
2018-10-26 13:32:05 +00:00
|
|
|
@marks.medium
|
2018-09-05 19:50:48 +00:00
|
|
|
def test_privacy_policy_is_accessible(self):
|
|
|
|
signin_view = SignInView(self.driver)
|
|
|
|
no_link_found_error_msg = 'Could not find privacy policy link at'
|
|
|
|
no_link_open_error_msg = 'Could not open our privacy policy from'
|
|
|
|
|
|
|
|
if not signin_view.privacy_policy_link.is_element_displayed():
|
2018-10-04 15:56:39 +00:00
|
|
|
self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg))
|
2018-09-05 19:50:48 +00:00
|
|
|
|
|
|
|
base_web_view = signin_view.privacy_policy_link.click()
|
2018-10-08 13:10:00 +00:00
|
|
|
base_web_view.open_in_webview()
|
2018-09-05 19:50:48 +00:00
|
|
|
if not base_web_view.policy_summary.is_element_displayed():
|
2018-10-04 15:56:39 +00:00
|
|
|
self.errors.append('{} Sign in view!'.format(no_link_open_error_msg))
|
2018-09-05 19:50:48 +00:00
|
|
|
|
|
|
|
base_web_view.click_system_back_button()
|
|
|
|
signin_view = SignInView(self.driver)
|
|
|
|
home_view = signin_view.create_user()
|
|
|
|
profile = home_view.profile_button.click()
|
|
|
|
about_view = profile.about_button.click()
|
|
|
|
base_web_view = about_view.privacy_policy_button.click()
|
|
|
|
|
|
|
|
if not base_web_view.policy_summary.is_element_displayed():
|
2018-10-04 15:56:39 +00:00
|
|
|
self.errors.append('{} Profile about view!'.format(no_link_open_error_msg))
|
2018-09-05 19:50:48 +00:00
|
|
|
|
|
|
|
base_web_view.click_system_back_button()
|
|
|
|
if about_view.privacy_policy_button.is_element_displayed():
|
|
|
|
base_web_view.click_system_back_button()
|
|
|
|
signin_view = profile.logout()
|
|
|
|
if signin_view.ok_button.is_element_displayed():
|
|
|
|
signin_view.ok_button.click()
|
|
|
|
signin_view.other_accounts_button.click()
|
|
|
|
|
|
|
|
if not signin_view.privacy_policy_link.is_element_displayed():
|
2018-10-04 15:56:39 +00:00
|
|
|
self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg))
|
2018-09-05 19:50:48 +00:00
|
|
|
|
|
|
|
base_web_view = signin_view.privacy_policy_link.click()
|
|
|
|
if not base_web_view.policy_summary.is_element_displayed():
|
2018-10-04 15:56:39 +00:00
|
|
|
self.errors.append('{} Sign in view!'.format(no_link_open_error_msg))
|
2018-09-05 19:50:48 +00:00
|
|
|
|
|
|
|
self.verify_no_errors()
|