summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-10-14 18:40:24 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-10-14 22:21:19 +0200
commitc064766901722082df0d759c95434c1460fcdba5 (patch)
tree1248f215dcab0ebcc25e5a312c103bd3398fd773 /sw
parentf76f15f02a30d20be1c4816d72f7ad7fb4fa20d3 (diff)
tdf#136577: sw: Add UItest
Change-Id: I0b03eae6349b712e921f471e1c4dc082a64568df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104320 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/uitest/findReplace/findReplace.py37
1 files changed, 33 insertions, 4 deletions
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: