diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-12-22 00:38:03 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-12-23 19:41:52 +0100 |
commit | d42c73d0bc064633a51db8c1d5fa9e2f60cba5e8 (patch) | |
tree | c8fc8ee5be9eb5b8aef7226efad3e2c2f8b59643 /sw/qa/uitest | |
parent | 5edafb22331b7dbd2225be56a91bb2918471de68 (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.odt | bin | 0 -> 11770 bytes | |||
-rw-r--r-- | sw/qa/uitest/writer_tests4/tdf136578.py | 38 |
2 files changed, 38 insertions, 0 deletions
diff --git a/sw/qa/uitest/data/tdf136578.odt b/sw/qa/uitest/data/tdf136578.odt Binary files differnew file mode 100644 index 000000000000..15a1269c9e89 --- /dev/null +++ b/sw/qa/uitest/data/tdf136578.odt 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: |