summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-11-16 18:38:35 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2020-11-18 08:37:32 +0100
commitf7c8535a1e0bf2deda6c5f6d8d8469f5ab7fa07f (patch)
tree04130b6b3cc164327fe5a9178bbde0ac79d5257d
parent0971eda1b4824b01f4d3b1e1e36ff6eb3bf37317 (diff)
tdf#130629: sw: Add UItest
Change-Id: Ifd9baa0d39b5e767158b1f45be40500f66b97887 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105956 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sw/qa/uitest/writer_tests7/tdf130629.py43
1 files changed, 43 insertions, 0 deletions
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: