diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py index 99b02e14fd5a..26f50fcb183e 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py @@ -796,9 +796,12 @@ class TestPageLoadStrategy(BaseNavigationTestCase): self.marionette.delete_session() self.marionette.start_session({"pageLoadStrategy": "none"}) - # With a strategy of "none" there should be no wait for the page load, and the - # current load state is unknown. So only test that the command executes successfully. self.marionette.navigate(self.test_page_slow_resource) + Wait(self.marionette, timeout=self.marionette.timeout.page_load).until( + lambda _: self.marionette.get_url() == self.test_page_slow_resource, + message="Target page has not been loaded" + ) + self.marionette.find_element(By.ID, "slow") def test_eager(self): self.marionette.delete_session() diff --git a/testing/marionette/navigate.js b/testing/marionette/navigate.js index 2746f3e2781f..3943859803c3 100644 --- a/testing/marionette/navigate.js +++ b/testing/marionette/navigate.js @@ -192,6 +192,7 @@ navigate.waitForNavigationCompleted = async function waitForNavigationCompleted( // Return immediately if no load event is expected if (!loadEventExpected || pageLoadStrategy === PageLoadStrategy.None) { + await callback(); return Promise.resolve(); }