Bug 1352132 - Navigation unit tests have to wait for the page loaded in the newly opened tab. r=ato

There is a race condition for all navigation tests inside the setUp
method of the BaseNavigationTestCase class. The assert for history
items can already happen if the page hasn't been fully loaded yet.
As such a failure is thrown. To fix this we have to wait for the
page being loaded.

MozReview-Commit-ID: 9LbArVT9WqA

--HG--
extra : rebase_source : 0c64798893b64f66f39e7aca16db9b4423d78047
This commit is contained in:
Henrik Skupin 2017-05-08 21:18:24 +02:00
Родитель b15749b719
Коммит 517f62ad3a
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -44,7 +44,9 @@ class BaseNavigationTestCase(WindowManagerMixin, MarionetteTestCase):
self.marionette.navigate(self.marionette.absolute_url("windowHandles.html"))
self.new_tab = self.open_tab(open_with_link)
self.marionette.switch_to_window(self.new_tab)
self.assertEqual(self.history_length, 1)
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
lambda _: self.history_length == 1,
message="The newly opened tab doesn't have a browser history length of 1")
def tearDown(self):
self.marionette.timeout.reset()