sw/qa/uitest/findReplace/findReplace.py | 37 ++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-)
New commits: commit c064766901722082df0d759c95434c1460fcdba5 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Oct 14 18:40:24 2020 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Oct 14 22:21:19 2020 +0200 tdf#136577: sw: Add UItest Change-Id: I0b03eae6349b712e921f471e1c4dc082a64568df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104320 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/uitest/findReplace/findReplace.py b/sw/qa/uitest/findReplace/findReplace.py index 83821ae8662b..1c841c0f0de7 100644 --- a/sw/qa/uitest/findReplace/findReplace.py +++ b/sw/qa/uitest/findReplace/findReplace.py @@ -15,13 +15,10 @@ 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() -#tdf116242 ţ ț - DONE -#Bug 98417 - FIND & REPLACE: Add 'Find Previous' button - DONE -#Bug 39022 - find-replace->$1, not pattern - DONE - class findReplace(UITestCase): def test_find_writer(self): writer_doc = self.ui_test.load_file(get_url_for_data_file("findReplace.odt")) @@ -194,4 +191,36 @@ class findReplace(UITestCase): self.ui_test.close_dialog_through_button(xcloseBtn) self.ui_test.close_doc() + + def test_tdf136577(self): + self.ui_test.create_doc_in_start_center("writer") + + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + + document = self.ui_test.get_component() + + type_text(xWriterEdit, "x") + + self.assertEqual(document.Text.String, "x") + + self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog") + xDialog = self.xUITest.getTopFocusWindow() + + searchterm = xDialog.getChild("searchterm") + searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"x"})) + + + replaceall = xDialog.getChild("replaceall") + replaceall.executeAction("CLICK", tuple()) + + self.assertEqual(document.Text.String, "") + + self.xUITest.executeCommand(".uno:Undo") + + # Without the fix in place, this test would have failed with AssertionError: '' != 'x' + self.assertEqual(document.Text.String, "x") + + self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits