summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorZdeněk Crhonek <zcrhonek@gmail.com>2018-12-10 16:38:52 +0100
committerZdenek Crhonek <zcrhonek@gmail.com>2018-12-10 19:56:01 +0100
commit489775e72fbfb1636eafd431cf40e50705ae80ec (patch)
treeb6b27b00d47d9f3d3206f23fb1d1b1ae5133af76 /sc
parent1173f5da013fa1652363ddaadbe8c0859f0050a2 (diff)
uitest for bug tdf#91425
Change-Id: I95057eb6a8db1bd141bfa53ff955cd72c2b20cd4 Reviewed-on: https://gerrit.libreoffice.org/64883 Tested-by: Jenkins Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/Module_sc.mk1
-rw-r--r--sc/UITest_calc_tests7.mk20
-rw-r--r--sc/qa/uitest/calc_tests/data/tdf91425.odsbin0 -> 18797 bytes
-rw-r--r--sc/qa/uitest/calc_tests7/tdf91425.py43
4 files changed, 64 insertions, 0 deletions
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 46f3ff9ad25f..a4fa70eb4abd 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -228,6 +228,7 @@ $(eval $(call gb_Module_add_uicheck_targets,sc,\
UITest_signatureLine \
UITest_inputLine \
UITest_hideShowSheet \
+ UITest_calc_tests7 \
))
endif
diff --git a/sc/UITest_calc_tests7.mk b/sc/UITest_calc_tests7.mk
new file mode 100644
index 000000000000..65ff569a40f9
--- /dev/null
+++ b/sc/UITest_calc_tests7.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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/.
+#
+
+$(eval $(call gb_UITest_UITest,calc_tests7))
+
+$(eval $(call gb_UITest_add_modules,calc_tests7,$(SRCDIR)/sc/qa/uitest,\
+ calc_tests7/ \
+))
+
+$(eval $(call gb_UITest_set_defs,calc_tests7, \
+ TDOC="$(SRCDIR)/sc/qa/uitest/calc_tests/data" \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/qa/uitest/calc_tests/data/tdf91425.ods b/sc/qa/uitest/calc_tests/data/tdf91425.ods
new file mode 100644
index 000000000000..5a72f162d29b
--- /dev/null
+++ b/sc/qa/uitest/calc_tests/data/tdf91425.ods
Binary files differ
diff --git a/sc/qa/uitest/calc_tests7/tdf91425.py b/sc/qa/uitest/calc_tests7/tdf91425.py
new file mode 100644
index 000000000000..cacd96726646
--- /dev/null
+++ b/sc/qa/uitest/calc_tests7/tdf91425.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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, type_text
+from libreoffice.calc.document import get_cell_by_position
+import time
+from uitest.debug import sleep
+import org.libreoffice.unotest
+import pathlib
+
+
+#Bug 91425 - CRASH - Calc Insert Columns Left
+
+def get_url_for_data_file(file_name):
+ return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+class tdf91425(UITestCase):
+ def test_tdf91425_insert_columns_left(self):
+ calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf91425.ods"))
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #1) Open test file provided in report
+ #2) Move mouse pointer over Column A header, the right mouse button click
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #3) Insert columns left
+ self.xUITest.executeCommand(".uno:InsertColumnsBefore")
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "C")
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "C")
+ #redo
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "C")
+
+ self.ui_test.close_doc()
+# vim: set shiftwidth=4 softtabstop=4 expandtab: