1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 from uitest
.framework
import UITestCase
10 from uitest
.uihelper
.common
import get_state_as_dict
11 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
13 class tdf154269(UITestCase
):
15 def test_tdf154269(self
):
17 with self
.ui_test
.create_doc_in_start_center("writer"):
18 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
19 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
21 # Generate a search history with more than 10 entries (A to Z)
22 for searchTerm
in map(chr, range(65, 91)):
23 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+f"}))
24 xFind
= xWriterDoc
.getChild("find")
25 xFindBar
= xWriterDoc
.getChild("FindBar")
26 xFind
.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
27 xFind
.executeAction("TYPE", mkPropertyValues({"TEXT":searchTerm
}))
28 xFind
.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
29 xFindBar
.executeAction("CLICK", mkPropertyValues({"POS":"0"}))
31 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+f"}))
32 xFind
= xWriterDoc
.getChild("find")
33 # The default value of FindReplaceRememberedSearches has been respected
34 self
.assertEqual("10", get_state_as_dict(xFind
)["EntryCount"])
36 # vim: set shiftwidth=4 softtabstop=4 expandtab: