summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-06-25 19:39:17 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-26 07:25:59 +0200
commit1db375e06516d0532f01f9585986617aa3079866 (patch)
treeea65aaa7220940510f86c37533e1c6d89b3c89e1 /sw
parentf2e781c92bb96d626cf7a75c134f339a8a95d183 (diff)
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/uitest/writer_tests6/tdf118883.py18
1 files changed, 5 insertions, 13 deletions
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: