summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-10-01 11:52:03 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-10-02 09:53:33 +0200
commit61d9d1cf56994146d514fd5bf8c3f3f6885449ea (patch)
treea948337b6e135d949fe0af4f55525d5c35806dfb /sc
parenta191dc755c7e529488ab1a172a208db2c16754d3 (diff)
uitest: sc: test chart legends move with arrow keys
Change-Id: I9fb81be8de86408c6ee13495593636effbd1cc24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103755 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/chart/chartLegend.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/sc/qa/uitest/chart/chartLegend.py b/sc/qa/uitest/chart/chartLegend.py
index 414a2de09227..7e2e085d135b 100644
--- a/sc/qa/uitest/chart/chartLegend.py
+++ b/sc/qa/uitest/chart/chartLegend.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
@@ -95,4 +96,46 @@ class chartLegend(UITestCase):
xOKBtn = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOKBtn)
self.ui_test.close_doc()
+
+ def test_legends_move_with_arrows_keys(self):
+
+ calc_doc = 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")
+
+ 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())
+
+ self.ui_test.execute_dialog_through_action(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
+
+ xDialog = self.xUITest.getTopFocusWindow()
+ 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'])
+
+ 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(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
+
+ # Check the position has changed after moving the label using the arrows keys
+ xDialog = self.xUITest.getTopFocusWindow()
+ 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'])
+
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.ui_test.close_doc()
+
# vim: set shiftwidth=4 softtabstop=4 expandtab: