Debian Codegraph @

sw/qa/uitest/styleInspector/tdf137105.py

raw symbols SCIP
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
2 #
3 # This file is part of the LibreOffice project.
4 #
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/.
8 #
9
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
13
14 class tdf137105(UITestCase):
15
16 def test_tdf137105(self):
17 with self.ui_test.create_doc_in_start_center("writer") as document:
18 xWriterDoc = self.xUITest.getTopFocusWindow()
19 text = document.getText()
20 cursor = text.createTextCursor()
21 textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
22 provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
23 graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")}))
24 textGraphic.Graphic = graphic
25 text.insertTextContent(cursor, textGraphic, False)
26 #select image
27 document.getCurrentController().select(document.getDrawPage()[0])
28
29 xWriterEdit = xWriterDoc.getChild("writer_edit")
30
31 self.xUITest.executeCommand(".uno:Sidebar")
32 # Without the fix in place, this test would have crashed here
33 xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"}))
34
35 # if the image is selected, there is nothing in the panel
36 self.assertEqual('0', get_state_as_dict(xWriterEdit.getChild('listbox_fonts'))['Children'])
37
38 self.xUITest.executeCommand(".uno:Sidebar")
39
40
41 # vim: set shiftwidth=4 softtabstop=4 expandtab: