Get the style color and number just once
[LibreOffice.git] / sw / qa / uitest / writer_tests4 / tdf148395.py
blob233b4f2363b475cbb6905f5f1ebb9dbfb8d0a82e
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
14 class Tdf148395(UITestCase):
16 def test_tdf148395(self):
18 with self.ui_test.create_doc_in_start_center("writer") as document:
20 with self.ui_test.execute_dialog_through_command(".uno:InsertObject") as xDialog:
21 xTypes = xDialog.getChild("types")
22 xCreateNew = xDialog.getChild("createnew")
24 self.assertEqual('true', get_state_as_dict(xCreateNew)['Checked'])
26 xSelectedEntry = get_state_as_dict(xTypes)['SelectEntryText']
27 self.assertTrue('Spreadsheet' in xSelectedEntry )
29 for i in range(10):
30 xTypes.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
31 xSelectedEntry = get_state_as_dict(xTypes)['SelectEntryText']
32 if 'Chart' in xSelectedEntry:
33 break
35 self.assertEqual(1, document.EmbeddedObjects.Count)
36 self.assertEqual("SwXTextEmbeddedObject", document.CurrentSelection.getImplementationName())
38 xChartMainTop = self.xUITest.getTopFocusWindow()
39 xChartMain = xChartMainTop.getChild("chart_window")
40 xSeriesObj = xChartMain.getChild("CID/Page=")
42 # Without the fix in place, this test would have crashed here
43 with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog:
44 pass
46 # vim: set shiftwidth=4 softtabstop=4 expandtab: