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 change_measurement_unit
, select_by_text
, select_pos
11 from uitest
.uihelper
.common
import get_state_as_dict
, get_url_for_data_file
13 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
16 # Bug 93506 - Crash when selecting chart containing a trend line
17 # test all dialog items - trend Line dialog
18 class tdf93506(UITestCase
):
19 def test_tdf93506_chart_trendline_dialog(self
):
20 with self
.ui_test
.load_file(get_url_for_data_file("tdf93506.ods")):
22 with
change_measurement_unit(self
, "Centimeter"):
23 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
24 gridwin
= xCalcDoc
.getChild("grid_window")
26 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
27 gridwin
.executeAction("ACTIVATE", tuple())
28 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
29 xChartMain
= xChartMainTop
.getChild("chart_window")
30 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
31 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
33 tabcontrol
= xDialog
.getChild("tabcontrol")
34 select_pos(tabcontrol
, "0")
36 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
37 xentryname
= xDialog
.getChild("entry_name") #add name
38 extrapolateForward
= xDialog
.getChild("extrapolateForward")
39 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
40 setIntercept
= xDialog
.getChild("setIntercept")
41 interceptValue
= xDialog
.getChild("interceptValue")
42 showEquation
= xDialog
.getChild("showEquation")
43 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
44 xVarname
= xDialog
.getChild("entry_Xname")
45 yVarName
= xDialog
.getChild("entry_Yname")
47 logarithmic
.executeAction("CLICK", tuple())
48 xentryname
.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"}))
49 extrapolateForward
.executeAction("UP", tuple())
50 extrapolateBackward
.executeAction("UP", tuple())
51 showEquation
.executeAction("CLICK", tuple())
52 showCorrelationCoefficient
.executeAction("CLICK", tuple())
53 xVarname
.executeAction("CLEAR", tuple())
54 xVarname
.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
55 yVarName
.executeAction("CLEAR", tuple())
56 yVarName
.executeAction("TYPE", mkPropertyValues({"TEXT":"f(a)"}))
59 select_pos(tabcontrol
, "1")
61 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
62 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
64 xWidth
.executeAction("UP", tuple())
65 xTransparent
.executeAction("UP", tuple())
66 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
67 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
71 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
72 gridwin
.executeAction("ACTIVATE", tuple())
73 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
74 xChartMain
= xChartMainTop
.getChild("chart_window")
75 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
76 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
78 tabcontrol
= xDialog
.getChild("tabcontrol")
79 select_pos(tabcontrol
, "0")
81 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
82 xentryname
= xDialog
.getChild("entry_name") #add name
83 extrapolateForward
= xDialog
.getChild("extrapolateForward")
84 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
85 setIntercept
= xDialog
.getChild("setIntercept")
86 interceptValue
= xDialog
.getChild("interceptValue")
87 showEquation
= xDialog
.getChild("showEquation")
88 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
89 xVarname
= xDialog
.getChild("entry_Xname")
90 yVarName
= xDialog
.getChild("entry_Yname")
92 self
.assertEqual(get_state_as_dict(logarithmic
)["Checked"], "true")
93 self
.assertEqual(get_state_as_dict(xentryname
)["Text"], "Name")
94 self
.assertEqual(get_state_as_dict(extrapolateForward
)["Text"], "1")
95 self
.assertEqual(get_state_as_dict(extrapolateBackward
)["Text"], "1")
96 self
.assertEqual(get_state_as_dict(showEquation
)["Selected"], "true")
97 self
.assertEqual(get_state_as_dict(showCorrelationCoefficient
)["Selected"], "true")
98 self
.assertEqual(get_state_as_dict(xVarname
)["Text"], "a")
99 self
.assertEqual(get_state_as_dict(yVarName
)["Text"], "f(a)")
101 #Click on tab "Line".
102 select_pos(tabcontrol
, "1")
103 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
104 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
106 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
107 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
110 #Now change regression Type to Exponential
111 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
112 gridwin
.executeAction("ACTIVATE", tuple())
113 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
114 xChartMain
= xChartMainTop
.getChild("chart_window")
115 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
116 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
117 #Click on tab "Type".
118 tabcontrol
= xDialog
.getChild("tabcontrol")
119 select_pos(tabcontrol
, "0")
120 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
121 exponential
= xDialog
.getChild("exponential") #type regression exponential
122 xentryname
= xDialog
.getChild("entry_name") #add name
123 extrapolateForward
= xDialog
.getChild("extrapolateForward")
124 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
125 setIntercept
= xDialog
.getChild("setIntercept")
126 interceptValue
= xDialog
.getChild("interceptValue")
127 showEquation
= xDialog
.getChild("showEquation")
128 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
129 xVarname
= xDialog
.getChild("entry_Xname")
130 yVarName
= xDialog
.getChild("entry_Yname")
132 exponential
.executeAction("CLICK", tuple()) #set exponential
134 setIntercept
.executeAction("CLICK", tuple())
135 interceptValue
.executeAction("UP", tuple())
137 #Click on tab "Line".
138 select_pos(tabcontrol
, "1")
139 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
140 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
142 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
143 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
146 #reopen and verify Exponential
147 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
148 gridwin
.executeAction("ACTIVATE", tuple())
149 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
150 xChartMain
= xChartMainTop
.getChild("chart_window")
151 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
152 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
153 #Click on tab "Type".
154 tabcontrol
= xDialog
.getChild("tabcontrol")
155 select_pos(tabcontrol
, "0")
157 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
158 exponential
= xDialog
.getChild("exponential") #type regression exponential
159 xentryname
= xDialog
.getChild("entry_name") #add name
160 extrapolateForward
= xDialog
.getChild("extrapolateForward")
161 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
162 setIntercept
= xDialog
.getChild("setIntercept")
163 interceptValue
= xDialog
.getChild("interceptValue")
164 showEquation
= xDialog
.getChild("showEquation")
165 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
166 xVarname
= xDialog
.getChild("entry_Xname")
167 yVarName
= xDialog
.getChild("entry_Yname")
169 self
.assertEqual(get_state_as_dict(exponential
)["Checked"], "true")
170 self
.assertEqual(get_state_as_dict(xentryname
)["Text"], "Name")
171 self
.assertEqual(get_state_as_dict(extrapolateForward
)["Text"], "1")
172 self
.assertEqual(get_state_as_dict(extrapolateBackward
)["Text"], "1")
173 self
.assertEqual(get_state_as_dict(showEquation
)["Selected"], "true")
174 self
.assertEqual(get_state_as_dict(setIntercept
)["Selected"], "true")
175 self
.assertEqual(get_state_as_dict(interceptValue
)["Text"], "1")
176 self
.assertEqual(get_state_as_dict(showCorrelationCoefficient
)["Selected"], "true")
177 self
.assertEqual(get_state_as_dict(xVarname
)["Text"], "a")
178 self
.assertEqual(get_state_as_dict(yVarName
)["Text"], "f(a)")
180 #Click on tab "Line".
181 select_pos(tabcontrol
, "1")
182 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
183 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
185 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
186 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
189 #Now change regression Type to Power
190 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
191 gridwin
.executeAction("ACTIVATE", tuple())
192 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
193 xChartMain
= xChartMainTop
.getChild("chart_window")
194 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
195 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
196 #Click on tab "Type".
197 tabcontrol
= xDialog
.getChild("tabcontrol")
198 select_pos(tabcontrol
, "0")
199 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
200 exponential
= xDialog
.getChild("exponential") #type regression exponential
201 power
= xDialog
.getChild("exponential") #type regression power
202 xentryname
= xDialog
.getChild("entry_name") #add name
203 extrapolateForward
= xDialog
.getChild("extrapolateForward")
204 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
205 setIntercept
= xDialog
.getChild("setIntercept")
206 interceptValue
= xDialog
.getChild("interceptValue")
207 showEquation
= xDialog
.getChild("showEquation")
208 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
209 xVarname
= xDialog
.getChild("entry_Xname")
210 yVarName
= xDialog
.getChild("entry_Yname")
212 power
.executeAction("CLICK", tuple()) #set power
214 #Click on tab "Line".
215 select_pos(tabcontrol
, "1")
216 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
217 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
219 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
220 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
223 #reopen and verify Power
224 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
225 gridwin
.executeAction("ACTIVATE", tuple())
226 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
227 xChartMain
= xChartMainTop
.getChild("chart_window")
228 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
229 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
230 #Click on tab "Type".
231 tabcontrol
= xDialog
.getChild("tabcontrol")
232 select_pos(tabcontrol
, "0")
234 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
235 exponential
= xDialog
.getChild("exponential") #type regression exponential
236 power
= xDialog
.getChild("exponential") #type regression power
237 xentryname
= xDialog
.getChild("entry_name") #add name
238 extrapolateForward
= xDialog
.getChild("extrapolateForward")
239 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
240 setIntercept
= xDialog
.getChild("setIntercept")
241 interceptValue
= xDialog
.getChild("interceptValue")
242 showEquation
= xDialog
.getChild("showEquation")
243 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
244 xVarname
= xDialog
.getChild("entry_Xname")
245 yVarName
= xDialog
.getChild("entry_Yname")
247 self
.assertEqual(get_state_as_dict(power
)["Checked"], "true")
248 self
.assertEqual(get_state_as_dict(xentryname
)["Text"], "Name")
249 self
.assertEqual(get_state_as_dict(extrapolateForward
)["Text"], "1")
250 self
.assertEqual(get_state_as_dict(extrapolateBackward
)["Text"], "1")
251 self
.assertEqual(get_state_as_dict(showEquation
)["Selected"], "true")
252 # self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true")
253 # self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1")
254 self
.assertEqual(get_state_as_dict(showCorrelationCoefficient
)["Selected"], "true")
255 self
.assertEqual(get_state_as_dict(xVarname
)["Text"], "a")
256 self
.assertEqual(get_state_as_dict(yVarName
)["Text"], "f(a)")
258 #Click on tab "Line".
259 select_pos(tabcontrol
, "1")
260 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
261 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
263 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
264 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
267 #Now change regression Type to Polynomial
268 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
269 gridwin
.executeAction("ACTIVATE", tuple())
270 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
271 xChartMain
= xChartMainTop
.getChild("chart_window")
272 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
273 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
274 #Click on tab "Type".
275 tabcontrol
= xDialog
.getChild("tabcontrol")
276 select_pos(tabcontrol
, "0")
277 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
278 exponential
= xDialog
.getChild("exponential") #type regression exponential
279 power
= xDialog
.getChild("exponential") #type regression power
280 polynomial
= xDialog
.getChild("polynomial") #type regression polynomial
281 degree
= xDialog
.getChild("degree")
282 xentryname
= xDialog
.getChild("entry_name") #add name
283 extrapolateForward
= xDialog
.getChild("extrapolateForward")
284 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
285 setIntercept
= xDialog
.getChild("setIntercept")
286 interceptValue
= xDialog
.getChild("interceptValue")
287 showEquation
= xDialog
.getChild("showEquation")
288 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
289 xVarname
= xDialog
.getChild("entry_Xname")
290 yVarName
= xDialog
.getChild("entry_Yname")
292 polynomial
.executeAction("CLICK", tuple()) #set polynomial
293 degree
.executeAction("UP", tuple())
295 #Click on tab "Line".
296 select_pos(tabcontrol
, "1")
297 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
298 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
300 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
301 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
304 #reopen and verify Polynomial
305 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
306 gridwin
.executeAction("ACTIVATE", tuple())
307 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
308 xChartMain
= xChartMainTop
.getChild("chart_window")
309 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
310 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
311 #Click on tab "Type".
312 tabcontrol
= xDialog
.getChild("tabcontrol")
313 select_pos(tabcontrol
, "0")
315 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
316 exponential
= xDialog
.getChild("exponential") #type regression exponential
317 power
= xDialog
.getChild("exponential") #type regression power
318 polynomial
= xDialog
.getChild("polynomial") #type regression polynomial
319 degree
= xDialog
.getChild("degree")
320 xentryname
= xDialog
.getChild("entry_name") #add name
321 extrapolateForward
= xDialog
.getChild("extrapolateForward")
322 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
323 setIntercept
= xDialog
.getChild("setIntercept")
324 interceptValue
= xDialog
.getChild("interceptValue")
325 showEquation
= xDialog
.getChild("showEquation")
326 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
327 xVarname
= xDialog
.getChild("entry_Xname")
328 yVarName
= xDialog
.getChild("entry_Yname")
330 self
.assertEqual(get_state_as_dict(polynomial
)["Checked"], "true")
331 self
.assertEqual(get_state_as_dict(degree
)["Text"], "3")
332 self
.assertEqual(get_state_as_dict(xentryname
)["Text"], "Name")
333 self
.assertEqual(get_state_as_dict(extrapolateForward
)["Text"], "1")
334 self
.assertEqual(get_state_as_dict(extrapolateBackward
)["Text"], "1")
335 self
.assertEqual(get_state_as_dict(showEquation
)["Selected"], "true")
336 self
.assertEqual(get_state_as_dict(setIntercept
)["Selected"], "true")
337 self
.assertEqual(get_state_as_dict(interceptValue
)["Text"], "1")
338 self
.assertEqual(get_state_as_dict(showCorrelationCoefficient
)["Selected"], "true")
339 self
.assertEqual(get_state_as_dict(xVarname
)["Text"], "a")
340 self
.assertEqual(get_state_as_dict(yVarName
)["Text"], "f(a)")
342 #Click on tab "Line".
343 select_pos(tabcontrol
, "1")
344 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
345 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
347 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
348 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
351 #Now change regression Type to Moving average
352 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
353 gridwin
.executeAction("ACTIVATE", tuple())
354 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
355 xChartMain
= xChartMainTop
.getChild("chart_window")
356 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
357 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
358 #Click on tab "Type".
359 tabcontrol
= xDialog
.getChild("tabcontrol")
360 select_pos(tabcontrol
, "0")
361 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
362 exponential
= xDialog
.getChild("exponential") #type regression exponential
363 power
= xDialog
.getChild("exponential") #type regression power
364 movingAverage
= xDialog
.getChild("movingAverage") #type regression Moving average
365 movingAverageType
= xDialog
.getChild("combo_moving_type") #type regression Moving average type
366 period
= xDialog
.getChild("period")
367 xentryname
= xDialog
.getChild("entry_name") #add name
368 extrapolateForward
= xDialog
.getChild("extrapolateForward")
369 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
370 setIntercept
= xDialog
.getChild("setIntercept")
371 interceptValue
= xDialog
.getChild("interceptValue")
372 showEquation
= xDialog
.getChild("showEquation")
373 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
374 xVarname
= xDialog
.getChild("entry_Xname")
375 yVarName
= xDialog
.getChild("entry_Yname")
377 movingAverage
.executeAction("CLICK", tuple()) #set polynomial
378 select_by_text(movingAverageType
, "Averaged Abscissa")
379 period
.executeAction("UP", tuple())
381 #Click on tab "Line".
382 select_pos(tabcontrol
, "1")
383 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
384 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
386 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
387 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
390 #reopen and verify Moving average
391 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
392 gridwin
.executeAction("ACTIVATE", tuple())
393 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
394 xChartMain
= xChartMainTop
.getChild("chart_window")
395 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
396 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog
:
397 #Click on tab "Type".
398 tabcontrol
= xDialog
.getChild("tabcontrol")
399 select_pos(tabcontrol
, "0")
401 logarithmic
= xDialog
.getChild("logarithmic") #type regression logarithmic
402 exponential
= xDialog
.getChild("exponential") #type regression exponential
403 power
= xDialog
.getChild("exponential") #type regression power
404 polynomial
= xDialog
.getChild("polynomial") #type regression polynomial
405 movingAverage
= xDialog
.getChild("movingAverage") #type regression Moving average
406 movingAverageType
= xDialog
.getChild("combo_moving_type") #type regression Moving average type
407 degree
= xDialog
.getChild("degree")
408 period
= xDialog
.getChild("period")
409 xentryname
= xDialog
.getChild("entry_name") #add name
410 extrapolateForward
= xDialog
.getChild("extrapolateForward")
411 extrapolateBackward
= xDialog
.getChild("extrapolateBackward")
412 setIntercept
= xDialog
.getChild("setIntercept")
413 interceptValue
= xDialog
.getChild("interceptValue")
414 showEquation
= xDialog
.getChild("showEquation")
415 showCorrelationCoefficient
= xDialog
.getChild("showCorrelationCoefficient")
416 xVarname
= xDialog
.getChild("entry_Xname")
417 yVarName
= xDialog
.getChild("entry_Yname")
419 self
.assertEqual(get_state_as_dict(movingAverage
)["Checked"], "true")
420 self
.assertEqual(get_state_as_dict(movingAverageType
)["SelectEntryText"], "Averaged Abscissa")
421 self
.assertEqual(get_state_as_dict(period
)["Text"], "3")
422 self
.assertEqual(get_state_as_dict(xentryname
)["Text"], "Name")
424 #Click on tab "Line".
425 select_pos(tabcontrol
, "1")
426 xWidth
= xDialog
.getChild("MTR_FLD_LINE_WIDTH")
427 xTransparent
= xDialog
.getChild("MTR_LINE_TRANSPARENT")
429 self
.assertEqual(get_state_as_dict(xWidth
)["Text"], "0.10 cm")
430 self
.assertEqual(get_state_as_dict(xTransparent
)["Text"], "5%")
433 # vim: set shiftwidth=4 softtabstop=4 expandtab: