Debian Codegraph @

sw/qa/uitest/writer_tests4/tdf148395.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
13
14 class Tdf148395(UITestCase):
15
16 def test_tdf148395(self):
17
18 with self.ui_test.create_doc_in_start_center("writer") as document:
19
20 with self.ui_test.execute_dialog_through_command(".uno:InsertObject") as xDialog:
21 xTypes = xDialog.getChild("types")
22 xCreateNew = xDialog.getChild("createnew")
23
24 self.assertEqual('true', get_state_as_dict(xCreateNew)['Checked'])
25
26 xSelectedEntry = get_state_as_dict(xTypes)['SelectEntryText']
27 self.assertTrue('Spreadsheet' in xSelectedEntry )
28
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
34
35 self.assertEqual(1, document.EmbeddedObjects.Count)
36 self.assertEqual("SwXTextEmbeddedObject", document.CurrentSelection.getImplementationName())
37
38 xChartMainTop = self.xUITest.getTopFocusWindow()
39 xChartMain = xChartMainTop.getChild("chart_window")
40 xSeriesObj = xChartMain.getChild("CID/Page=")
41
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
45
46 # vim: set shiftwidth=4 softtabstop=4 expandtab: