sw/qa/uitest/writer_tests7/tdf130629.py | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
New commits: commit f7c8535a1e0bf2deda6c5f6d8d8469f5ab7fa07f Author: Xisco Fauli <[email protected]> AuthorDate: Mon Nov 16 18:38:35 2020 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Nov 18 08:37:32 2020 +0100 tdf#130629: sw: Add UItest Change-Id: Ifd9baa0d39b5e767158b1f45be40500f66b97887 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105956 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/uitest/writer_tests7/tdf130629.py b/sw/qa/uitest/writer_tests7/tdf130629.py new file mode 100644 index 000000000000..e4cf7942d8c3 --- /dev/null +++ b/sw/qa/uitest/writer_tests7/tdf130629.py @@ -0,0 +1,43 @@ +# -*- 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 uitest.uihelper.common import get_state_as_dict +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf130629(UITestCase): + + def test_tdf130629(self): + + self.ui_test.create_doc_in_start_center("writer") + + document = self.ui_test.get_component() + self.assertEqual(0, document.DrawPage.getCount()) + + # Insert shape while pressing CTRL + self.xUITest.executeCommandWithParameters(".uno:BasicShapes.diamond", mkPropertyValues({"KeyModifier": 8192})) + + self.assertEqual(1, document.DrawPage.getCount()) + + # Undo twice + self.xUITest.executeCommand(".uno:Undo") + self.xUITest.executeCommand(".uno:Undo") + + self.assertEqual(0, document.DrawPage.getCount()) + + # Shape toolbar is active, use esc before inserting a new shape + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ESC"})) + + # Without the fix in place, this test would have crashed here + self.xUITest.executeCommandWithParameters(".uno:BasicShapes.diamond", mkPropertyValues({"KeyModifier": 8192})) + + self.assertEqual(1, document.DrawPage.getCount()) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
