Bug 1400992 - Fix test_safe_browsing_warning_pages.py. r?whimboo draft
authorPrathiksha <prathikshaprasadsuman@gmail.com>
Tue, 19 Sep 2017 18:42:55 +0530
changeset 667002 07a4741a3c8e837c5a782adbcb805c246871258a
parent 666884 e4261f5b96ebfd63e7cb8af3035ff9fea90c74a5
child 732270 402ebd2a9e9189f547060f6df633961c6f4c50cf
push id80585
push userbmo:prathikshaprasadsuman@gmail.com
push dateTue, 19 Sep 2017 14:42:44 +0000
reviewerswhimboo
bugs1400992
milestone57.0a1
Bug 1400992 - Fix test_safe_browsing_warning_pages.py. r?whimboo MozReview-Commit-ID: EIf2ak8Q2YJ
testing/firefox-ui/tests/functional/security/test_safe_browsing_warning_pages.py
--- a/testing/firefox-ui/tests/functional/security/test_safe_browsing_warning_pages.py
+++ b/testing/firefox-ui/tests/functional/security/test_safe_browsing_warning_pages.py
@@ -55,42 +55,44 @@ class TestSafeBrowsingWarningPages(Puppe
                 # Wait for the DOM to receive events for about:blocked
                 time.sleep(1)
                 self.check_get_me_out_of_here_button(unsafe_page)
 
                 # Load the test page again, then test the report button
                 self.marionette.navigate(unsafe_page)
                 # Wait for the DOM to receive events for about:blocked
                 time.sleep(1)
-                self.check_report_button(unsafe_page)
+                self.check_report_link(unsafe_page)
 
                 # Load the test page again, then test the ignore warning button
                 self.marionette.navigate(unsafe_page)
                 # Wait for the DOM to receive events for about:blocked
                 time.sleep(1)
                 self.check_ignore_warning_button(unsafe_page)
 
     def check_get_me_out_of_here_button(self, unsafe_page):
-        button = self.marionette.find_element(By.ID, "getMeOutButton")
+        button = self.marionette.find_element(By.ID, "goBackButton")
         button.click()
 
         Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
             lambda mn: self.browser.default_homepage in mn.get_url())
 
-    def check_report_button(self, unsafe_page):
+    def check_report_link(self, unsafe_page):
         # Get the URL of the support site for phishing and malware. This may result in a redirect.
         with self.marionette.using_context('chrome'):
             url = self.marionette.execute_script("""
               Components.utils.import("resource://gre/modules/Services.jsm");
               return Services.urlFormatter.formatURLPref("app.support.baseURL")
                                                          + "phishing-malware";
             """)
 
-        button = self.marionette.find_element(By.ID, "reportButton")
+        button = self.marionette.find_element(By.ID, 'seeDetailsButton')
         button.click()
+        link = self.marionette.find_element(By.ID, "firefox_support")
+        link.click()
 
         # Wait for the button to become stale, whereby a longer timeout is needed
         # here to not fail in case of slow connections.
         Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
             expected.element_stale(button))
 
         # Wait for page load to be completed, so we can verify the URL even if a redirect happens.
         # TODO: Bug 1140470: use replacement for mozmill's waitforPageLoad
@@ -99,17 +101,19 @@ class TestSafeBrowsingWarningPages(Puppe
             lambda mn: expected_url == mn.get_url(),
             message="The expected URL '{}' has not been loaded".format(expected_url)
         )
 
         topic = self.marionette.find_element(By.ID, "topic")
         self.assertEquals(topic.text, "phishing-malware")
 
     def check_ignore_warning_button(self, unsafe_page):
-        button = self.marionette.find_element(By.ID, 'ignoreWarningButton')
+        button = self.marionette.find_element(By.ID, 'seeDetailsButton')
         button.click()
+        link = self.marionette.find_element(By.ID, 'ignore_warning_link')
+        link.click()
 
         Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
             expected.element_present(By.ID, 'main-feature'))
         self.assertEquals(self.marionette.get_url(), self.browser.get_final_url(unsafe_page))
 
         # Clean up by removing safe browsing permission for unsafe page
         self.puppeteer.utils.permissions.remove('https://www.itisatrap.org', 'safe-browsing')