Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / qa / uitest / chart / tdf138556.py
blob3fc7bb19734d6c853e5bbd0876974c5bf9a3e9b3
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 libreoffice.uno.propertyvalue import mkPropertyValues
12 from uitest.framework import UITestCase
14 class tdf138556( UITestCase ):
16 def test_stock_chart13_insert_series( self ):
17 #Start LibreOffice Writer
18 with self.ui_test.create_doc_in_start_center( "writer" ):
20 #Insert Chart
21 self.xUITest.executeCommand( ".uno:InsertObjectChart" )
22 xChartMainTop = self.xUITest.getTopFocusWindow()
23 xChartMain = xChartMainTop.getChild( "chart_window" )
24 xChart = xChartMain.getChild( "CID/Page=" )
26 #Change Chart Type to Stock 1
27 #TODO: test other subtypes
28 with self.ui_test.execute_dialog_through_action( xChart, "COMMAND", mkPropertyValues({ "COMMAND" : "DiagramType" })) as xDialog:
29 xChartType = xDialog.getChild( "charttype" )
30 xStockType = xChartType.getChild( "8" )
31 xStockType.executeAction( "SELECT", tuple())
33 #Insert Data Series
34 with self.ui_test.execute_dialog_through_action( xChart, "COMMAND", mkPropertyValues({ "COMMAND" : "DiagramData" }), close_button="close") as xDialog:
35 xToolbar = xDialog.getChild( "toolbar" )
36 xToolbar.executeAction( "CLICK", mkPropertyValues({ "POS" : "1" }))
38 #Check Number of Sequences
39 xDocument = self.ui_test.get_component()
40 nSequences = len( xDocument.FirstDiagram.
41 CoordinateSystems[0].ChartTypes[0].DataSeries[0].DataSequences )
42 self.assertEqual( nSequences, 3 )
44 # vim: set shiftwidth=4 softtabstop=4 expandtab: