Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / qa / uitest / navigator / tdf144672.py
blob4bded66dcb088fd7249b9ef34a7a5d72b4461c7b
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 libreoffice.uno.propertyvalue import mkPropertyValues
12 from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
14 class tdf144672(UITestCase):
16 def get_item(self, xTree, name):
17 for i in xTree.getChildren():
18 xItem = xTree.getChild(i)
19 if name == get_state_as_dict(xItem)['Text']:
20 return xItem
22 def test_Tdf144672(self):
23 with self.ui_test.load_file(get_url_for_data_file("tdf144672.odt")):
25 xMainWindow = self.xUITest.getTopFocusWindow()
26 xWriterEdit = xMainWindow.getChild("writer_edit")
28 self.xUITest.executeCommand(".uno:Sidebar")
30 xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
32 # wait until the navigator panel is available
33 xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
35 xContentTree = xNavigatorPanel.getChild("contenttree")
37 xReferences = self.get_item(xContentTree, 'References')
38 self.assertEqual('References', get_state_as_dict(xReferences)['Text'])
40 # tdf#129625: Without the fix in place, this test would have failed with
41 # AssertionError: 'true' != 'false'
42 self.assertEqual('true', get_state_as_dict(xReferences)['IsSemiTransparent'])
44 xIndexes = self.get_item(xContentTree, 'Indexes')
45 self.assertEqual('Indexes', get_state_as_dict(xIndexes)['Text'])
46 self.assertEqual('false', get_state_as_dict(xIndexes)['IsSemiTransparent'])
48 xIndexes.executeAction("EXPAND", tuple())
50 self.assertEqual('3', get_state_as_dict(xIndexes)['Children'])
52 for i in range(3):
53 # Without the fix in place, this test would have failed here with
54 # AssertionError: 'false' != 'true'
55 self.assertEqual('false', get_state_as_dict(xIndexes.getChild(i))['IsSemiTransparent'])
57 xIndexes.executeAction("COLLAPSE", tuple())
59 self.xUITest.executeCommand(".uno:Sidebar")
61 # vim: set shiftwidth=4 softtabstop=4 expandtab: