def test_disable_js(self):
     with TBDriverFixture(TBB_PATH) as driver:
         disable_js(driver)
         driver.load_url_ensure(CHECK_TPO_URL)
         try:
             driver.find_element_by("JavaScript is enabled.",
                                    find_by=By.LINK_TEXT, timeout=5)
             self.fail("JavaScript is not disabled")
         except (NoSuchElementException, TimeoutException):
             pass
 def test_disable_js(self):
     with TBDriverFixture(TBB_PATH) as driver:
         disable_js(driver)
         driver.load_url_ensure(CHECK_TPO_URL)
         try:
             driver.find_element_by("JavaScript is enabled.",
                                    find_by=By.LINK_TEXT,
                                    timeout=5)
             self.fail("JavaScript is not disabled")
         except (NoSuchElementException, TimeoutException):
             pass
    def test_index_and_logout(self, locale, sd_servers_v2):
        # Given a source user accessing the app from their browser
        locale_with_commas = locale.replace("_", "-")
        with SourceAppNagivator.using_tor_browser_web_driver(
            source_app_base_url=sd_servers_v2.source_app_base_url,
            accept_languages=locale_with_commas,
        ) as navigator:

            # And they have disabled JS in their browser
            disable_js(navigator.driver)

            # When they first login, it succeeds
            navigator.source_visits_source_homepage()
            save_screenshot_and_html(navigator.driver, locale, "source-index")

            navigator.source_clicks_submit_documents_on_homepage()
            navigator.source_continues_to_submit_page()

            # And when they logout, it succeeds
            navigator.source_logs_out()
            save_screenshot_and_html(navigator.driver, locale, "source-logout_page")
Exemplo n.º 4
0
 def disable_js_torbrowser_driver(self):
     if hasattr(self, 'torbrowser_driver'):
         disable_js(self.torbrowser_driver)