diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-06 13:52:58 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-07 09:33:40 +0000 |
commit | 7355c2ee8a9f0811d1cd3d37fc9dac2ad5f95774 (patch) | |
tree | a5fd1f08a00eac447ca2e6b8da00c75cfa947442 /sc/qa/uitest/chart | |
parent | ca57cee2ae5718378193a9c7050248c63b5fa47e (diff) |
uitest: reset value when changing the measurement unit
Otherwise, changing it in one test might affect other tests
Use @contextmanager decorator to change it back to default 'Inch'
at the end of the test even if the test hits an assert
Change-Id: I1e7b35019cd19b490aa619c0a866bb9f93820950
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146583
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/uitest/chart')
-rw-r--r-- | sc/qa/uitest/chart/chartArea.py | 268 | ||||
-rw-r--r-- | sc/qa/uitest/chart/chartDataLabels.py | 40 | ||||
-rw-r--r-- | sc/qa/uitest/chart/chartGrid.py | 274 | ||||
-rw-r--r-- | sc/qa/uitest/chart/chartLegend.py | 38 | ||||
-rw-r--r-- | sc/qa/uitest/chart/chartTitles.py | 38 | ||||
-rw-r--r-- | sc/qa/uitest/chart/chartWall.py | 246 | ||||
-rw-r--r-- | sc/qa/uitest/chart/chartXAxis.py | 438 | ||||
-rw-r--r-- | sc/qa/uitest/chart/chartYAxis.py | 442 | ||||
-rw-r--r-- | sc/qa/uitest/chart/formatDataSeries.py | 148 | ||||
-rw-r--r-- | sc/qa/uitest/chart/tdf93506_trendline.py | 820 |
10 files changed, 1376 insertions, 1376 deletions
diff --git a/sc/qa/uitest/chart/chartArea.py b/sc/qa/uitest/chart/chartArea.py index 44040f8e835f..520ab8e83a2d 100644 --- a/sc/qa/uitest/chart/chartArea.py +++ b/sc/qa/uitest/chart/chartArea.py @@ -17,139 +17,139 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class chartArea(UITestCase): def test_chart_area_dialog(self): with self.ui_test.load_file(get_url_for_data_file("chartArea.ods")) as calc_doc: - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - - change_measurement_unit(self, "Centimeter") - - xArea = calc_doc.Sheets[0].Charts[0].getEmbeddedObject().Area - self.assertEqual(xArea.LineWidth, 0) - self.assertEqual(xArea.LineTransparence, 0) - self.assertEqual(hex(xArea.FillColor), '0xffffff') - self.assertEqual(xArea.FillTransparence, 0) - - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: - #Click on tab "Borders". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) - - - self.assertEqual(xArea.LineWidth, 100) - self.assertEqual(xArea.LineTransparence, 5) - self.assertEqual(hex(xArea.FillColor), '0xffffff') - self.assertEqual(xArea.FillTransparence, 0) - - #reopen and verify tab "Borders". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - - #Click on tab "Area" - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - btncolor = xDialog.getChild("btncolor") - btncolor.executeAction("CLICK", tuple()) - - rCustom = xDialog.getChild("R_custom") - gCustom = xDialog.getChild("G_custom") - bCustom = xDialog.getChild("B_custom") - - rCustom.executeAction("CLEAR", tuple()) - rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"})) - rCustom.executeAction("UP", tuple()) - rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works - self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") - gCustom.executeAction("CLEAR", tuple()) - gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"})) - gCustom.executeAction("UP", tuple()) - gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works - bCustom.executeAction("CLEAR", tuple()) - bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"})) - bCustom.executeAction("UP", tuple()) - bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works - - self.assertEqual(xArea.LineWidth, 100) - self.assertEqual(xArea.LineTransparence, 5) - self.assertEqual(hex(xArea.FillColor), '0x23a9d3') - self.assertEqual(xArea.FillTransparence, 0) - - #reopen and verify tab "Area". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - rCustom = xDialog.getChild("R_custom") - gCustom = xDialog.getChild("G_custom") - bCustom = xDialog.getChild("B_custom") - - self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") - self.assertEqual(get_state_as_dict(gCustom)["Text"], "169") - self.assertEqual(get_state_as_dict(bCustom)["Text"], "211") - - #change tab "Transparency" - select_pos(tabcontrol, "2") - transparency = xDialog.getChild("RBT_TRANS_LINEAR") - transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% - - transparency.executeAction("CLICK", tuple()) - transparencyPercent.executeAction("UP", tuple()) - - - self.assertEqual(xArea.LineWidth, 100) - self.assertEqual(xArea.LineTransparence, 5) - self.assertEqual(hex(xArea.FillColor), '0x23a9d3') - self.assertEqual(xArea.FillTransparence, 51) - - #reopen and verify tab "Transparency" - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "2") - - transparency = xDialog.getChild("RBT_TRANS_LINEAR") - transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% - - self.assertEqual(get_state_as_dict(transparency)["Checked"], "true") - self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%") - - - self.assertEqual(xArea.LineWidth, 100) - self.assertEqual(xArea.LineTransparence, 5) - self.assertEqual(hex(xArea.FillColor), '0x23a9d3') - self.assertEqual(xArea.FillTransparence, 51) + + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + xArea = calc_doc.Sheets[0].Charts[0].getEmbeddedObject().Area + self.assertEqual(xArea.LineWidth, 0) + self.assertEqual(xArea.LineTransparence, 0) + self.assertEqual(hex(xArea.FillColor), '0xffffff') + self.assertEqual(xArea.FillTransparence, 0) + + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: + #Click on tab "Borders". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) + + + self.assertEqual(xArea.LineWidth, 100) + self.assertEqual(xArea.LineTransparence, 5) + self.assertEqual(hex(xArea.FillColor), '0xffffff') + self.assertEqual(xArea.FillTransparence, 0) + + #reopen and verify tab "Borders". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + + #Click on tab "Area" + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + btncolor = xDialog.getChild("btncolor") + btncolor.executeAction("CLICK", tuple()) + + rCustom = xDialog.getChild("R_custom") + gCustom = xDialog.getChild("G_custom") + bCustom = xDialog.getChild("B_custom") + + rCustom.executeAction("CLEAR", tuple()) + rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"})) + rCustom.executeAction("UP", tuple()) + rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works + self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") + gCustom.executeAction("CLEAR", tuple()) + gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"})) + gCustom.executeAction("UP", tuple()) + gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works + bCustom.executeAction("CLEAR", tuple()) + bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"})) + bCustom.executeAction("UP", tuple()) + bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works + + self.assertEqual(xArea.LineWidth, 100) + self.assertEqual(xArea.LineTransparence, 5) + self.assertEqual(hex(xArea.FillColor), '0x23a9d3') + self.assertEqual(xArea.FillTransparence, 0) + + #reopen and verify tab "Area". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + rCustom = xDialog.getChild("R_custom") + gCustom = xDialog.getChild("G_custom") + bCustom = xDialog.getChild("B_custom") + + self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") + self.assertEqual(get_state_as_dict(gCustom)["Text"], "169") + self.assertEqual(get_state_as_dict(bCustom)["Text"], "211") + + #change tab "Transparency" + select_pos(tabcontrol, "2") + transparency = xDialog.getChild("RBT_TRANS_LINEAR") + transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% + + transparency.executeAction("CLICK", tuple()) + transparencyPercent.executeAction("UP", tuple()) + + + self.assertEqual(xArea.LineWidth, 100) + self.assertEqual(xArea.LineTransparence, 5) + self.assertEqual(hex(xArea.FillColor), '0x23a9d3') + self.assertEqual(xArea.FillTransparence, 51) + + #reopen and verify tab "Transparency" + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "2") + + transparency = xDialog.getChild("RBT_TRANS_LINEAR") + transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% + + self.assertEqual(get_state_as_dict(transparency)["Checked"], "true") + self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%") + + + self.assertEqual(xArea.LineWidth, 100) + self.assertEqual(xArea.LineTransparence, 5) + self.assertEqual(hex(xArea.FillColor), '0x23a9d3') + self.assertEqual(xArea.FillTransparence, 51) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartDataLabels.py b/sc/qa/uitest/chart/chartDataLabels.py index a6e00e599c47..b20180353472 100644 --- a/sc/qa/uitest/chart/chartDataLabels.py +++ b/sc/qa/uitest/chart/chartDataLabels.py @@ -256,35 +256,35 @@ class chartDataLabels(UITestCase): def test_tdf136573(self): with self.ui_test.load_file(get_url_for_data_file("dataLabels.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") - # Select the first label - xDataLabel = xChartMain.getChild("CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0") - xDataLabel.executeAction("SELECT", tuple()) + # Select the first label + xDataLabel = xChartMain.getChild("CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0") + xDataLabel.executeAction("SELECT", tuple()) - with self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + with self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - self.assertEqual("0.74", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("2.82", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + self.assertEqual("0.74", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("2.82", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) - # Use OK button in order to test tdf#137165 + # Use OK button in order to test tdf#137165 - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) - with self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + with self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - # Check the position has changed after moving the label using the arrows keys - self.assertEqual("0.64", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("2.72", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + # Check the position has changed after moving the label using the arrows keys + self.assertEqual("0.64", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("2.72", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartGrid.py b/sc/qa/uitest/chart/chartGrid.py index c54e03637ee7..bd017248adeb 100644 --- a/sc/qa/uitest/chart/chartGrid.py +++ b/sc/qa/uitest/chart/chartGrid.py @@ -17,184 +17,184 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class chartGrid(UITestCase): def test_tdf98390_chart_grid_dialog(self): with self.ui_test.load_file(get_url_for_data_file("tdf98390.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") - - #X Axis Major Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"})) as xDialog: - #tab "Line". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #X Axis Major Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"})) as xDialog: + #tab "Line". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify X Axis Major Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"})) as xDialog: + #reopen and verify X Axis Major Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - #Y Axis Major Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"})) as xDialog: + #Y Axis Major Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify Y Axis Major Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"})) as xDialog: + #reopen and verify Y Axis Major Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - #Y Axis Minor Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"})) as xDialog: + #Y Axis Minor Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify Y Axis Minor Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"})) as xDialog: + #reopen and verify Y Axis Minor Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - #X Axis Minor Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: + #X Axis Minor Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify X Axis Minor Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: + #reopen and verify X Axis Minor Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - #All Grids - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridAll"})) as xDialog: + #All Grids + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridAll"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify X Axis Minor Grid (changed in All Grids) - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: + #reopen and verify X Axis Minor Grid (changed in All Grids) + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.20 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "10%") + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.20 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "10%") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartLegend.py b/sc/qa/uitest/chart/chartLegend.py index 45938e23017d..a1cf40f44e2f 100644 --- a/sc/qa/uitest/chart/chartLegend.py +++ b/sc/qa/uitest/chart/chartLegend.py @@ -73,31 +73,31 @@ class chartLegend(UITestCase): def test_legends_move_with_arrows_keys(self): with self.ui_test.load_file(get_url_for_data_file("dataLabels.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") - # Select the legends - xLegends = xChartMain.getChild("CID/D=0:Legend=") - xLegends.executeAction("SELECT", tuple()) + # Select the legends + xLegends = xChartMain.getChild("CID/D=0:Legend=") + xLegends.executeAction("SELECT", tuple()) - with self.ui_test.execute_dialog_through_action(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - self.assertEqual("4.61", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("1.54", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + with self.ui_test.execute_dialog_through_action(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + self.assertEqual("4.61", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("1.54", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) - # Check the position has changed after moving the label using the arrows keys - with self.ui_test.execute_dialog_through_action(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - self.assertEqual("4.51", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("1.44", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + # Check the position has changed after moving the label using the arrows keys + with self.ui_test.execute_dialog_through_action(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + self.assertEqual("4.51", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("1.44", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) def test_Tdf147394(self): diff --git a/sc/qa/uitest/chart/chartTitles.py b/sc/qa/uitest/chart/chartTitles.py index cd1955b670e4..793b634922a6 100644 --- a/sc/qa/uitest/chart/chartTitles.py +++ b/sc/qa/uitest/chart/chartTitles.py @@ -86,34 +86,34 @@ class chartTitles(UITestCase): def test_title_move_with_arrows_keys(self): with self.ui_test.load_file(get_url_for_data_file("chartArea.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") - # Select the title - xTitle = xChartMain.getChild("CID/Title=") - xTitle.executeAction("SELECT", tuple()) + # Select the title + xTitle = xChartMain.getChild("CID/Title=") + xTitle.executeAction("SELECT", tuple()) - with self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + with self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - self.assertEqual("3.52", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("0.3", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + self.assertEqual("3.52", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("0.3", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) - with self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + with self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - # Check the position has changed after moving the title using the arrows keys - self.assertEqual("3.42", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("0.2", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + # Check the position has changed after moving the title using the arrows keys + self.assertEqual("3.42", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("0.2", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartWall.py b/sc/qa/uitest/chart/chartWall.py index 4ca6d240d465..8afacc0c54ba 100644 --- a/sc/qa/uitest/chart/chartWall.py +++ b/sc/qa/uitest/chart/chartWall.py @@ -17,154 +17,154 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class chartWall(UITestCase): def test_chart_wall_dialog(self): with self.ui_test.load_file(get_url_for_data_file("tdf122398.ods")) as calc_doc: - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - - change_measurement_unit(self, "Centimeter") - - xWall = calc_doc.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().Wall - self.assertEqual(xWall.LineWidth, 0) - self.assertEqual(xWall.LineTransparence, 0) - self.assertEqual(hex(xWall.FillColor), '0xe6e6e6') - self.assertEqual(xWall.FillTransparence, 0) - - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: - #Click on tab "Borders". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) - - - self.assertEqual(xWall.LineWidth, 100) - self.assertEqual(xWall.LineTransparence, 5) - self.assertEqual(hex(xWall.FillColor), '0xe6e6e6') - self.assertEqual(xWall.FillTransparence, 0) - - #reopen and verify tab "Borders". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + xWall = calc_doc.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().Wall + self.assertEqual(xWall.LineWidth, 0) + self.assertEqual(xWall.LineTransparence, 0) + self.assertEqual(hex(xWall.FillColor), '0xe6e6e6') + self.assertEqual(xWall.FillTransparence, 0) + + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: + #Click on tab "Borders". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) + self.assertEqual(xWall.LineWidth, 100) self.assertEqual(xWall.LineTransparence, 5) self.assertEqual(hex(xWall.FillColor), '0xe6e6e6') self.assertEqual(xWall.FillTransparence, 0) - #Click on tab "Area" - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - btncolor = xDialog.getChild("btncolor") - btncolor.executeAction("CLICK", tuple()) - - rCustom = xDialog.getChild("R_custom") - gCustom = xDialog.getChild("G_custom") - bCustom = xDialog.getChild("B_custom") - - rCustom.executeAction("CLEAR", tuple()) - rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"})) - rCustom.executeAction("UP", tuple()) - rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works - self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") - gCustom.executeAction("CLEAR", tuple()) - gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"})) - gCustom.executeAction("UP", tuple()) - gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works - bCustom.executeAction("CLEAR", tuple()) - bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"})) - bCustom.executeAction("UP", tuple()) - bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works - - self.assertEqual(xWall.LineWidth, 100) - self.assertEqual(xWall.LineTransparence, 5) - self.assertEqual(hex(xWall.FillColor), '0x23a9d3') - self.assertEqual(xWall.FillTransparence, 0) - - #reopen and verify tab "Area". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - rCustom = xDialog.getChild("R_custom") - gCustom = xDialog.getChild("G_custom") - bCustom = xDialog.getChild("B_custom") - - self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") - self.assertEqual(get_state_as_dict(gCustom)["Text"], "169") - self.assertEqual(get_state_as_dict(bCustom)["Text"], "211") + #reopen and verify tab "Borders". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + + self.assertEqual(xWall.LineWidth, 100) + self.assertEqual(xWall.LineTransparence, 5) + self.assertEqual(hex(xWall.FillColor), '0xe6e6e6') + self.assertEqual(xWall.FillTransparence, 0) + + #Click on tab "Area" + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + btncolor = xDialog.getChild("btncolor") + btncolor.executeAction("CLICK", tuple()) + + rCustom = xDialog.getChild("R_custom") + gCustom = xDialog.getChild("G_custom") + bCustom = xDialog.getChild("B_custom") + + rCustom.executeAction("CLEAR", tuple()) + rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"})) + rCustom.executeAction("UP", tuple()) + rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works + self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") + gCustom.executeAction("CLEAR", tuple()) + gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"})) + gCustom.executeAction("UP", tuple()) + gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works + bCustom.executeAction("CLEAR", tuple()) + bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"})) + bCustom.executeAction("UP", tuple()) + bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works self.assertEqual(xWall.LineWidth, 100) self.assertEqual(xWall.LineTransparence, 5) self.assertEqual(hex(xWall.FillColor), '0x23a9d3') self.assertEqual(xWall.FillTransparence, 0) - #change tab "Transparency" - select_pos(tabcontrol, "2") - transparency = xDialog.getChild("RBT_TRANS_LINEAR") - transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% + #reopen and verify tab "Area". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: - transparency.executeAction("CLICK", tuple()) - transparencyPercent.executeAction("UP", tuple()) + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + rCustom = xDialog.getChild("R_custom") + gCustom = xDialog.getChild("G_custom") + bCustom = xDialog.getChild("B_custom") - self.assertEqual(xWall.LineWidth, 100) - self.assertEqual(xWall.LineTransparence, 5) - self.assertEqual(hex(xWall.FillColor), '0x23a9d3') - self.assertEqual(xWall.FillTransparence, 51) + self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") + self.assertEqual(get_state_as_dict(gCustom)["Text"], "169") + self.assertEqual(get_state_as_dict(bCustom)["Text"], "211") - #reopen and verify tab "Transparency" - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: + self.assertEqual(xWall.LineWidth, 100) + self.assertEqual(xWall.LineTransparence, 5) + self.assertEqual(hex(xWall.FillColor), '0x23a9d3') + self.assertEqual(xWall.FillTransparence, 0) - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "2") + #change tab "Transparency" + select_pos(tabcontrol, "2") + transparency = xDialog.getChild("RBT_TRANS_LINEAR") + transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% - transparency = xDialog.getChild("RBT_TRANS_LINEAR") - transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% + transparency.executeAction("CLICK", tuple()) + transparencyPercent.executeAction("UP", tuple()) - self.assertEqual(get_state_as_dict(transparency)["Checked"], "true") - self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%") self.assertEqual(xWall.LineWidth, 100) self.assertEqual(xWall.LineTransparence, 5) self.assertEqual(hex(xWall.FillColor), '0x23a9d3') self.assertEqual(xWall.FillTransparence, 51) + #reopen and verify tab "Transparency" + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "2") - self.assertEqual(xWall.LineWidth, 100) - self.assertEqual(xWall.LineTransparence, 5) - self.assertEqual(hex(xWall.FillColor), '0x23a9d3') - self.assertEqual(xWall.FillTransparence, 51) + transparency = xDialog.getChild("RBT_TRANS_LINEAR") + transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% + + self.assertEqual(get_state_as_dict(transparency)["Checked"], "true") + self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%") + + self.assertEqual(xWall.LineWidth, 100) + self.assertEqual(xWall.LineTransparence, 5) + self.assertEqual(hex(xWall.FillColor), '0x23a9d3') + self.assertEqual(xWall.FillTransparence, 51) + + + self.assertEqual(xWall.LineWidth, 100) + self.assertEqual(xWall.LineTransparence, 5) + self.assertEqual(hex(xWall.FillColor), '0x23a9d3') + self.assertEqual(xWall.FillTransparence, 51) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartXAxis.py b/sc/qa/uitest/chart/chartXAxis.py index ea1878e4860f..c61cbd97ef01 100644 --- a/sc/qa/uitest/chart/chartXAxis.py +++ b/sc/qa/uitest/chart/chartXAxis.py @@ -18,225 +18,225 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class chartXAxis(UITestCase): def test_chart_x_axis_dialog(self): with self.ui_test.load_file(get_url_for_data_file("tdf122398.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - - change_measurement_unit(self, "Centimeter") - - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: - #Click on tab "Scale". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - reverseDirection = xDialog.getChild("CBX_REVERSE") - logarithmicScale = xDialog.getChild("CBX_LOGARITHM") - autoMinimum = xDialog.getChild("CBX_AUTO_MIN") - autoMaximum = xDialog.getChild("CBX_AUTO_MAX") - majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") - minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") - minimum = xDialog.getChild("EDT_MIN") - maximum = xDialog.getChild("EDT_MAX") - major = xDialog.getChild("EDT_STEP_MAIN") - minor = xDialog.getChild("MT_STEPHELP") - - reverseDirection.executeAction("CLICK", tuple()) - logarithmicScale.executeAction("CLICK", tuple()) - autoMinimum.executeAction("CLICK", tuple()) - autoMaximum.executeAction("CLICK", tuple()) - majorInterval.executeAction("CLICK", tuple()) - minorInterval.executeAction("CLICK", tuple()) - - minimum.executeAction("DOWN", tuple()) #10.12.2017 - maximum.executeAction("DOWN", tuple()) #29.04.2018 - major.executeAction("DOWN", tuple()) #19 - minor.executeAction("UP", tuple()) #3 - - #reopen and verify - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: - #Click on tab "Scale". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - reverseDirection = xDialog.getChild("CBX_REVERSE") - logarithmicScale = xDialog.getChild("CBX_LOGARITHM") - autoMinimum = xDialog.getChild("CBX_AUTO_MIN") - autoMaximum = xDialog.getChild("CBX_AUTO_MAX") - majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") - minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") - minimum = xDialog.getChild("EDT_MIN") - maximum = xDialog.getChild("EDT_MAX") - major = xDialog.getChild("EDT_STEP_MAIN") - minor = xDialog.getChild("MT_STEPHELP") - - self.assertEqual(get_state_as_dict(reverseDirection)["Selected"], "true") - self.assertEqual(get_state_as_dict(logarithmicScale)["Selected"], "true") - self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false") - self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false") - self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false") - self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false") - self.assertEqual(get_state_as_dict(minimum)["Text"], "10.12.2017") - self.assertEqual(get_state_as_dict(maximum)["Text"], "29.04.2018") - self.assertEqual(get_state_as_dict(major)["Text"], "19") - self.assertEqual(get_state_as_dict(minor)["Text"], "3") - - #Click on tab "positioning". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") - crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value - placeLabels = xDialog.getChild("LB_PLACE_LABELS") - innerMajorTick = xDialog.getChild("CB_TICKS_INNER") - outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") - innerMinorTick = xDialog.getChild("CB_MINOR_INNER") - outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") - placeMarks = xDialog.getChild("LB_PLACE_TICKS") - - select_by_text(crossAxis, "Start") - select_by_text(placeLabels, "Outside end") - innerMajorTick.executeAction("CLICK", tuple()) - outerMajorTick.executeAction("CLICK", tuple()) - innerMinorTick.executeAction("CLICK", tuple()) - outerMinorTick.executeAction("CLICK", tuple()) - select_by_text(placeMarks, "At axis") - - - #reopen and verify tab "positioning". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") - crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value - placeLabels = xDialog.getChild("LB_PLACE_LABELS") - innerMajorTick = xDialog.getChild("CB_TICKS_INNER") - outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") - innerMinorTick = xDialog.getChild("CB_MINOR_INNER") - outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") - placeMarks = xDialog.getChild("LB_PLACE_TICKS") - - self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Start") - self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") - self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false") - self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") - #change tab "positioning". - select_by_text(crossAxis, "Value") - crossAxisValue.executeAction("UP", tuple()) #1 - - - #reopen and verify tab "positioning". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") - crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value - placeLabels = xDialog.getChild("LB_PLACE_LABELS") - innerMajorTick = xDialog.getChild("CB_TICKS_INNER") - outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") - innerMinorTick = xDialog.getChild("CB_MINOR_INNER") - outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") - placeMarks = xDialog.getChild("LB_PLACE_TICKS") - - self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value") - self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "1") - self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") - self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false") - self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") - #change tab "Line". - select_pos(tabcontrol, "2") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) - - - #reopen and verify tab "Line". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "2") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - - #change tab "Label" - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "3") - - tile = xDialog.getChild("tile") - overlapCB = xDialog.getChild("overlapCB") - breakCB = xDialog.getChild("breakCB") - stackedCB = xDialog.getChild("stackedCB") - textdirLB = xDialog.getChild("textdirLB") - - tile.executeAction("CLICK", tuple()) - overlapCB.executeAction("CLICK", tuple()) - breakCB.executeAction("CLICK", tuple()) - stackedCB.executeAction("CLICK", tuple()) - select_by_text(textdirLB, "Right-to-left") - - - #reopen and verify tab "Label". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "3") - - tile = xDialog.getChild("tile") - overlapCB = xDialog.getChild("overlapCB") - breakCB = xDialog.getChild("breakCB") - stackedCB = xDialog.getChild("stackedCB") - textdirLB = xDialog.getChild("textdirLB") - - self.assertEqual(get_state_as_dict(tile)["Checked"], "true") - self.assertEqual(get_state_as_dict(overlapCB)["Selected"], "true") - self.assertEqual(get_state_as_dict(breakCB)["Selected"], "true") - self.assertEqual(get_state_as_dict(stackedCB)["Selected"], "true") - self.assertEqual(get_state_as_dict(textdirLB)["SelectEntryText"], "Right-to-left") + + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: + #Click on tab "Scale". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + reverseDirection = xDialog.getChild("CBX_REVERSE") + logarithmicScale = xDialog.getChild("CBX_LOGARITHM") + autoMinimum = xDialog.getChild("CBX_AUTO_MIN") + autoMaximum = xDialog.getChild("CBX_AUTO_MAX") + majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") + minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") + minimum = xDialog.getChild("EDT_MIN") + maximum = xDialog.getChild("EDT_MAX") + major = xDialog.getChild("EDT_STEP_MAIN") + minor = xDialog.getChild("MT_STEPHELP") + + reverseDirection.executeAction("CLICK", tuple()) + logarithmicScale.executeAction("CLICK", tuple()) + autoMinimum.executeAction("CLICK", tuple()) + autoMaximum.executeAction("CLICK", tuple()) + majorInterval.executeAction("CLICK", tuple()) + minorInterval.executeAction("CLICK", tuple()) + + minimum.executeAction("DOWN", tuple()) #10.12.2017 + maximum.executeAction("DOWN", tuple()) #29.04.2018 + major.executeAction("DOWN", tuple()) #19 + minor.executeAction("UP", tuple()) #3 + + #reopen and verify + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: + #Click on tab "Scale". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + reverseDirection = xDialog.getChild("CBX_REVERSE") + logarithmicScale = xDialog.getChild("CBX_LOGARITHM") + autoMinimum = xDialog.getChild("CBX_AUTO_MIN") + autoMaximum = xDialog.getChild("CBX_AUTO_MAX") + majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") + minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") + minimum = xDialog.getChild("EDT_MIN") + maximum = xDialog.getChild("EDT_MAX") + major = xDialog.getChild("EDT_STEP_MAIN") + minor = xDialog.getChild("MT_STEPHELP") + + self.assertEqual(get_state_as_dict(reverseDirection)["Selected"], "true") + self.assertEqual(get_state_as_dict(logarithmicScale)["Selected"], "true") + self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false") + self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false") + self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false") + self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false") + self.assertEqual(get_state_as_dict(minimum)["Text"], "10.12.2017") + self.assertEqual(get_state_as_dict(maximum)["Text"], "29.04.2018") + self.assertEqual(get_state_as_dict(major)["Text"], "19") + self.assertEqual(get_state_as_dict(minor)["Text"], "3") + + #Click on tab "positioning". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") + crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value + placeLabels = xDialog.getChild("LB_PLACE_LABELS") + innerMajorTick = xDialog.getChild("CB_TICKS_INNER") + outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") + innerMinorTick = xDialog.getChild("CB_MINOR_INNER") + outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") + placeMarks = xDialog.getChild("LB_PLACE_TICKS") + + select_by_text(crossAxis, "Start") + select_by_text(placeLabels, "Outside end") + innerMajorTick.executeAction("CLICK", tuple()) + outerMajorTick.executeAction("CLICK", tuple()) + innerMinorTick.executeAction("CLICK", tuple()) + outerMinorTick.executeAction("CLICK", tuple()) + select_by_text(placeMarks, "At axis") + + + #reopen and verify tab "positioning". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") + crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value + placeLabels = xDialog.getChild("LB_PLACE_LABELS") + innerMajorTick = xDialog.getChild("CB_TICKS_INNER") + outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") + innerMinorTick = xDialog.getChild("CB_MINOR_INNER") + outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") + placeMarks = xDialog.getChild("LB_PLACE_TICKS") + + self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Start") + self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") + self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false") + self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") + #change tab "positioning". + select_by_text(crossAxis, "Value") + crossAxisValue.executeAction("UP", tuple()) #1 + + + #reopen and verify tab "positioning". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") + crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value + placeLabels = xDialog.getChild("LB_PLACE_LABELS") + innerMajorTick = xDialog.getChild("CB_TICKS_INNER") + outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") + innerMinorTick = xDialog.getChild("CB_MINOR_INNER") + outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") + placeMarks = xDialog.getChild("LB_PLACE_TICKS") + + self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value") + self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "1") + self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") + self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false") + self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") + #change tab "Line". + select_pos(tabcontrol, "2") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) + + + #reopen and verify tab "Line". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "2") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + + #change tab "Label" + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "3") + + tile = xDialog.getChild("tile") + overlapCB = xDialog.getChild("overlapCB") + breakCB = xDialog.getChild("breakCB") + stackedCB = xDialog.getChild("stackedCB") + textdirLB = xDialog.getChild("textdirLB") + + tile.executeAction("CLICK", tuple()) + overlapCB.executeAction("CLICK", tuple()) + breakCB.executeAction("CLICK", tuple()) + stackedCB.executeAction("CLICK", tuple()) + select_by_text(textdirLB, "Right-to-left") + + + #reopen and verify tab "Label". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "3") + + tile = xDialog.getChild("tile") + overlapCB = xDialog.getChild("overlapCB") + breakCB = xDialog.getChild("breakCB") + stackedCB = xDialog.getChild("stackedCB") + textdirLB = xDialog.getChild("textdirLB") + + self.assertEqual(get_state_as_dict(tile)["Checked"], "true") + self.assertEqual(get_state_as_dict(overlapCB)["Selected"], "true") + self.assertEqual(get_state_as_dict(breakCB)["Selected"], "true") + self.assertEqual(get_state_as_dict(stackedCB)["Selected"], "true") + self.assertEqual(get_state_as_dict(textdirLB)["SelectEntryText"], "Right-to-left") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartYAxis.py b/sc/qa/uitest/chart/chartYAxis.py index ba1dbeb75a58..0bae8f8142d4 100644 --- a/sc/qa/uitest/chart/chartYAxis.py +++ b/sc/qa/uitest/chart/chartYAxis.py @@ -17,227 +17,227 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class chartYAxis(UITestCase): def test_chart_y_axis_dialog(self): with self.ui_test.load_file(get_url_for_data_file("tdf122398.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - - change_measurement_unit(self, "Centimeter") - - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: - #Click on tab "Scale". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - - reverseDirection = xDialog.getChild("CBX_REVERSE") - logarithmicScale = xDialog.getChild("CBX_LOGARITHM") - autoMinimum = xDialog.getChild("CBX_AUTO_MIN") - autoMaximum = xDialog.getChild("CBX_AUTO_MAX") - majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") - minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") - minimum = xDialog.getChild("EDT_MIN") - maximum = xDialog.getChild("EDT_MAX") - major = xDialog.getChild("EDT_STEP_MAIN") - minor = xDialog.getChild("MT_STEPHELP") - - reverseDirection.executeAction("CLICK", tuple()) - logarithmicScale.executeAction("CLICK", tuple()) - autoMinimum.executeAction("CLICK", tuple()) - autoMaximum.executeAction("CLICK", tuple()) - majorInterval.executeAction("CLICK", tuple()) - minorInterval.executeAction("CLICK", tuple()) - - minimum.executeAction("UP", tuple()) #1 - maximum.executeAction("DOWN", tuple()) #17 - major.executeAction("DOWN", tuple()) #1 - minor.executeAction("UP", tuple()) #3 - - #reopen and verify - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: - #Click on tab "Scale". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - reverseDirection = xDialog.getChild("CBX_REVERSE") - logarithmicScale = xDialog.getChild("CBX_LOGARITHM") - autoMinimum = xDialog.getChild("CBX_AUTO_MIN") - autoMaximum = xDialog.getChild("CBX_AUTO_MAX") - majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") - minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") - minimum = xDialog.getChild("EDT_MIN") - maximum = xDialog.getChild("EDT_MAX") - major = xDialog.getChild("EDT_STEP_MAIN") - minor = xDialog.getChild("MT_STEPHELP") - - self.assertEqual(get_state_as_dict(reverseDirection)["Selected"], "true") - self.assertEqual(get_state_as_dict(logarithmicScale)["Selected"], "true") - self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false") - self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false") - self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false") - self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false") - self.assertEqual(get_state_as_dict(minimum)["Text"], "1") - self.assertEqual(get_state_as_dict(maximum)["Text"], "17") - self.assertEqual(get_state_as_dict(major)["Text"], "1") - self.assertEqual(get_state_as_dict(minor)["Text"], "3") - - #Click on tab "positioning". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") - crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value - placeLabels = xDialog.getChild("LB_PLACE_LABELS") - innerMajorTick = xDialog.getChild("CB_TICKS_INNER") - outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") - innerMinorTick = xDialog.getChild("CB_MINOR_INNER") - outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") - placeMarks = xDialog.getChild("LB_PLACE_TICKS") - - select_by_text(crossAxis, "Start") - select_by_text(placeLabels, "Outside end") - innerMajorTick.executeAction("CLICK", tuple()) - outerMajorTick.executeAction("CLICK", tuple()) - innerMinorTick.executeAction("CLICK", tuple()) - outerMinorTick.executeAction("CLICK", tuple()) - select_by_text(placeMarks, "At axis") - - - #reopen and verify tab "positioning". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") - crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value - placeLabels = xDialog.getChild("LB_PLACE_LABELS") - innerMajorTick = xDialog.getChild("CB_TICKS_INNER") - outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") - innerMinorTick = xDialog.getChild("CB_MINOR_INNER") - outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") - placeMarks = xDialog.getChild("LB_PLACE_TICKS") - - self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Start") - self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") - self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false") - self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") - #change tab "positioning". - select_by_text(crossAxis, "Value") - crossAxisValue.executeAction("CLEAR", tuple()) - crossAxisValue.executeAction("TYPE", mkPropertyValues({"TEXT":"19.01.2018"})) #19.01.2018 - - - #reopen and verify tab "positioning". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") - crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value - placeLabels = xDialog.getChild("LB_PLACE_LABELS") - innerMajorTick = xDialog.getChild("CB_TICKS_INNER") - outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") - innerMinorTick = xDialog.getChild("CB_MINOR_INNER") - outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") - placeMarks = xDialog.getChild("LB_PLACE_TICKS") - - self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value") - #self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "19.01.2018") #bug 123520 - self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") - self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false") - self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") - self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") - #change tab "Line". - select_pos(tabcontrol, "2") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) - - - #reopen and verify tab "Line". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "2") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - - #change tab "Label" - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "3") - - tile = xDialog.getChild("tile") - overlapCB = xDialog.getChild("overlapCB") - breakCB = xDialog.getChild("breakCB") - stackedCB = xDialog.getChild("stackedCB") - textdirLB = xDialog.getChild("textdirLB") - - tile.executeAction("CLICK", tuple()) - overlapCB.executeAction("CLICK", tuple()) - breakCB.executeAction("CLICK", tuple()) - stackedCB.executeAction("CLICK", tuple()) - select_by_text(textdirLB, "Right-to-left") - - - #reopen and verify tab "Label". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "3") - - tile = xDialog.getChild("tile") - overlapCB = xDialog.getChild("overlapCB") - breakCB = xDialog.getChild("breakCB") - stackedCB = xDialog.getChild("stackedCB") - textdirLB = xDialog.getChild("textdirLB") - - self.assertEqual(get_state_as_dict(tile)["Checked"], "true") - self.assertEqual(get_state_as_dict(overlapCB)["Selected"], "true") - self.assertEqual(get_state_as_dict(breakCB)["Selected"], "true") - self.assertEqual(get_state_as_dict(stackedCB)["Selected"], "true") - self.assertEqual(get_state_as_dict(textdirLB)["SelectEntryText"], "Right-to-left") + + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: + #Click on tab "Scale". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + + reverseDirection = xDialog.getChild("CBX_REVERSE") + logarithmicScale = xDialog.getChild("CBX_LOGARITHM") + autoMinimum = xDialog.getChild("CBX_AUTO_MIN") + autoMaximum = xDialog.getChild("CBX_AUTO_MAX") + majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") + minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") + minimum = xDialog.getChild("EDT_MIN") + maximum = xDialog.getChild("EDT_MAX") + major = xDialog.getChild("EDT_STEP_MAIN") + minor = xDialog.getChild("MT_STEPHELP") + + reverseDirection.executeAction("CLICK", tuple()) + logarithmicScale.executeAction("CLICK", tuple()) + autoMinimum.executeAction("CLICK", tuple()) + autoMaximum.executeAction("CLICK", tuple()) + majorInterval.executeAction("CLICK", tuple()) + minorInterval.executeAction("CLICK", tuple()) + + minimum.executeAction("UP", tuple()) #1 + maximum.executeAction("DOWN", tuple()) #17 + major.executeAction("DOWN", tuple()) #1 + minor.executeAction("UP", tuple()) #3 + + #reopen and verify + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: + #Click on tab "Scale". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + reverseDirection = xDialog.getChild("CBX_REVERSE") + logarithmicScale = xDialog.getChild("CBX_LOGARITHM") + autoMinimum = xDialog.getChild("CBX_AUTO_MIN") + autoMaximum = xDialog.getChild("CBX_AUTO_MAX") + majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") + minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") + minimum = xDialog.getChild("EDT_MIN") + maximum = xDialog.getChild("EDT_MAX") + major = xDialog.getChild("EDT_STEP_MAIN") + minor = xDialog.getChild("MT_STEPHELP") + + self.assertEqual(get_state_as_dict(reverseDirection)["Selected"], "true") + self.assertEqual(get_state_as_dict(logarithmicScale)["Selected"], "true") + self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false") + self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false") + self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false") + self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false") + self.assertEqual(get_state_as_dict(minimum)["Text"], "1") + self.assertEqual(get_state_as_dict(maximum)["Text"], "17") + self.assertEqual(get_state_as_dict(major)["Text"], "1") + self.assertEqual(get_state_as_dict(minor)["Text"], "3") + + #Click on tab "positioning". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") + crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value + placeLabels = xDialog.getChild("LB_PLACE_LABELS") + innerMajorTick = xDialog.getChild("CB_TICKS_INNER") + outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") + innerMinorTick = xDialog.getChild("CB_MINOR_INNER") + outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") + placeMarks = xDialog.getChild("LB_PLACE_TICKS") + + select_by_text(crossAxis, "Start") + select_by_text(placeLabels, "Outside end") + innerMajorTick.executeAction("CLICK", tuple()) + outerMajorTick.executeAction("CLICK", tuple()) + innerMinorTick.executeAction("CLICK", tuple()) + outerMinorTick.executeAction("CLICK", tuple()) + select_by_text(placeMarks, "At axis") + + + #reopen and verify tab "positioning". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") + crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value + placeLabels = xDialog.getChild("LB_PLACE_LABELS") + innerMajorTick = xDialog.getChild("CB_TICKS_INNER") + outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") + innerMinorTick = xDialog.getChild("CB_MINOR_INNER") + outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") + placeMarks = xDialog.getChild("LB_PLACE_TICKS") + + self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Start") + self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") + self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false") + self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") + #change tab "positioning". + select_by_text(crossAxis, "Value") + crossAxisValue.executeAction("CLEAR", tuple()) + crossAxisValue.executeAction("TYPE", mkPropertyValues({"TEXT":"19.01.2018"})) #19.01.2018 + + + #reopen and verify tab "positioning". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT") + crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value + placeLabels = xDialog.getChild("LB_PLACE_LABELS") + innerMajorTick = xDialog.getChild("CB_TICKS_INNER") + outerMajorTick = xDialog.getChild("CB_TICKS_OUTER") + innerMinorTick = xDialog.getChild("CB_MINOR_INNER") + outerMinorTick = xDialog.getChild("CB_MINOR_OUTER") + placeMarks = xDialog.getChild("LB_PLACE_TICKS") + + self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value") + #self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "19.01.2018") #bug 123520 + self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") + self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false") + self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") + self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") + #change tab "Line". + select_pos(tabcontrol, "2") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) + + + #reopen and verify tab "Line". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "2") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + + #change tab "Label" + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "3") + + tile = xDialog.getChild("tile") + overlapCB = xDialog.getChild("overlapCB") + breakCB = xDialog.getChild("breakCB") + stackedCB = xDialog.getChild("stackedCB") + textdirLB = xDialog.getChild("textdirLB") + + tile.executeAction("CLICK", tuple()) + overlapCB.executeAction("CLICK", tuple()) + breakCB.executeAction("CLICK", tuple()) + stackedCB.executeAction("CLICK", tuple()) + select_by_text(textdirLB, "Right-to-left") + + + #reopen and verify tab "Label". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "3") + + tile = xDialog.getChild("tile") + overlapCB = xDialog.getChild("overlapCB") + breakCB = xDialog.getChild("breakCB") + stackedCB = xDialog.getChild("stackedCB") + textdirLB = xDialog.getChild("textdirLB") + + self.assertEqual(get_state_as_dict(tile)["Checked"], "true") + self.assertEqual(get_state_as_dict(overlapCB)["Selected"], "true") + self.assertEqual(get_state_as_dict(breakCB)["Selected"], "true") + self.assertEqual(get_state_as_dict(stackedCB)["Selected"], "true") + self.assertEqual(get_state_as_dict(textdirLB)["SelectEntryText"], "Right-to-left") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/formatDataSeries.py b/sc/qa/uitest/chart/formatDataSeries.py index f21c3076f291..171371151d52 100644 --- a/sc/qa/uitest/chart/formatDataSeries.py +++ b/sc/qa/uitest/chart/formatDataSeries.py @@ -17,80 +17,80 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class chartFormatDataSeries(UITestCase): def test_chart_format_data_series_dialog(self): with self.ui_test.load_file(get_url_for_data_file("tdf93506.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - - change_measurement_unit(self, "Centimeter") - - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"})) as xDialog: - #Click on tab "Options". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - secondaryYAxis = xDialog.getChild("RBT_OPT_AXIS_2") - leaveGap = xDialog.getChild("RB_DONT_PAINT") - includeHiddenCells = xDialog.getChild("CB_INCLUDE_HIDDEN_CELLS") - hideLegend = xDialog.getChild("CB_LEGEND_ENTRY_HIDDEN") - - secondaryYAxis.executeAction("CLICK", tuple()) - leaveGap.executeAction("CLICK", tuple()) - includeHiddenCells.executeAction("CLICK", tuple()) - hideLegend.executeAction("CLICK", tuple()) - - #Click on tab "Line". - select_pos(tabcontrol, "1") - - xWidth = xDialog.getChild("MF_SYMBOL_WIDTH") - xHeight = xDialog.getChild("MF_SYMBOL_HEIGHT") - xKeep = xDialog.getChild("CB_SYMBOL_RATIO") - - xKeep.executeAction("CLICK", tuple()) - xWidth.executeAction("UP", tuple()) - xWidth.executeAction("UP", tuple()) - xHeight.executeAction("UP", tuple()) - - - #reopen and verify - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"})) as xDialog: - #Click on tab "Options". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - secondaryYAxis = xDialog.getChild("RBT_OPT_AXIS_2") - leaveGap = xDialog.getChild("RB_DONT_PAINT") - includeHiddenCells = xDialog.getChild("CB_INCLUDE_HIDDEN_CELLS") - hideLegend = xDialog.getChild("CB_LEGEND_ENTRY_HIDDEN") - - self.assertEqual(get_state_as_dict(secondaryYAxis)["Checked"], "true") - self.assertEqual(get_state_as_dict(leaveGap)["Checked"], "true") - self.assertEqual(get_state_as_dict(includeHiddenCells)["Selected"], "true") - self.assertEqual(get_state_as_dict(hideLegend)["Selected"], "true") - - #Click on tab "Line". - select_pos(tabcontrol, "1") - - xWidth = xDialog.getChild("MF_SYMBOL_WIDTH") - xHeight = xDialog.getChild("MF_SYMBOL_HEIGHT") - xKeep = xDialog.getChild("CB_SYMBOL_RATIO") - - self.assertEqual(get_state_as_dict(xKeep)["Selected"], "true") #checked as default even after reopen - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.35 cm") - self.assertEqual(get_state_as_dict(xHeight)["Text"], "0.30 cm") - #click up, should up both values, because Keep ratio is checked - xWidth.executeAction("UP", tuple()) - xHeight.executeAction("UP", tuple()) - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.41 cm") - self.assertEqual(get_state_as_dict(xHeight)["Text"], "0.35 cm") + + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"})) as xDialog: + #Click on tab "Options". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + secondaryYAxis = xDialog.getChild("RBT_OPT_AXIS_2") + leaveGap = xDialog.getChild("RB_DONT_PAINT") + includeHiddenCells = xDialog.getChild("CB_INCLUDE_HIDDEN_CELLS") + hideLegend = xDialog.getChild("CB_LEGEND_ENTRY_HIDDEN") + + secondaryYAxis.executeAction("CLICK", tuple()) + leaveGap.executeAction("CLICK", tuple()) + includeHiddenCells.executeAction("CLICK", tuple()) + hideLegend.executeAction("CLICK", tuple()) + + #Click on tab "Line". + select_pos(tabcontrol, "1") + + xWidth = xDialog.getChild("MF_SYMBOL_WIDTH") + xHeight = xDialog.getChild("MF_SYMBOL_HEIGHT") + xKeep = xDialog.getChild("CB_SYMBOL_RATIO") + + xKeep.executeAction("CLICK", tuple()) + xWidth.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + xHeight.executeAction("UP", tuple()) + + + #reopen and verify + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"})) as xDialog: + #Click on tab "Options". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + secondaryYAxis = xDialog.getChild("RBT_OPT_AXIS_2") + leaveGap = xDialog.getChild("RB_DONT_PAINT") + includeHiddenCells = xDialog.getChild("CB_INCLUDE_HIDDEN_CELLS") + hideLegend = xDialog.getChild("CB_LEGEND_ENTRY_HIDDEN") + + self.assertEqual(get_state_as_dict(secondaryYAxis)["Checked"], "true") + self.assertEqual(get_state_as_dict(leaveGap)["Checked"], "true") + self.assertEqual(get_state_as_dict(includeHiddenCells)["Selected"], "true") + self.assertEqual(get_state_as_dict(hideLegend)["Selected"], "true") + + #Click on tab "Line". + select_pos(tabcontrol, "1") + + xWidth = xDialog.getChild("MF_SYMBOL_WIDTH") + xHeight = xDialog.getChild("MF_SYMBOL_HEIGHT") + xKeep = xDialog.getChild("CB_SYMBOL_RATIO") + + self.assertEqual(get_state_as_dict(xKeep)["Selected"], "true") #checked as default even after reopen + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.35 cm") + self.assertEqual(get_state_as_dict(xHeight)["Text"], "0.30 cm") + #click up, should up both values, because Keep ratio is checked + xWidth.executeAction("UP", tuple()) + xHeight.executeAction("UP", tuple()) + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.41 cm") + self.assertEqual(get_state_as_dict(xHeight)["Text"], "0.35 cm") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/tdf93506_trendline.py b/sc/qa/uitest/chart/tdf93506_trendline.py index a70a75a922b8..4ba39930bca2 100644 --- a/sc/qa/uitest/chart/tdf93506_trendline.py +++ b/sc/qa/uitest/chart/tdf93506_trendline.py @@ -18,416 +18,416 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class tdf93506(UITestCase): def test_tdf93506_chart_trendline_dialog(self): with self.ui_test.load_file(get_url_for_data_file("tdf93506.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - - change_measurement_unit(self, "Centimeter") - - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - logarithmic.executeAction("CLICK", tuple()) - xentryname.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) - extrapolateForward.executeAction("UP", tuple()) - extrapolateBackward.executeAction("UP", tuple()) - showEquation.executeAction("CLICK", tuple()) - showCorrelationCoefficient.executeAction("CLICK", tuple()) - xVarname.executeAction("CLEAR", tuple()) - xVarname.executeAction("TYPE", mkPropertyValues({"TEXT":"a"})) - yVarName.executeAction("CLEAR", tuple()) - yVarName.executeAction("TYPE", mkPropertyValues({"TEXT":"f(a)"})) - - #Click on tab "Line". - select_pos(tabcontrol, "1") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - xWidth.executeAction("UP", tuple()) - xTransparent.executeAction("UP", tuple()) - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") - - - #reopen and verify - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - self.assertEqual(get_state_as_dict(logarithmic)["Checked"], "true") - self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") - self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") - self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") - self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") - self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") - self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") - self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") - - #Click on tab "Line". - select_pos(tabcontrol, "1") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") - - - #Now change regression Type to Exponential - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - exponential = xDialog.getChild("exponential") #type regression exponential - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - exponential.executeAction("CLICK", tuple()) #set exponential - #set Force intercept - setIntercept.executeAction("CLICK", tuple()) - interceptValue.executeAction("UP", tuple()) - - #Click on tab "Line". - select_pos(tabcontrol, "1") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") - - - #reopen and verify Exponential - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - exponential = xDialog.getChild("exponential") #type regression exponential - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - self.assertEqual(get_state_as_dict(exponential)["Checked"], "true") - self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") - self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") - self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") - self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") - self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true") - self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1") - self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") - self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") - self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") - - #Click on tab "Line". - select_pos(tabcontrol, "1") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") - - - #Now change regression Type to Power - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - exponential = xDialog.getChild("exponential") #type regression exponential - power = xDialog.getChild("exponential") #type regression power - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - power.executeAction("CLICK", tuple()) #set power - - #Click on tab "Line". - select_pos(tabcontrol, "1") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") - - - #reopen and verify Power - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - exponential = xDialog.getChild("exponential") #type regression exponential - power = xDialog.getChild("exponential") #type regression power - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - self.assertEqual(get_state_as_dict(power)["Checked"], "true") - self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") - self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") - self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") - self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") - # self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true") - # self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1") - self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") - self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") - self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") - - #Click on tab "Line". - select_pos(tabcontrol, "1") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") - - - #Now change regression Type to Polynomial - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - exponential = xDialog.getChild("exponential") #type regression exponential - power = xDialog.getChild("exponential") #type regression power - polynomial = xDialog.getChild("polynomial") #type regression polynomial - degree = xDialog.getChild("degree") - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - polynomial.executeAction("CLICK", tuple()) #set polynomial - degree.executeAction("UP", tuple()) - - #Click on tab "Line". - select_pos(tabcontrol, "1") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") - - - #reopen and verify Polynomial - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - exponential = xDialog.getChild("exponential") #type regression exponential - power = xDialog.getChild("exponential") #type regression power - polynomial = xDialog.getChild("polynomial") #type regression polynomial - degree = xDialog.getChild("degree") - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - self.assertEqual(get_state_as_dict(polynomial)["Checked"], "true") - self.assertEqual(get_state_as_dict(degree)["Text"], "3") - self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") - self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") - self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") - self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") - self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true") - self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1") - self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") - self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") - self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") - - #Click on tab "Line". - select_pos(tabcontrol, "1") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") - - - #Now change regression Type to Moving average - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - exponential = xDialog.getChild("exponential") #type regression exponential - power = xDialog.getChild("exponential") #type regression power - movingAverage = xDialog.getChild("movingAverage") #type regression Moving average - movingAverageType = xDialog.getChild("combo_moving_type") #type regression Moving average type - period = xDialog.getChild("period") - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - movingAverage.executeAction("CLICK", tuple()) #set polynomial - select_by_text(movingAverageType, "Averaged Abscissa") - period.executeAction("UP", tuple()) - - #Click on tab "Line". - select_pos(tabcontrol, "1") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") - - - #reopen and verify Moving average - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: - #Click on tab "Type". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic - exponential = xDialog.getChild("exponential") #type regression exponential - power = xDialog.getChild("exponential") #type regression power - polynomial = xDialog.getChild("polynomial") #type regression polynomial - movingAverage = xDialog.getChild("movingAverage") #type regression Moving average - movingAverageType = xDialog.getChild("combo_moving_type") #type regression Moving average type - degree = xDialog.getChild("degree") - period = xDialog.getChild("period") - xentryname = xDialog.getChild("entry_name") #add name - extrapolateForward = xDialog.getChild("extrapolateForward") - extrapolateBackward = xDialog.getChild("extrapolateBackward") - setIntercept = xDialog.getChild("setIntercept") - interceptValue = xDialog.getChild("interceptValue") - showEquation = xDialog.getChild("showEquation") - showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") - xVarname = xDialog.getChild("entry_Xname") - yVarName = xDialog.getChild("entry_Yname") - - self.assertEqual(get_state_as_dict(movingAverage)["Checked"], "true") - self.assertEqual(get_state_as_dict(movingAverageType)["SelectEntryText"], "Averaged Abscissa") - self.assertEqual(get_state_as_dict(period)["Text"], "3") - self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") - - #Click on tab "Line". - select_pos(tabcontrol, "1") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + logarithmic.executeAction("CLICK", tuple()) + xentryname.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) + extrapolateForward.executeAction("UP", tuple()) + extrapolateBackward.executeAction("UP", tuple()) + showEquation.executeAction("CLICK", tuple()) + showCorrelationCoefficient.executeAction("CLICK", tuple()) + xVarname.executeAction("CLEAR", tuple()) + xVarname.executeAction("TYPE", mkPropertyValues({"TEXT":"a"})) + yVarName.executeAction("CLEAR", tuple()) + yVarName.executeAction("TYPE", mkPropertyValues({"TEXT":"f(a)"})) + + #Click on tab "Line". + select_pos(tabcontrol, "1") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + xWidth.executeAction("UP", tuple()) + xTransparent.executeAction("UP", tuple()) + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + + #reopen and verify + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + self.assertEqual(get_state_as_dict(logarithmic)["Checked"], "true") + self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") + self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") + self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") + self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") + self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") + self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") + self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") + + #Click on tab "Line". + select_pos(tabcontrol, "1") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + + #Now change regression Type to Exponential + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + exponential = xDialog.getChild("exponential") #type regression exponential + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + exponential.executeAction("CLICK", tuple()) #set exponential + #set Force intercept + setIntercept.executeAction("CLICK", tuple()) + interceptValue.executeAction("UP", tuple()) + + #Click on tab "Line". + select_pos(tabcontrol, "1") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + + #reopen and verify Exponential + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + exponential = xDialog.getChild("exponential") #type regression exponential + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + self.assertEqual(get_state_as_dict(exponential)["Checked"], "true") + self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") + self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") + self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") + self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") + self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true") + self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1") + self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") + self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") + self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") + + #Click on tab "Line". + select_pos(tabcontrol, "1") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + + #Now change regression Type to Power + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + exponential = xDialog.getChild("exponential") #type regression exponential + power = xDialog.getChild("exponential") #type regression power + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + power.executeAction("CLICK", tuple()) #set power + + #Click on tab "Line". + select_pos(tabcontrol, "1") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + + #reopen and verify Power + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + exponential = xDialog.getChild("exponential") #type regression exponential + power = xDialog.getChild("exponential") #type regression power + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + self.assertEqual(get_state_as_dict(power)["Checked"], "true") + self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") + self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") + self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") + self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") + # self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true") + # self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1") + self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") + self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") + self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") + + #Click on tab "Line". + select_pos(tabcontrol, "1") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + + #Now change regression Type to Polynomial + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + exponential = xDialog.getChild("exponential") #type regression exponential + power = xDialog.getChild("exponential") #type regression power + polynomial = xDialog.getChild("polynomial") #type regression polynomial + degree = xDialog.getChild("degree") + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + polynomial.executeAction("CLICK", tuple()) #set polynomial + degree.executeAction("UP", tuple()) + + #Click on tab "Line". + select_pos(tabcontrol, "1") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + + #reopen and verify Polynomial + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + exponential = xDialog.getChild("exponential") #type regression exponential + power = xDialog.getChild("exponential") #type regression power + polynomial = xDialog.getChild("polynomial") #type regression polynomial + degree = xDialog.getChild("degree") + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + self.assertEqual(get_state_as_dict(polynomial)["Checked"], "true") + self.assertEqual(get_state_as_dict(degree)["Text"], "3") + self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") + self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") + self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") + self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") + self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true") + self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1") + self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") + self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") + self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") + + #Click on tab "Line". + select_pos(tabcontrol, "1") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + + #Now change regression Type to Moving average + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + exponential = xDialog.getChild("exponential") #type regression exponential + power = xDialog.getChild("exponential") #type regression power + movingAverage = xDialog.getChild("movingAverage") #type regression Moving average + movingAverageType = xDialog.getChild("combo_moving_type") #type regression Moving average type + period = xDialog.getChild("period") + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + movingAverage.executeAction("CLICK", tuple()) #set polynomial + select_by_text(movingAverageType, "Averaged Abscissa") + period.executeAction("UP", tuple()) + + #Click on tab "Line". + select_pos(tabcontrol, "1") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") + + + #reopen and verify Moving average + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"})) as xDialog: + #Click on tab "Type". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic + exponential = xDialog.getChild("exponential") #type regression exponential + power = xDialog.getChild("exponential") #type regression power + polynomial = xDialog.getChild("polynomial") #type regression polynomial + movingAverage = xDialog.getChild("movingAverage") #type regression Moving average + movingAverageType = xDialog.getChild("combo_moving_type") #type regression Moving average type + degree = xDialog.getChild("degree") + period = xDialog.getChild("period") + xentryname = xDialog.getChild("entry_name") #add name + extrapolateForward = xDialog.getChild("extrapolateForward") + extrapolateBackward = xDialog.getChild("extrapolateBackward") + setIntercept = xDialog.getChild("setIntercept") + interceptValue = xDialog.getChild("interceptValue") + showEquation = xDialog.getChild("showEquation") + showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") + xVarname = xDialog.getChild("entry_Xname") + yVarName = xDialog.getChild("entry_Yname") + + self.assertEqual(get_state_as_dict(movingAverage)["Checked"], "true") + self.assertEqual(get_state_as_dict(movingAverageType)["SelectEntryText"], "Averaged Abscissa") + self.assertEqual(get_state_as_dict(period)["Text"], "3") + self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") + + #Click on tab "Line". + select_pos(tabcontrol, "1") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") # vim: set shiftwidth=4 softtabstop=4 expandtab: |