Bug 1334996 - Click on Safebrowsing report button has to wait for the final URL. r=whimboo

MozReview-Commit-ID: AlYvuOGxr5E

--HG--
extra : rebase_source : b0f4a8b69d03e32649dea60a539fdd449c9ae46c
This commit is contained in:
ui.aseem_yadav 2017-03-28 15:37:03 +05:30
Родитель 2c2b1ac28e
Коммит fe9e1b2c85
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -91,14 +91,12 @@ class TestSafeBrowsingWarningPages(PuppeteerMixin, MarionetteTestCase):
# 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()