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/.
10 from uitest
.framework
import UITestCase
11 from uitest
.uihelper
.common
import get_state_as_dict
, get_url_for_data_file
13 class tdf159418(UITestCase
):
15 def test_tdf159418(self
):
16 with self
.ui_test
.load_file(get_url_for_data_file("tdf159418.odt")):
18 with self
.ui_test
.execute_dialog_through_command(".uno:IndexEntryDialog", close_button
="close") as xDialog
:
20 xEntry
= xDialog
.getChild("entryed")
21 xNext
= xDialog
.getChild("next")
22 xPrevious
= xDialog
.getChild("previous")
24 # Without the fix in place, this test would have failed with
25 # AssertionError: 'true' != 'false'
26 self
.assertEqual("true", get_state_as_dict(xNext
)["Visible"])
27 self
.assertEqual("true", get_state_as_dict(xNext
)["Enabled"])
28 self
.assertEqual("true", get_state_as_dict(xPrevious
)["Visible"])
29 self
.assertEqual("false", get_state_as_dict(xPrevious
)["Enabled"])
30 self
.assertEqual("Function", get_state_as_dict(xEntry
)["Text"])
32 xNext
.executeAction("CLICK", tuple())
34 self
.assertEqual("true", get_state_as_dict(xNext
)["Visible"])
35 self
.assertEqual("true", get_state_as_dict(xPrevious
)["Visible"])
36 self
.assertEqual("true", get_state_as_dict(xPrevious
)["Visible"])
37 self
.assertEqual("true", get_state_as_dict(xPrevious
)["Enabled"])
38 self
.assertEqual("vector", get_state_as_dict(xEntry
)["Text"])
40 xPrevious
.executeAction("CLICK", tuple())
42 self
.assertEqual("true", get_state_as_dict(xNext
)["Visible"])
43 self
.assertEqual("true", get_state_as_dict(xNext
)["Enabled"])
44 self
.assertEqual("true", get_state_as_dict(xPrevious
)["Visible"])
45 self
.assertEqual("false", get_state_as_dict(xPrevious
)["Enabled"])
46 self
.assertEqual("Function", get_state_as_dict(xEntry
)["Text"])
48 # vim: set shiftwidth=4 softtabstop=4 expandtab: