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
, select_pos
11 from uitest
.uihelper
.common
import get_url_for_data_file
13 class tdf145178(UITestCase
):
15 def test_tdf145178(self
):
17 with self
.ui_test
.load_file(get_url_for_data_file('tdf145178.fodt')):
19 with self
.ui_test
.execute_dialog_through_command(".uno:EditRegion") as xDialog
:
20 xTree
= xDialog
.getChild("tree")
21 self
.assertEqual("1", get_state_as_dict(xTree
)['Children'])
22 self
.assertEqual("Section1", get_state_as_dict(xTree
.getChild('0'))['Text'])
23 self
.assertEqual("Section1", get_state_as_dict(xDialog
.getChild('curname'))['Text'])
25 xOptions
= xDialog
.getChild("options")
26 with self
.ui_test
.execute_blocking_action(
27 xOptions
.executeAction
, args
=('CLICK', ())) as xOptDialog
:
28 xTabs
= xOptDialog
.getChild("tabcontrol")
29 select_pos(xTabs
, "3")
31 xFtnExt
= xOptDialog
.getChild("ftnntattextend")
32 xFtnNum
= xOptDialog
.getChild("ftnntnum")
33 xFtnFrm
= xOptDialog
.getChild("ftnntnumfmt")
34 xFtnPre
= xOptDialog
.getChild("ftnprefix")
35 xFtnSuf
= xOptDialog
.getChild("ftnsuffix")
36 xFtnView
= xOptDialog
.getChild("ftnnumviewbox")
37 xFtnOffset
= xOptDialog
.getChild("ftnoffset")
39 self
.assertEqual("true", get_state_as_dict(xFtnExt
)["Enabled"])
40 self
.assertEqual("true", get_state_as_dict(xFtnNum
)["Enabled"])
41 self
.assertEqual("true", get_state_as_dict(xFtnFrm
)["Enabled"])
42 self
.assertEqual("true", get_state_as_dict(xFtnPre
)["Enabled"])
43 self
.assertEqual("true", get_state_as_dict(xFtnSuf
)["Enabled"])
44 self
.assertEqual("true", get_state_as_dict(xFtnView
)["Enabled"])
45 self
.assertEqual("true", get_state_as_dict(xFtnOffset
)["Enabled"])
47 self
.assertEqual("1, 2, 3, ...", get_state_as_dict(xFtnView
)["DisplayText"])
48 self
.assertEqual("(", get_state_as_dict(xFtnPre
)["Text"])
50 # Without the fix in place, this test would have failed with
51 # AssertionError: ')' != ''
52 self
.assertEqual(")", get_state_as_dict(xFtnSuf
)["Text"])
54 self
.assertEqual("3", get_state_as_dict(xFtnOffset
)["Text"])
56 xEndExt
= xOptDialog
.getChild("endntattextend")
57 xEndNum
= xOptDialog
.getChild("endntnum")
58 xEndFrm
= xOptDialog
.getChild("endntnumfmt")
59 xEndPre
= xOptDialog
.getChild("endprefix")
60 xEndSuf
= xOptDialog
.getChild("endsuffix")
61 xEndView
= xOptDialog
.getChild("endnumviewbox")
62 xEndOffset
= xOptDialog
.getChild("endoffset")
64 self
.assertEqual("true", get_state_as_dict(xEndExt
)["Enabled"])
65 self
.assertEqual("true", get_state_as_dict(xEndNum
)["Enabled"])
66 self
.assertEqual("true", get_state_as_dict(xEndFrm
)["Enabled"])
67 self
.assertEqual("true", get_state_as_dict(xEndPre
)["Enabled"])
68 self
.assertEqual("true", get_state_as_dict(xEndSuf
)["Enabled"])
69 self
.assertEqual("true", get_state_as_dict(xEndView
)["Enabled"])
70 self
.assertEqual("true", get_state_as_dict(xEndOffset
)["Enabled"])
72 self
.assertEqual("i, ii, iii, ...", get_state_as_dict(xEndView
)["DisplayText"])
73 self
.assertEqual("[", get_state_as_dict(xEndPre
)["Text"])
74 self
.assertEqual("]", get_state_as_dict(xEndSuf
)["Text"])
76 self
.assertEqual("2", get_state_as_dict(xEndOffset
)["Text"])
78 # vim: set shiftwidth=4 softtabstop=4 expandtab: