patch to intermittent issue (Bug 1334996); r?whimboo draft
authorui.aseem_yadav <justaseem51@gmail.com>
Mon, 06 Mar 2017 11:18:53 +0530
changeset 493832 35d8b6b62b0a17feefd3fdc115f4d071d7d4d2be
parent 493537 eb23648534779c110f3a1f2baae1849ae4a9c570
child 496453 2ac4de409b81730471a1ef5c5048bd8a04cc7a5f
push id47858
push userbmo:justaseem51@gmail.com
push dateMon, 06 Mar 2017 05:51:17 +0000
reviewerswhimboo
bugs1334996
milestone54.0a1
patch to intermittent issue (Bug 1334996); r?whimboo MozReview-Commit-ID: 2okXTKuf8b0
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
@@ -86,24 +86,22 @@ class TestSafeBrowsingWarningPages(Puppe
 
         # 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
+
         Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
-            lambda mn: mn.execute_script('return document.readyState == "DOMContentLoaded" ||'
-                                         '       document.readyState == "complete";')
+            lambda mn: True if mn.get_url() == self.browser.get_final_url(url) else False ,
+            message= "The current url did not match with the final url we expected"
         )
 
-        # check that our current url matches the final url we expect
-        self.assertEquals(self.marionette.get_url(), self.browser.get_final_url(url))
-
     def check_ignore_warning_button(self, unsafe_page):
         button = self.marionette.find_element(By.ID, 'ignoreWarningButton')
         button.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))