Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / uitest / writer_tests / tdf114724.py
blob8d67f2a95bffdffe6e86e32e8dff155dc91f5ada
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
9 import time
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())
29 time.sleep(2)
30 self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")
31 for _ in range(0,3):
32 xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
33 time.sleep(2)
34 self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")
35 for _ in range(0,3):
36 xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
37 time.sleep(2)
38 self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")
40 self.xUITest.executeCommand(".uno:Sidebar")
41 self.ui_test.close_doc()