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 select_pos
11 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
12 from uitest
.uihelper
.common
import get_state_as_dict
14 #Bug 119462 - Find with formatting adds 0pt text size
16 class tdf119462(UITestCase
):
17 def test_tdf119462_find_format(self
):
18 with self
.ui_test
.create_doc_in_start_center("writer"):
19 #1. Choose Edit > Find and Replace
20 with self
.ui_test
.execute_modeless_dialog_through_command(".uno:SearchDialog", close_button
="close") as xDialog
:
22 format
= xDialog
.getChild("format")
23 with self
.ui_test
.execute_blocking_action(format
.executeAction
, args
=('CLICK', ())) as dialog
:
25 xTabs
= dialog
.getChild("tabcontrol")
26 select_pos(xTabs
, "0")
27 xweststylelbcjk
= dialog
.getChild("cbWestStyle")
28 xweststylelbcjk
.executeAction("TYPE", mkPropertyValues({"TEXT":"Bold"}))
30 #verify label searchdesc
31 searchdesc
= xDialog
.getChild("searchdesc")
32 self
.assertEqual(get_state_as_dict(searchdesc
)["Text"], "bold")
33 noformat
= xDialog
.getChild("noformat")
34 noformat
.executeAction("CLICK", tuple()) #click No format button
35 self
.assertEqual(get_state_as_dict(searchdesc
)["Text"], "")
37 # vim: set shiftwidth=4 softtabstop=4 expandtab: