From 2c86f1981c9a6f24d5c33c5eede2cd15ce6f29e3 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 11 Feb 2020 09:58:24 +0100 Subject: [PATCH] tdf#129346: Add UItest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I491659d3bc5657c4eda2d88849acb0c4972b0c60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88429 Reviewed-by: Xisco FaulĂ­ Tested-by: Xisco FaulĂ­ --- sd/qa/uitest/impress_tests/tdf129346.py | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sd/qa/uitest/impress_tests/tdf129346.py diff --git a/sd/qa/uitest/impress_tests/tdf129346.py b/sd/qa/uitest/impress_tests/tdf129346.py new file mode 100644 index 000000000000..7c22256955f3 --- /dev/null +++ b/sd/qa/uitest/impress_tests/tdf129346.py @@ -0,0 +1,31 @@ +# -*- 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 +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf129346(UITestCase): + + def test_run(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + self.xUITest.executeCommand(".uno:DiaMode") + xDoc = self.xUITest.getTopFocusWindow() + document = self.ui_test.get_component() + self.assertEqual(document.CurrentController.getCurrentPage().Number, 1) + self.xUITest.executeCommand(".uno:InsertPage") + + self.assertEqual(document.CurrentController.getCurrentPage().Number, 2) + self.xUITest.executeCommand(".uno:Undo") + + #Without the accompanying fix in place, getCurrentPage() is None + self.assertEqual(document.CurrentController.getCurrentPage().Number, 1) + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: