From 11a25339abfb957ea51614b67bbff26cb606f3a2 Mon Sep 17 00:00:00 2001 From: Andreas Heinisch Date: Mon, 17 Apr 2023 17:17:21 +0200 Subject: [PATCH] tdf#154269 - Respect FindReplaceRememberedSearches: add unit test Change-Id: I72db7964b512a40c4b81b218b2cae60ab34d47c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150522 Tested-by: Jenkins Reviewed-by: Andreas Heinisch --- sw/qa/uitest/findBar/tdf154269.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sw/qa/uitest/findBar/tdf154269.py b/sw/qa/uitest/findBar/tdf154269.py index d5752093b2b6..aebab770ca35 100755 --- a/sw/qa/uitest/findBar/tdf154269.py +++ b/sw/qa/uitest/findBar/tdf154269.py @@ -15,21 +15,21 @@ class tdf154269(UITestCase): def test_tdf154269(self): with self.ui_test.create_doc_in_start_center("writer"): - # Open quick search - self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar") xWriterDoc = self.xUITest.getTopFocusWindow() - xFind = xWriterDoc.getChild("find") + xWriterEdit = xWriterDoc.getChild("writer_edit") # Generate a search history with more than 10 entries (A to Z) for searchTerm in map(chr, range(65, 91)): - # Search twice to generate a search history - xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) - xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) - xFind.executeAction("TYPE", mkPropertyValues({"TEXT": searchTerm})) - xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) - xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ESC"})) - self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar") + xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+f"})) + xFind = xWriterDoc.getChild("find") + xFindBar = xWriterDoc.getChild("FindBar") + xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xFind.executeAction("TYPE", mkPropertyValues({"TEXT":searchTerm})) + xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"})) + xFindBar.executeAction("CLICK", mkPropertyValues({"POS":"0"})) + xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+f"})) + xFind = xWriterDoc.getChild("find") # The default value of FindReplaceRememberedSearches has been respected self.assertEqual("10", get_state_as_dict(xFind)["EntryCount"])