Bug 1386744 - Better error messages on test failures. r=whimboo draft
authorErica Wright <ewright@mozilla.com>
Wed, 02 Aug 2017 13:32:33 -0400
changeset 621173 634ef3cc92c7a0cd2800d423d1fee9cd1270e2b3
parent 619581 52285ea5e54c73d3ed824544cef2ee3f195f05e6
child 640933 40b87de14d14160588154e77a58b1a7ad6369282
push id72294
push userbmo:ewright@mozilla.com
push dateFri, 04 Aug 2017 13:08:41 +0000
reviewerswhimboo
bugs1386744
milestone57.0a1
Bug 1386744 - Better error messages on test failures. r=whimboo MozReview-Commit-ID: 31bjcc1GL4J
testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_restart_and_quit.py
--- a/testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_restart_and_quit.py
+++ b/testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_restart_and_quit.py
@@ -150,41 +150,53 @@ class TestSessionStoreEnabled(TestBaseRe
         super(TestSessionStoreEnabled, self).setUp(startup_page=3)
 
     def test_with_variety(self):
         """ Opens a set of windows, both standard and private, with
         some number of tabs in them. Once the tabs have loaded, restarts
         the browser, and then ensures that the standard tabs have been
         restored, and that the private ones have not.
         """
-        self.assertEqual(self.convert_open_windows_to_set(), self.all_windows,
-                         msg='Not all requested windows have been opened.')
+        current_windows_set = self.convert_open_windows_to_set()
+        self.assertEqual(current_windows_set, self.all_windows,
+                         msg='Not all requested windows have been opened. Expected {}, got {}.'
+                         .format(self.all_windows, current_windows_set))
 
         self.marionette.quit(in_app=True)
         self.marionette.start_session()
         self.marionette.set_context('chrome')
 
-        self.assertEqual(self.convert_open_windows_to_set(), self.test_windows,
-                         msg='Non private windows and tabs should have been restored.')
+        current_windows_set = self.convert_open_windows_to_set()
+        self.assertEqual(current_windows_set, self.test_windows,
+                         msg="""Non private browsing windows should have
+                         been restored. Expected {}, got {}.
+                         """.format(self.test_windows, current_windows_set))
 
 
 class TestSessionStoreDisabled(TestBaseRestoreWindows):
     def test_no_restore_with_quit(self):
-        self.assertEqual(self.convert_open_windows_to_set(), self.all_windows,
-                         msg='Not all requested windows have been opened.')
+        current_windows_set = self.convert_open_windows_to_set()
+        self.assertEqual(current_windows_set, self.all_windows,
+                         msg='Not all requested windows have been opened. Expected {}, got {}.'
+                         .format(self.all_windows, current_windows_set))
 
         self.marionette.quit(in_app=True)
         self.marionette.start_session()
         self.marionette.set_context('chrome')
 
         self.assertEqual(len(self.puppeteer.windows.all), 1,
                          msg='Windows from last session shouldn`t have been restored.')
         self.assertEqual(len(self.puppeteer.windows.current.tabbar.tabs), 1,
                          msg='Tabs from last session shouldn`t have been restored.')
 
     def test_restore_with_restart(self):
-        self.assertEqual(self.convert_open_windows_to_set(), self.all_windows,
-                         msg='Not all requested windows have been opened.')
+        current_windows_set = self.convert_open_windows_to_set()
+        self.assertEqual(current_windows_set, self.all_windows,
+                         msg='Not all requested windows have been opened. Expected {}, got {}.'
+                         .format(self.all_windows, current_windows_set))
 
         self.restart()
 
-        self.assertEqual(self.convert_open_windows_to_set(), self.test_windows,
-                         msg='Non private windows and tabs should have been restored.')
+        current_windows_set = self.convert_open_windows_to_set()
+        self.assertEqual(current_windows_set, self.test_windows,
+                         msg="""Non private browsing windows should have
+                         been restored. Expected {}, got {}.
+                         """.format(self.test_windows, current_windows_set))