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
11 class optionsDialog(UITestCase
):
13 def test_moreIconsDialog(self
):
14 with self
.ui_test
.create_doc_in_start_center("writer"):
16 with self
.ui_test
.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialog
:
18 xPages
= xDialog
.getChild("pages")
19 xLOEntry
= xPages
.getChild('0')
20 xLOEntry
.executeAction("EXPAND", tuple())
21 xViewEntry
= xLOEntry
.getChild('2')
22 xViewEntry
.executeAction("SELECT", tuple())
24 xMoreIconsBtn
= xDialog
.getChild("btnMoreIcons")
26 with self
.ui_test
.execute_blocking_action(xMoreIconsBtn
.executeAction
, args
=('CLICK', ()), close_button
="buttonClose") as dialog
:
27 # Check it doesn't crash while opening it
28 xCloseBtn
= dialog
.getChild("buttonClose")
29 self
.ui_test
.wait_until_property_is_updated(xCloseBtn
, "Enabled", "true")
33 def test_tdf138596(self
):
34 with self
.ui_test
.create_doc_in_start_center("writer"):
36 with self
.ui_test
.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialog
:
37 xPages
= xDialog
.getChild("pages")
38 xWriterEntry
= xPages
.getChild('3')
39 xWriterEntry
.executeAction("EXPAND", tuple())
40 xFormattingAidsEntry
= xWriterEntry
.getChild('2')
41 xFormattingAidsEntry
.executeAction("SELECT", tuple())
43 xApplyBtn
= xDialog
.getChild("apply")
45 # Click apply button twice
46 # Without the fix in place, this test would have crashed here
47 xApplyBtn
.executeAction("CLICK", tuple())
48 xApplyBtn
.executeAction("CLICK", tuple())
52 # vim: set shiftwidth=4 softtabstop=4 expandtab: