sc/qa/uitest/calc_tests8/dataProvider.py |   42 +++++++++++++++++++++++++++++++
 sc/qa/uitest/data/tdf165658.csv          |    4 ++
 2 files changed, 46 insertions(+)

New commits:
commit f631a1cd933b26624bc71ef9f5b193b44bc2b79f
Author:     Xisco Fauli <[email protected]>
AuthorDate: Tue Sep 30 14:21:02 2025 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Sep 30 15:32:08 2025 +0200

    tdf#168497, tdf#165658: sc: Add UItest
    
    Change-Id: I13b081d9d575d7715084acd20c77ed2682a0b157
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191663
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sc/qa/uitest/calc_tests8/dataProvider.py 
b/sc/qa/uitest/calc_tests8/dataProvider.py
new file mode 100644
index 000000000000..d9052e1bc813
--- /dev/null
+++ b/sc/qa/uitest/calc_tests8/dataProvider.py
@@ -0,0 +1,42 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class DataProvider(UITestCase):
+
+    def test_brokenCSV(self):
+
+        with self.ui_test.create_doc_in_start_center("calc"):
+
+            # tdf#168497: without the fix in place, it would have crashed here
+            with 
self.ui_test.execute_dialog_through_command(".uno:DataProvider") as xDialog:
+                xBrowse = xDialog.getChild("browse")
+                xApply = xDialog.getChild("apply")
+                xProvider = xDialog.getChild("provider_lst")
+                xURL = xDialog.getChild("ed_url")
+
+                with self.ui_test.execute_blocking_action(
+                        xBrowse.executeAction, args=('CLICK', ()), 
close_button="") as dialog:
+                    xFileName = dialog.getChild("file_name")
+                    xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": 
get_url_for_data_file("tdf165658.csv")}))
+                    xOpen = dialog.getChild("open")
+                    xOpen.executeAction("CLICK", tuple())
+
+                self.assertEqual(get_url_for_data_file("tdf165658.csv"), 
get_state_as_dict(xURL)['Text'])
+                self.assertEqual("CSV", 
get_state_as_dict(xProvider)['DisplayText'])
+
+                # tdf#165658: without the fix in place, it would have crashed 
here
+                with self.ui_test.execute_blocking_action(
+                        xApply.executeAction, args=('CLICK', ()), 
close_button="close") as dialog:
+                    pass
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf165658.csv b/sc/qa/uitest/data/tdf165658.csv
new file mode 100644
index 000000000000..f78bfd109200
--- /dev/null
+++ b/sc/qa/uitest/data/tdf165658.csv
@@ -0,0 +1,4 @@
+"#No lap";"time";"total time";"lap time";"IM";"IM lap";"DM";"DM 
lap";"TMU";"TMU lap";"SC";"SC lap";"note";"Arithmetic mean";"Median";"Minimum 
value";"Maximum value";"Standard deviation"
+"1";"2023-10-24 
14:05:15";"00:11.260";"00:11.260";"0.312778";"0.312778";"0.183333";"0.183333";"312.777771";"312.777771";"11";"11";"";"00:11.260";"00:11.260";"00:11.260";"00:11.260";"null"
+"2";"2023-10-24 
14:05:37";"00:20.427";"00:09.167";"0.567417";"0.254639";"0.333333";"0.150000";"567.416687";"254.638885";"20";"9";"";"00:10.213";"00:10.213";"00:09.167";"00:11.260";"00:01.479"
+"3";"2023-10-24 
14:05:48";"00:31.154";"00:10.727";"0.865389";"0.297972";"0.516667";"0.166667";"865.388916";"297.972229";"31";"10";"";"00:10.384";"00:10.727";"00:09.167";"00:11.260";"00:01.087"

Reply via email to