[Libreoffice-commits] core.git: sw/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 20 15:57:14 UTC 2018


 sw/qa/uitest/table/tdf76636.py              |   77 ++++++++++++++++++++++++++++
 sw/qa/uitest/writer_tests/data/tdf76636.doc |binary
 2 files changed, 77 insertions(+)

New commits:
commit cab88e6fa6ae810a853c57ab427de3a3691828d4
Author:     Zdeněk Crhonek <zcrhonek at gmail.com>
AuthorDate: Thu Dec 20 15:08:45 2018 +0100
Commit:     Zdenek Crhonek <zcrhonek at gmail.com>
CommitDate: Thu Dec 20 16:56:48 2018 +0100

    uitest for bug tdf#76636
    
    Change-Id: I5a9f99b7530ed54011c1a4a677f3c6bb46914abb
    Reviewed-on: https://gerrit.libreoffice.org/65498
    Tested-by: Jenkins
    Reviewed-by: Zdenek Crhonek <zcrhonek at gmail.com>

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
Binary files /dev/null and b/sw/qa/uitest/writer_tests/data/tdf76636.doc differ


More information about the Libreoffice-commits mailing list