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_by_text
, select_pos
13 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
16 # Bug 123520 - Y axis - positioning tab, textbox "Cross other axis at" date changed
17 class tdf123520(UITestCase
):
18 def test_tdf123520_chart_y_cross_other_axis(self
):
19 with self
.ui_test
.load_file(get_url_for_data_file("tdf123520.ods")):
20 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
21 gridwin
= xCalcDoc
.getChild("grid_window")
23 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
24 gridwin
.executeAction("ACTIVATE", tuple())
25 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
26 xChartMain
= xChartMainTop
.getChild("chart_window")
27 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
28 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog
:
29 #Click on tab "positioning".
30 tabcontrol
= xDialog
.getChild("tabcontrol")
31 select_pos(tabcontrol
, "1")
33 crossAxisValue
= xDialog
.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
34 placeLabels
= xDialog
.getChild("LB_PLACE_LABELS")
35 crossAxisValue
.executeAction("CLEAR", tuple())
36 crossAxisValue
.executeAction("TYPE", mkPropertyValues({"TEXT":"01.01.2018"}))
37 #crossAxisValue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"TAB"}))
38 #TAB doesn't works- add "a" at the end of textbox
39 #workaround - edit another ui item, it should trigger leave of textbox
40 select_by_text(placeLabels
, "Outside start")
42 #reopen and verify tab "positioning".
43 gridwin
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
44 gridwin
.executeAction("ACTIVATE", tuple())
45 xChartMainTop
= self
.xUITest
.getTopFocusWindow()
46 xChartMain
= xChartMainTop
.getChild("chart_window")
47 xSeriesObj
= xChartMain
.getChild("CID/D=0:CS=0:CT=0:Series=0")
48 with self
.ui_test
.execute_dialog_through_action(xSeriesObj
, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog
:
50 tabcontrol
= xDialog
.getChild("tabcontrol")
51 select_pos(tabcontrol
, "1")
53 crossAxis
= xDialog
.getChild("LB_CROSSES_OTHER_AXIS_AT")
54 crossAxisValue
= xDialog
.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
55 placeLabels
= xDialog
.getChild("LB_PLACE_LABELS")
57 self
.assertEqual(get_state_as_dict(crossAxis
)["SelectEntryText"], "Value")
58 self
.assertEqual(get_state_as_dict(crossAxisValue
)["Text"], "01.01.2018")
59 self
.assertEqual(get_state_as_dict(placeLabels
)["SelectEntryText"], "Outside start")
62 # vim: set shiftwidth=4 softtabstop=4 expandtab: