Bug 1478848 - [fxui] Fix test_ssl_disabled_error_page to correctly wait for page load. r=ato

Currently the test doesn't wait for the restore button to become stale,
and as such the call to find_element will return immediately with a
reference to a "h1" element on the error page.

--HG--
extra : rebase_source : 74cc1bfbe929409a56955ec0f5e912256b92c72e
extra : histedit_source : 800c9e2b0df87d655f470f79077a64cfb6776e8a
This commit is contained in:
Henrik Skupin 2018-08-21 11:58:15 +02:00
parent 0c68c54d3e
commit eb86582a92

View file

@ -51,10 +51,16 @@ class TestSSLDisabledErrorPage(PuppeteerMixin, MarionetteTestCase):
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()
restore_button = self.marionette.find_element(By.ID, 'prefResetButton')
restore_button.click()
Wait(self.marionette).until(
expected.element_not_present(By.ID, "prefResetButton"),
message="Click on the restore button didn't trigger a page load"
)
# With the preferences reset, the page has to load correctly
el = Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
expected.element_present(By.TAG_NAME, 'h1'))
expected.element_present(By.TAG_NAME, 'h1'),
message="Expected target page has not been loaded"
)
self.assertIn('tls-v1-0', el.get_property('innerText'))