From 1db375e06516d0532f01f9585986617aa3079866 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 25 Jun 2021 19:39:17 +0200 Subject: uitest: introduce load_empty_file to make sure the documents are closed in inverse order when different documents are used in the same test Change-Id: I97ff33f9f91423d06f4e74bba6fc6a5312b24a17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117914 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sw/qa/uitest/writer_tests6/tdf118883.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'sw') diff --git a/sw/qa/uitest/writer_tests6/tdf118883.py b/sw/qa/uitest/writer_tests6/tdf118883.py index 9a7397d413b1..65a8ada64885 100644 --- a/sw/qa/uitest/writer_tests6/tdf118883.py +++ b/sw/qa/uitest/writer_tests6/tdf118883.py @@ -21,20 +21,12 @@ class Tdf118883(UITestCase): self.xUITest.executeCommand(".uno:Copy") - self.ui_test.execute_dialog_through_command(".uno:CloseDoc") - xDialog = self.xUITest.getTopFocusWindow() - xDiscardBtn = xDialog.getChild("discard") - self.ui_test.close_dialog_through_button(xDiscardBtn) + with self.ui_test.load_empty_file("calc") as calc_document: - calc_doc = self.ui_test.create_doc_in_start_center("calc") + self.xUITest.executeCommand(".uno:Paste") - self.xUITest.executeCommand(".uno:Paste") + # Without the fix in place, this test would have failed with + # AssertionError: 1 != 0 + self.assertEqual(1, calc_document.DrawPages[0].getCount()) - calc_document = self.ui_test.get_component() - - # Without the fix in place, this test would have failed with - # AssertionError: 1 != 0 - self.assertEqual(1, calc_document.DrawPages[0].getCount()) - - self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: -- cgit