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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 22 16:59:44 UTC 2021


 sc/qa/uitest/chart/tdf142851.py |   39 +++++++++++++++++++--------------------
 1 file changed, 19 insertions(+), 20 deletions(-)

New commits:
commit 647623db579b0e7b176f9cbfa24bf8444cfd94d4
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Jun 22 18:29:55 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Jun 22 18:59:05 2021 +0200

    uitest: fix build
    
    regression from 1e7bf688967dc39540d24070c70c73b06bd1347f
    < tdf#142851 Chart UI: fix empty Chart Type dialog >
    self.ui_test.load_file was changed in
    be0a41679fea524e0935dc6617b5e65349812dd1
    < uitest: guard load_file >
    
    Change-Id: I00cb5dc6e1213403f2eba5bc4b9dc0e876118536
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117670
    Tested-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/uitest/chart/tdf142851.py b/sc/qa/uitest/chart/tdf142851.py
index 73c9bd68d6d0..512af056b65e 100644
--- a/sc/qa/uitest/chart/tdf142851.py
+++ b/sc/qa/uitest/chart/tdf142851.py
@@ -11,28 +11,27 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 # Bug 142851 - UI Chart Type dialog empty with unsupported combo chart
 
 class tdf142851(UITestCase):
-   def test_tdf142851_combo_chart_type(self):
-    calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf142851.xlsx"))
-    xCalcDoc = self.xUITest.getTopFocusWindow()
-    gridwin = xCalcDoc.getChild("grid_window")
-    document = self.ui_test.get_component()
+    def test_tdf142851_combo_chart_type(self):
+        with self.ui_test.load_file(get_url_for_data_file("tdf142851.xlsx")):
+            xCalcDoc = self.xUITest.getTopFocusWindow()
+            gridwin = xCalcDoc.getChild("grid_window")
+            document = self.ui_test.get_component()
 
-    gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Diagram 1"}))
-    gridwin.executeAction("ACTIVATE", tuple())
-    xChartMainTop = self.xUITest.getTopFocusWindow()
-    xChartMain = xChartMainTop.getChild("chart_window")
-    xChart = xChartMain.getChild("CID/Page=")
+            gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Diagram 1"}))
+            gridwin.executeAction("ACTIVATE", tuple())
+            xChartMainTop = self.xUITest.getTopFocusWindow()
+            xChartMain = xChartMainTop.getChild("chart_window")
+            xChart = xChartMain.getChild("CID/Page=")
 
-    self.ui_test.execute_dialog_through_action(xChart, "COMMAND",
-        mkPropertyValues({"COMMAND" : "DiagramType"}))
-    xDialog = self.xUITest.getTopFocusWindow()
-    chartTypeVisible = get_state_as_dict(xDialog.getChild("charttype"))['Visible']
-    subTypeVisible = get_state_as_dict(xDialog.getChild("subtype"))['Visible']
-    xOKBtn = xDialog.getChild("ok")
-    self.ui_test.close_dialog_through_button(xOKBtn)
+            self.ui_test.execute_dialog_through_action(xChart, "COMMAND",
+                mkPropertyValues({"COMMAND" : "DiagramType"}))
+            xDialog = self.xUITest.getTopFocusWindow()
+            chartTypeVisible = get_state_as_dict(xDialog.getChild("charttype"))['Visible']
+            subTypeVisible = get_state_as_dict(xDialog.getChild("subtype"))['Visible']
+            xOKBtn = xDialog.getChild("ok")
+            self.ui_test.close_dialog_through_button(xOKBtn)
 
-    self.assertEqual('true', chartTypeVisible)
-    self.assertEqual('true', subTypeVisible)
+            self.assertEqual('true', chartTypeVisible)
+            self.assertEqual('true', subTypeVisible)
 
-    self.ui_test.close_doc()
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list