Bug 1386744 - Better error messages on test failures. r=whimboo
MozReview-Commit-ID: 31bjcc1GL4J
--- 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))