summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-09-30 19:37:23 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-10-02 09:47:00 +0200
commit647958099600923d9ba3a57101891f62de326f4b (patch)
tree51b7ab4a86d44103b4da896c4118cb542794b5d6 /sc
parent344ae518165cbe49b11a518212b8470a18d4d09d (diff)
tdf#136430, tdf#136573: sc: Add UItest
Change-Id: Ieeea326c567e6ea74340b094ec1e89276110c444 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103727 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/chart/chartDataLabels.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/sc/qa/uitest/chart/chartDataLabels.py b/sc/qa/uitest/chart/chartDataLabels.py
index 378670faec51..9db1cf454766 100644
--- a/sc/qa/uitest/chart/chartDataLabels.py
+++ b/sc/qa/uitest/chart/chartDataLabels.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
@@ -320,4 +321,44 @@ class chartDataLabels(UITestCase):
self.assertEqual(xDataSeries[0].NumberFormat, xFormat)
self.ui_test.close_doc()
+ def test_tdf136573(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 first label
+ xDataLabel = xChartMain.getChild("CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0")
+ xDataLabel.executeAction("SELECT", tuple())
+
+ self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
+
+ xDialog = self.xUITest.getTopFocusWindow()
+ self.assertEqual("0.43", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
+ self.assertEqual("2.84", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
+
+ xCanBtn = xDialog.getChild("cancel")
+ xCanBtn.executeAction("CLICK", tuple())
+
+ xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
+
+ self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
+
+ # Check the position has changed after moving the label using the arrows keys
+ xDialog = self.xUITest.getTopFocusWindow()
+ self.assertEqual("0.33", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
+ self.assertEqual("2.74", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
+
+ xCanBtn = xDialog.getChild("ok")
+ xCanBtn.executeAction("CLICK", tuple())
+
+ self.ui_test.close_doc()
+
# vim: set shiftwidth=4 softtabstop=4 expandtab: