2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 from uitest
.framework
import UITestCase
7 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
8 from uitest
.uihelper
.common
import get_state_as_dict
10 from uitest
.path
import get_srcdir_url
12 def get_url_for_data_file(file_name
):
13 return get_srcdir_url() + "/uitest/writer_tests/data/" + file_name
15 class tdf114724(UITestCase
):
17 def test_track_headings_outline(self
):
18 writer_doc
= self
.ui_test
.load_file(get_url_for_data_file("tdf114724.odt"))
19 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
20 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
22 self
.xUITest
.executeCommand(".uno:Sidebar")
23 xWriterEdit
.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
25 xNavigatorPanel
= xWriterEdit
.getChild("NavigatorPanel")
26 xNavigatorPanel
.executeAction("ROOT", tuple())
28 xWriterEdit
.executeAction("FOCUS", tuple())
30 self
.assertEqual(get_state_as_dict(xNavigatorPanel
)["selectioncount"], "1")
32 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
34 self
.assertEqual(get_state_as_dict(xNavigatorPanel
)["selectioncount"], "1")
36 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
38 self
.assertEqual(get_state_as_dict(xNavigatorPanel
)["selectioncount"], "1")
40 self
.xUITest
.executeCommand(".uno:Sidebar")
41 self
.ui_test
.close_doc()