Bug 1274943 - Ensure to wait for the update dialog after a forced fallback. r?maja_zf
MozReview-Commit-ID: 7i9SwSbm0p0
--- a/testing/firefox-ui/harness/firefox_ui_harness/testcases.py
+++ b/testing/firefox-ui/harness/firefox_ui_harness/testcases.py
@@ -5,16 +5,17 @@
import os
import pprint
from datetime import datetime
import mozfile
from marionette import MarionetteTestCase
from marionette_driver import Wait
+from marionette_driver.errors import NoSuchWindowException
from firefox_puppeteer.api.prefs import Preferences
from firefox_puppeteer.api.software_update import SoftwareUpdate
from firefox_puppeteer.testcases import BaseFirefoxTestCase
from firefox_puppeteer.ui.update_wizard import UpdateWizardDialog
class FirefoxTestCase(BaseFirefoxTestCase, MarionetteTestCase):
@@ -313,18 +314,20 @@ class UpdateTestCase(FirefoxTestCase):
if force_fallback:
# Set the downloaded update into failed state
self.software_update.force_fallback()
# Restart Firefox to apply the downloaded update
self.restart()
def download_and_apply_forced_update(self):
- # The update wizard dialog opens automatically after the restart
- dialog = self.windows.switch_to(lambda win: type(win) is UpdateWizardDialog)
+ # The update wizard dialog opens automatically after the restart but with a short delay
+ dialog = Wait(self.marionette, ignored_exceptions=[NoSuchWindowException]).until(
+ lambda _: self.windows.switch_to(lambda win: type(win) is UpdateWizardDialog)
+ )
# In case of a broken complete update the about window has to be used
if self.updates[self.current_update_index]['patch']['is_complete']:
about_window = None
try:
self.assertEqual(dialog.wizard.selected_panel,
dialog.wizard.error)
dialog.close()