Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / uitest / calc_tests / edit_chart.py
blobd74a8c2eced32bf2c14e9b86b3963b859ffb718d
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 from libreoffice.uno.propertyvalue import mkPropertyValues
10 from uitest.framework import UITestCase
11 from uitest.uihelper.calc import enter_text_to_cell
13 import unittest
15 class CalcChartEditUIDemo(UITestCase):
17 def fill_spreadsheet(self):
18 xCalcDoc = self.xUITest.getTopFocusWindow()
19 xGridWindow = xCalcDoc.getChild("grid_window")
21 enter_text_to_cell(xGridWindow, "A1", "col1")
22 enter_text_to_cell(xGridWindow, "B1", "col2")
23 enter_text_to_cell(xGridWindow, "C1", "col3")
24 enter_text_to_cell(xGridWindow, "A2", "1")
25 enter_text_to_cell(xGridWindow, "B2", "3")
26 enter_text_to_cell(xGridWindow, "C2", "5")
28 xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C2"}))
30 def test_select_secondary_axis(self):
32 self.ui_test.create_doc_in_start_center("calc")
34 self.fill_spreadsheet()
36 xCalcDoc = self.xUITest.getTopFocusWindow()
37 xGridWindow = xCalcDoc.getChild("grid_window")
39 self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
41 xChartDlg = self.xUITest.getTopFocusWindow()
43 xNextBtn = xChartDlg.getChild("finish")
44 self.ui_test.close_dialog_through_button(xNextBtn)
46 xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
48 xGridWindow.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
50 xGridWindow.executeAction("ACTIVATE", tuple())
52 xChartMainTop = self.xUITest.getTopFocusWindow()
53 xChartMain = xChartMainTop.getChild("chart_window")
55 xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
56 self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"}))
58 xSeriesFormatDlg = self.xUITest.getTopFocusWindow()
59 xAxis2 = xSeriesFormatDlg.getChild("RBT_OPT_AXIS_2")
60 xAxis2.executeAction("CLICK", tuple())
62 xCancelBtn = xSeriesFormatDlg.getChild("ok")
63 xCancelBtn.executeAction("CLICK", tuple())
65 xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
67 self.ui_test.close_doc()
69 # vim: set shiftwidth=4 softtabstop=4 expandtab: