sc/qa/uitest/calc_tests/data/chartArea.ods |binary sc/qa/uitest/chart/chartTitles.py | 42 +++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+)
New commits: commit ec932755543a548f6d07d2909e5f18aff1c20cfd Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Oct 2 12:33:34 2020 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Oct 2 16:41:54 2020 +0200 uitest: sc: test chart title moves with arrow keys Reuse one file with a chart for this test. I just added a title to the chart Change-Id: If73394026350c375059feb1635a7c85c0ecc150d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103831 Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/uitest/calc_tests/data/chartArea.ods b/sc/qa/uitest/calc_tests/data/chartArea.ods index c7cead1a5917..d7f863c31ed4 100644 Binary files a/sc/qa/uitest/calc_tests/data/chartArea.ods and b/sc/qa/uitest/calc_tests/data/chartArea.ods differ diff --git a/sc/qa/uitest/chart/chartTitles.py b/sc/qa/uitest/chart/chartTitles.py index c6c2488bcadc..1e3ac564ffd6 100644 --- a/sc/qa/uitest/chart/chartTitles.py +++ b/sc/qa/uitest/chart/chartTitles.py @@ -7,6 +7,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos +from uitest.uihelper.common import change_measurement_unit from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues @@ -94,5 +95,46 @@ class chartTitles(UITestCase): xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) + self.ui_test.close_doc() + + def test_title_move_with_arrows_keys(self): + + calc_doc = 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") + + 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()) + + self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) + + xDialog = self.xUITest.getTopFocusWindow() + 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']) + + xOkBtn = xDialog.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) + + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) + + self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) + + # Check the position has changed after moving the title using the arrows keys + xDialog = self.xUITest.getTopFocusWindow() + 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']) + + xOkBtn = xDialog.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) + self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits