<commit_before>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)
    @marks.critical
    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():
            self.driver.fail(f'{no_link_found_error_msg} Sign in view!')

        base_web_view = signin_view.privacy_policy_link.click()
        if not base_web_view.policy_summary.is_element_displayed():
            self.errors.append(f'{no_link_open_error_msg} Sign in view!')

        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():
            self.errors.append(f'{no_link_open_error_msg} Profile about view!')

        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():
            self.driver.fail(f'{no_link_found_error_msg} Sign in view!')

        base_web_view = signin_view.privacy_policy_link.click()
        if not base_web_view.policy_summary.is_element_displayed():
            self.errors.append(f'{no_link_open_error_msg} Sign in view!')

        self.verify_no_errors()<commit_msg>fix for python35 string formatting<commit_after>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)
    @marks.critical
    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():
            self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg))

        base_web_view = signin_view.privacy_policy_link.click()
        if not base_web_view.policy_summary.is_element_displayed():
            self.errors.append('{} Sign in view!'.format(no_link_open_error_msg))

        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():
            self.errors.append('{} Profile about view!'.format(no_link_open_error_msg))

        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():
            self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg))

        base_web_view = signin_view.privacy_policy_link.click()
        if not base_web_view.policy_summary.is_element_displayed():
            self.errors.append('{} Sign in view!'.format(no_link_open_error_msg))

        self.verify_no_errors()
{'fraction_non_alphanumeric': 0.0825908981459186, 'fraction_numerical': 0.0024078979051288226, 'mean_word_length': 3.6674157303370785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2643713', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1291, 'n_words': 197}