Esempio n. 1
0
    def test_ssl_disabled_error_page(self):
        with self.marionette.using_context('content'):
            # Open the test page
            self.assertRaises(MarionetteException, self.marionette.navigate,
                              self.url)

            # Wait for the DOM to receive events
            time.sleep(1)

            # Verify "Secure Connection Failed" error page title
            title = self.marionette.find_element(By.CLASS_NAME, 'title-text')
            nss_failure2title = self.browser.localize_entity(
                'nssFailure2.title')
            self.assertEquals(title.get_property('textContent'),
                              nss_failure2title)

            # Verify the error message is correct
            short_description = self.marionette.find_element(
                By.ID, 'errorShortDescText')
            self.assertIn('SSL_ERROR_UNSUPPORTED_VERSION',
                          short_description.get_property('textContent'))

            # Verify that the "Restore" button appears and works
            reset_button = self.marionette.find_element(
                By.ID, 'prefResetButton')
            reset_button.click()

            # With the preferences reset, the page has to load correctly
            el = Wait(self.marionette,
                      timeout=self.marionette.timeout.page_load).until(
                          expected.element_present(By.TAG_NAME, 'h1'))
            self.assertIn('tls-v1-0', el.get_property('innerText'))