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

Artur Neumann (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 6 21:29:27 UTC 2019


 sw/Module_sw.mk                               |    1 
 sw/UITest_writer_tests7.mk                    |   16 +++++++
 sw/qa/uitest/writer_tests7/data/tdf127652.odt |binary
 sw/qa/uitest/writer_tests7/tdf127652.py       |   56 ++++++++++++++++++++++++++
 4 files changed, 73 insertions(+)

New commits:
commit 06e45d45877349417000def82c20eaae4bfc3ee3
Author:     Artur Neumann <artur at jankaritech.com>
AuthorDate: Thu Nov 28 13:51:12 2019 +0545
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Fri Dec 6 22:27:50 2019 +0100

    UI test for tdf#127652
    
    Test that the cursor is placed correctly after deleting a section
    that overlaps page boundaries
    
    Change-Id: I466770c7edadf09f11260ede236e598d3d1a875b
    Reviewed-on: https://gerrit.libreoffice.org/83963
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 2dbd5f161f22..101d3b73921b 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -151,6 +151,7 @@ $(eval $(call gb_Module_add_uicheck_targets,sw,\
 	UITest_writer_tests4 \
 	UITest_writer_tests5 \
 	UITest_writer_tests6 \
+	UITest_writer_tests7 \
 	UITest_table \
 	UITest_sw_findReplace \
 	UITest_sw_findSimilarity \
diff --git a/sw/UITest_writer_tests7.mk b/sw/UITest_writer_tests7.mk
new file mode 100644
index 000000000000..b6de351eed13
--- /dev/null
+++ b/sw/UITest_writer_tests7.mk
@@ -0,0 +1,16 @@
+# 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,writer_tests7))
+
+$(eval $(call gb_UITest_add_modules,writer_tests7,$(SRCDIR)/sw/qa/uitest,\
+	writer_tests7/ \
+))
+
+$(eval $(call gb_UITest_set_defs,writer_tests7, \
+    TDOC="$(SRCDIR)/sw/qa/uitest/writer_tests7/data" \
+))
diff --git a/sw/qa/uitest/writer_tests7/data/tdf127652.odt b/sw/qa/uitest/writer_tests7/data/tdf127652.odt
new file mode 100644
index 000000000000..12b2b156bd23
Binary files /dev/null and b/sw/qa/uitest/writer_tests7/data/tdf127652.odt differ
diff --git a/sw/qa/uitest/writer_tests7/tdf127652.py b/sw/qa/uitest/writer_tests7/tdf127652.py
new file mode 100644
index 000000000000..b6e181c61b98
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf127652.py
@@ -0,0 +1,56 @@
+# -*- 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.path import get_srcdir_url
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+
+def get_url_for_data_file(file_name):
+   return get_srcdir_url() + "/sw/qa/uitest/writer_tests7/data/" + file_name
+
+class tdf127652 (UITestCase):
+
+    def test_mark_delete_undo_delete_tdf127652 (self):
+
+        self.ui_test.load_file(get_url_for_data_file("tdf127652.odt"))
+        xWriterDoc = self.xUITest.getTopFocusWindow()
+        xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+        # go to the start of page 4
+        xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "4"}))
+        xWriterEdit.executeAction("CLICK", tuple())
+
+        # mark a section that overlaps multiple pages
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+
+        # delete the marked section
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"}))
+
+        # go to the start of page 4
+        xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "4"}))
+        xWriterEdit.executeAction("CLICK", tuple())
+
+        # move up to page 3
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+
+        # check that we are on the third page
+        # in the bug one issue was that the cursor was places in the wrong place
+        # moving up to the previous page would not work any more
+        self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "3")
+        self.ui_test.close_doc()
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list