Bug 1276175 - Check the new reset prefs button for a disabled SSL error page. r?maja_zf draft
authorHenrik Skupin <mail@hskupin.info>
Fri, 27 May 2016 14:20:58 +0200
changeset 372114 aaee32007483a7615aa6013a40cb7608e754ae27
parent 372105 605b0b7d5feda5382c01e5e504119a5092a4e272
child 522098 e77780fbe72588b37f5787464db2222171a3395a
push id19440
push userbmo:hskupin@gmail.com
push dateFri, 27 May 2016 12:23:57 +0000
reviewersmaja_zf
bugs1276175
milestone49.0a1
Bug 1276175 - Check the new reset prefs button for a disabled SSL error page. r?maja_zf MozReview-Commit-ID: 94VhdJgF9b8 If SSL related preferences have been changed the retry button is no longer shown. Instead you see a button to reset the preferences, and which will reload the page.
testing/firefox-ui/tests/functional/security/test_ssl_disabled_error_page.py
--- a/testing/firefox-ui/tests/functional/security/test_ssl_disabled_error_page.py
+++ b/testing/firefox-ui/tests/functional/security/test_ssl_disabled_error_page.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import time
 
-from marionette_driver import By
+from marionette_driver import By, expected, Wait
 from marionette_driver.errors import MarionetteException
 
 from firefox_ui_harness.testcases import FirefoxTestCase
 
 
 class TestSSLDisabledErrorPage(FirefoxTestCase):
 
     def setUp(self):
@@ -33,17 +33,21 @@ class TestSSLDisabledErrorPage(FirefoxTe
             # 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.get_entity('nssFailure2.title')
             self.assertEquals(title.get_property('textContent'), nss_failure2title)
 
-            # Verify "Try Again" button appears
-            try_again_button = self.marionette.find_element(By.ID, 'errorTryAgain')
-            self.assertTrue(try_again_button.is_displayed())
-
             # 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'))
             self.assertIn('mozqa.com', 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
+            Wait(self.marionette).until(expected.element_present(By.LINK_TEXT,
+                                                                 'http://quality.mozilla.org'))