summaryrefslogtreecommitdiffstats
path: root/sw/qa/uitest/writer_tests7/tdf127652.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
commit940b4d1848e8c70ab7642901a68594e8016caffc (patch)
treeeb72f344ee6c3d9b80a7ecc079ea79e9fba8676d /sw/qa/uitest/writer_tests7/tdf127652.py
parentInitial commit. (diff)
downloadlibreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.tar.xz
libreoffice-940b4d1848e8c70ab7642901a68594e8016caffc.zip
Adding upstream version 1:7.0.4.upstream/1%7.0.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/qa/uitest/writer_tests7/tdf127652.py')
-rw-r--r--sw/qa/uitest/writer_tests7/tdf127652.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests7/tdf127652.py b/sw/qa/uitest/writer_tests7/tdf127652.py
new file mode 100644
index 000000000..b6e181c61
--- /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: