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

New commits:
commit b05f2e0f3117ed59f63d97cebeb7ea7372df8ed5
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Feb 14 12:02:53 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Feb 14 17:29:02 2022 +0100

    tdf#147394: sc: Add UItest
    
    Change-Id: I0fa20d777247501593ac80ab394407d0570763bd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129910
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/uitest/chart/chartLegend.py 
b/sc/qa/uitest/chart/chartLegend.py
index 8bea7f189c1e..4372e47948b5 100644
--- a/sc/qa/uitest/chart/chartLegend.py
+++ b/sc/qa/uitest/chart/chartLegend.py
@@ -104,4 +104,27 @@ class chartLegend(UITestCase):
         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):
+
+    with self.ui_test.load_file(get_url_for_data_file("dataLabels.ods")) as 
calc_doc:
+      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")
+
+      xLegend = 
calc_doc.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().Legend
+      self.assertTrue(xLegend.Show)
+
+      # Select the legends
+      xLegends = xChartMain.getChild("CID/D=0:Legend=")
+      xLegends.executeAction("SELECT", tuple())
+
+      # Without the fix in place, this test would have crashed here
+      xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"}))
+
+      self.assertFalse(xLegend.Show)
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:

Reply via email to