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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Feb 19 17:51:43 UTC 2019


 sw/qa/uitest/findReplace/tdf101873.py        |   52 +++++++++++++++++++++++++++
 sw/qa/uitest/writer_tests/data/tdf101873.odt |binary
 2 files changed, 52 insertions(+)

New commits:
commit 92849660e21d5a13fb671339e52cbc30335ab842
Author:     Zdeněk Crhonek <zcrhonek at gmail.com>
AuthorDate: Tue Feb 19 16:45:55 2019 +0100
Commit:     Zdenek Crhonek <zcrhonek at gmail.com>
CommitDate: Tue Feb 19 18:51:20 2019 +0100

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

diff --git a/sw/qa/uitest/findReplace/tdf101873.py b/sw/qa/uitest/findReplace/tdf101873.py
new file mode 100644
index 000000000000..ba78d9c45a42
--- /dev/null
+++ b/sw/qa/uitest/findReplace/tdf101873.py
@@ -0,0 +1,52 @@
+# -*- 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.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, type_text
+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()
+
+#Bug 101873 - Cursor jumps to the begin of the document after searching for text not found
+
+class tdf101873(UITestCase):
+    def test_tdf101873_find_not_found_jump(self):
+        writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf101873.odt"))
+        document = self.ui_test.get_component()
+        xWriterDoc = self.xUITest.getTopFocusWindow()
+        xWriterEdit = xWriterDoc.getChild("writer_edit")
+        #go to page 2
+        self.ui_test.execute_dialog_through_command(".uno:GotoPage")
+        xDialog = self.xUITest.getTopFocusWindow()
+        xPageText = xDialog.getChild("page")
+        xPageText.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
+        xOkBtn = xDialog.getChild("ok")
+        xOkBtn.executeAction("CLICK", tuple())
+        self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2") #I'm on the 2nd page
+
+        self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+        xDialog = self.xUITest.getTopFocusWindow()
+
+        searchterm = xDialog.getChild("searchterm")
+        searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"notFound"}))
+        xsearch = xDialog.getChild("search")
+        xsearch.executeAction("CLICK", tuple())
+        xsearch.executeAction("CLICK", tuple())
+        #verify
+        self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+
+        xcloseBtn = xDialog.getChild("close")
+        self.ui_test.close_dialog_through_button(xcloseBtn)
+
+        self.ui_test.close_doc()
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/data/tdf101873.odt b/sw/qa/uitest/writer_tests/data/tdf101873.odt
new file mode 100644
index 000000000000..53b4f0b3c18b
Binary files /dev/null and b/sw/qa/uitest/writer_tests/data/tdf101873.odt differ


More information about the Libreoffice-commits mailing list