summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorZdeněk Crhonek <zcrhonek@gmail.com>2019-11-23 09:31:10 +0100
committerZdenek Crhonek <zcrhonek@gmail.com>2019-11-23 13:44:38 +0100
commit1347dc450b13cac8643db3ccb2670838dc82d138 (patch)
tree6fe954592f4e7419de291255ac34cd67474707d3 /sc/qa
parentfdff5df464598261ed8d5137e1685bc538b3cb25 (diff)
uitest for bug tdf#91217
Change-Id: I0322a3bc821850d5f15aeb690ba80ff7b8129140 Reviewed-on: https://gerrit.libreoffice.org/83546 Tested-by: Jenkins Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/uitest/calc_tests/data/tdf91217.odsbin0 -> 150417 bytes
-rw-r--r--sc/qa/uitest/calc_tests9/tdf91217.py43
2 files changed, 43 insertions, 0 deletions
diff --git a/sc/qa/uitest/calc_tests/data/tdf91217.ods b/sc/qa/uitest/calc_tests/data/tdf91217.ods
new file mode 100644
index 000000000000..c1bb9da85c94
--- /dev/null
+++ b/sc/qa/uitest/calc_tests/data/tdf91217.ods
Binary files differ
diff --git a/sc/qa/uitest/calc_tests9/tdf91217.py b/sc/qa/uitest/calc_tests9/tdf91217.py
new file mode 100644
index 000000000000..103c970e6740
--- /dev/null
+++ b/sc/qa/uitest/calc_tests9/tdf91217.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 uitest.uihelper.common import select_pos
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+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()
+
+#Bug 91217 - Crash when deleting rows
+
+class tdf91217(UITestCase):
+ def test_tdf91217_crash_deleting_rows(self):
+ calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf91217.ods"))
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Select rows 76-1125 in sheet 3 (Daily), right click, Delete Rows. Instant crash.
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A76:A1125"}))
+ self.xUITest.executeCommand(".uno:SelectRow")
+ #delete rows
+ self.xUITest.executeCommand(".uno:DeleteRows")
+ #A1 should be "Dist"
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Dist")
+ #- Undo-redo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Dist")
+
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Dist")
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: