[Libreoffice-commits] core.git: sc/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 6 10:54:15 UTC 2020


 sc/qa/uitest/chart/chartDataLabels.py |   41 ++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

New commits:
commit d34e969c888219bd3739fc4a8ef330c77f7e7adf
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Oct 5 16:19:28 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Oct 6 12:53:33 2020 +0200

    tdf#136430, tdf#136573: sc: Add UItest (take 2)
    
    Take 1 was submitted in 647958099600923d9ba3a57101891f62de326f4b
    and later reverted in 5872f0c0d206466ad78e92be3d7d551b7ff4dbf1
    The reason why jenkins hung was that the position of the label
    changed from 0.43,2.84 to 0.5,2.89 in
    a91ac466e2a996a07248ec4a2518d5ba9bdf3d61
    
    For some reason, jenkins didn't fail and the builds were just
    aborted after some time.
    
    Change-Id: If325d74e19b8fe6d8ad06700bfb05620c9d321cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103992
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/uitest/chart/chartDataLabels.py b/sc/qa/uitest/chart/chartDataLabels.py
index 378670faec51..13709a01c6ed 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.5", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
+    self.assertEqual("2.89", 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.4", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
+    self.assertEqual("2.79", 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:


More information about the Libreoffice-commits mailing list