summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdeněk Crhonek <zcrhonek@gmail.com>2018-12-20 15:08:45 +0100
committerZdenek Crhonek <zcrhonek@gmail.com>2018-12-20 16:56:48 +0100
commitcab88e6fa6ae810a853c57ab427de3a3691828d4 (patch)
tree8a04daa29b1aaf6d6ee28e02c01749fb137e244e
parenttdf#120562 , Selection of favorite character is not applied. (diff)
downloadcore-cab88e6fa6ae810a853c57ab427de3a3691828d4.tar.gz
core-cab88e6fa6ae810a853c57ab427de3a3691828d4.zip
uitest for bug tdf#76636
Change-Id: I5a9f99b7530ed54011c1a4a677f3c6bb46914abb Reviewed-on: https://gerrit.libreoffice.org/65498 Tested-by: Jenkins Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
-rw-r--r--sw/qa/uitest/table/tdf76636.py77
-rw-r--r--sw/qa/uitest/writer_tests/data/tdf76636.docbin0 -> 13824 bytes
2 files changed, 77 insertions, 0 deletions
diff --git a/sw/qa/uitest/table/tdf76636.py b/sw/qa/uitest/table/tdf76636.py
new file mode 100644
index 000000000000..274a7b8d08ce
--- /dev/null
+++ b/sw/qa/uitest/table/tdf76636.py
@@ -0,0 +1,77 @@
+# -*- 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.debug import sleep
+# import org.libreoffice.unotest
+# import pathlib
+from uitest.path import get_srcdir_url
+
+def get_url_for_data_file(file_name):
+# return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+ return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name
+
+#Bug 76636 - Crash in .doc when trying to merge cells
+
+class tdf76636(UITestCase):
+
+ def test_tdf76636_merge_cells_doc(self):
+
+ writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf76636.doc"))
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ #* open Writer
+ #* merge the three top cells on the right
+ #--> crash
+
+ self.assertEqual(document.TextTables.getCount(), 1)
+ #go to middle row
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+LEFT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+LEFT"}))
+
+ #merge
+ self.xUITest.executeCommand(".uno:MergeCells")
+ self.assertEqual(document.TextTables.getCount(), 1)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.TextTables.getCount(), 1)
+ self.ui_test.close_doc()
+
+ def test_tdf76636_merge_cells_doc_undo(self):
+
+ writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf76636.doc"))
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ # 1) open crash.doc
+ # 2) merge the cell with 'punteggio per corso (valutazione singola)' in it with the empty cell to its right
+ # 3) press undo
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+RIGHT"}))
+ #merge
+ self.xUITest.executeCommand(".uno:MergeCells")
+ self.assertEqual(document.TextTables.getCount(), 1)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.TextTables.getCount(), 1)
+
+ self.ui_test.close_doc()
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/data/tdf76636.doc b/sw/qa/uitest/writer_tests/data/tdf76636.doc
new file mode 100644
index 000000000000..2d94868da586
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/data/tdf76636.doc
Binary files differ