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/.
9 from uitest
.framework
import UITestCase
10 from uitest
.uihelper
.common
import get_state_as_dict
, get_url_for_data_file
11 from uitest
.uihelper
.common
import select_pos
13 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
16 # Bug 123231 - Chart set trendline format regression type Power twice
17 class tdf123231(UITestCase
):
18 def test_tdf123231_chart_trendline_dialog_power(self
):
19 with self
.ui_test
.load_file(get_url_for_data_file("tdf93506.ods")):
20 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
21 gridwin
= xCalcDoc
.getChild("grid_window")
23 #Change regression Type to Power
24 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
25 gridwin
.executeAction("ACTIVATE", tuple())
26 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
27 xChartMain
= xChartMainTop
.getChild("chart_window")
28 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
29 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
31 tabcontrol
= xDialog
.getChild("tabcontrol")
32 select_pos(tabcontrol
, "0")
33 power
= xDialog
.getChild("exponential") #type regression power
35 power
.executeAction("CLICK", tuple()) #set power
37 #reopen dialog and close dialog
38 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
39 gridwin
.executeAction("ACTIVATE", tuple())
40 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
41 xChartMain
= xChartMainTop
.getChild("chart_window")
42 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
43 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
45 tabcontrol
= xDialog
.getChild("tabcontrol")
46 select_pos(tabcontrol
, "0")
47 power
= xDialog
.getChild("exponential") #type regression power
48 self
.assertEqual(get_state_as_dict(power
)["Checked"], "true")
50 #reopen and verify Power
51 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
52 gridwin
.executeAction("ACTIVATE", tuple())
53 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
54 xChartMain
= xChartMainTop
.getChild("chart_window")
55 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
56 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
58 tabcontrol
= xDialog
.getChild("tabcontrol")
59 select_pos(tabcontrol
, "0")
60 power
= xDialog
.getChild("exponential") #type regression power
62 self
.assertEqual(get_state_as_dict(power
)["Checked"], "true")
65 # vim: set shiftwidth=4 softtabstop=4 expandtab: