summaryrefslogtreecommitdiff
path: root/sw/qa/uitest
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-12-22 00:38:03 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2020-12-23 19:41:52 +0100
commitd42c73d0bc064633a51db8c1d5fa9e2f60cba5e8 (patch)
treec8fc8ee5be9eb5b8aef7226efad3e2c2f8b59643 /sw/qa/uitest
parent5edafb22331b7dbd2225be56a91bb2918471de68 (diff)
tdf#136578: uitest: add wrapper for PageBreakWin
Change-Id: I1536f2f03da9ec64627bd1e2e1776cf130717aff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108143 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uitest')
-rw-r--r--sw/qa/uitest/data/tdf136578.odtbin0 -> 11770 bytes
-rw-r--r--sw/qa/uitest/writer_tests4/tdf136578.py38
2 files changed, 38 insertions, 0 deletions
diff --git a/sw/qa/uitest/data/tdf136578.odt b/sw/qa/uitest/data/tdf136578.odt
new file mode 100644
index 000000000000..15a1269c9e89
--- /dev/null
+++ b/sw/qa/uitest/data/tdf136578.odt
Binary files differ
diff --git a/sw/qa/uitest/writer_tests4/tdf136578.py b/sw/qa/uitest/writer_tests4/tdf136578.py
new file mode 100644
index 000000000000..ae609f30becb
--- /dev/null
+++ b/sw/qa/uitest/writer_tests4/tdf136578.py
@@ -0,0 +1,38 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+import org.libreoffice.unotest
+import pathlib
+
+def get_url_for_data_file(file_name):
+ return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+class tdf136578(UITestCase):
+
+ def test_tdf136578(self):
+
+ self.ui_test.load_file(get_url_for_data_file("tdf136578.odt"))
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ document = self.ui_test.get_component()
+
+ self.assertEqual(document.CurrentController.PageCount, 2)
+
+ self.ui_test.wait_until_child_is_available(xWriterEdit, 'PageBreak')
+ xPageBreak = xWriterEdit.getChild('PageBreak')
+
+ xPageBreak.executeAction("DELETE", tuple())
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 1 != 2
+ self.assertEqual(document.CurrentController.PageCount, 1)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: