Bug 1304656 - Firefox UI update tests have to use the restart buttons. r=rail, a=test-only
☠☠ backed out by c71323755db2 ☠ ☠
authorHenrik Skupin <mail@hskupin.info>
Thu, 13 Apr 2017 09:41:43 +0200
changeset 396008 ee39b53a33c0f1c908f4dc0499d71420d1a40974
parent 396007 b992c7c7fa043105a405964e5555a6f4ef616efe
child 396009 ec47fae0f90fe411d9fd5dcd1a5c80f80bad0b8c
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrail, test-only
bugs1304656
milestone54.0
Bug 1304656 - Firefox UI update tests have to use the restart buttons. r=rail, a=test-only To ensure that we correctly restart Firefox for update tests, the restart button in the about window or the old software update window have to be clicked. MozReview-Commit-ID: 7acl1DcA85d
testing/firefox-ui/harness/firefox_ui_harness/testcases.py
--- a/testing/firefox-ui/harness/firefox_ui_harness/testcases.py
+++ b/testing/firefox-ui/harness/firefox_ui_harness/testcases.py
@@ -307,17 +307,17 @@ class UpdateTestCase(PuppeteerMixin, Mar
         finally:
             self.update_status['patch'] = self.patch_info
 
         if force_fallback:
             # Set the downloaded update into failed state
             self.software_update.force_fallback()
 
         # Restart Firefox to apply the downloaded update
-        self.restart()
+        self.restart(callback=lambda: about_window.deck.apply.button.click())
 
     def download_and_apply_forced_update(self):
         self.check_update_not_applied()
 
         # The update wizard dialog opens automatically after the restart but with a short delay
         dialog = Wait(self.marionette, ignored_exceptions=[NoSuchWindowException]).until(
             lambda _: self.puppeteer.windows.switch_to(lambda win: type(win) is UpdateWizardDialog)
         )
@@ -336,32 +336,36 @@ class UpdateTestCase(PuppeteerMixin, Mar
                 self.assertTrue(update_available,
                                 'Available update has been found')
 
                 # Download update and wait until it has been applied
                 self.download_update(about_window)
                 self.wait_for_update_applied(about_window)
 
             finally:
-                if about_window:
-                    self.update_status['patch'] = self.patch_info
+                self.update_status['patch'] = self.patch_info
 
+            # Restart Firefox to apply the downloaded fallback update
+            self.assertIsNotNone(about_window)
+            self.restart(callback=lambda: about_window.deck.apply.button.click())
+
+        # For a broken partial update, the software update window is used
         else:
             try:
                 self.assertEqual(dialog.wizard.selected_panel,
                                  dialog.wizard.error_patching)
 
                 # Start downloading the fallback update
                 self.download_update(dialog)
 
             finally:
                 self.update_status['patch'] = self.patch_info
 
-        # Restart Firefox to apply the update
-        self.restart()
+            # Restart Firefox to apply the downloaded fallback update
+            self.restart(callback=lambda: dialog.wizard.finish_button.click())
 
     def read_update_log(self):
         """Read the content of the update log file for the last update attempt."""
         path = os.path.join(os.path.dirname(self.software_update.staging_directory),
                             'last-update.log')
         try:
             with open(path, 'rb') as f:
                 return f.read().splitlines()