Bug 1334996 - Click on Safebrowsing report button has to wait for the final URL. r=whimboo
authorui.aseem_yadav <justaseem51@gmail.com>
Tue, 28 Mar 2017 15:37:03 +0530
changeset 400535 01c965ef7036b5656731360df6521464f1a10610
parent 400534 329a623e556de02980568ee142cba65048a77370
child 400536 3a10b2084b4ab498885bd3ed7fd08973943b1bdc
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1334996
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1334996 - Click on Safebrowsing report button has to wait for the final URL. r=whimboo MozReview-Commit-ID: AlYvuOGxr5E
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
+        expected_url = self.browser.get_final_url(url)
         Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
-            lambda mn: mn.execute_script('return document.readyState == "DOMContentLoaded" ||'
-                                         '       document.readyState == "complete";')
+            lambda mn: expected_url == mn.get_url(),
+            message="The expected URL '{}' has not been loaded".format(expected_url)
         )
 
-        # 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))