sc/qa/uitest/calc_tests2/xmlSource.py | 30 ++++++++++++++++++++++++++++++ sc/qa/uitest/data/tdf153604.xml | 6 ++++++ 2 files changed, 36 insertions(+)
New commits: commit c83516b378a1587fd099b550d046c89841e8add9 Author: Xisco Fauli <[email protected]> AuthorDate: Tue Feb 14 12:43:47 2023 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Tue Feb 14 14:26:50 2023 +0000 tdf#153604: sc: Add UItest Change-Id: I3edcb60c793354b4471052e428ef6ac1b93cbdd5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147005 Tested-by: Xisco Fauli <[email protected]> Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/qa/uitest/calc_tests2/xmlSource.py b/sc/qa/uitest/calc_tests2/xmlSource.py index b2038d23359a..59a3abd2b51d 100644 --- a/sc/qa/uitest/calc_tests2/xmlSource.py +++ b/sc/qa/uitest/calc_tests2/xmlSource.py @@ -59,4 +59,34 @@ class xmlSource(UITestCase): self.assertEqual("service", get_cell_by_position(calc_doc, 1, 6, 0).getString()) self.assertEqual("disabled", get_cell_by_position(calc_doc, 1, 7, 0).getString()) + def test_tdf153604(self): + + with self.ui_test.create_doc_in_start_center("calc") as calc_doc: + + with self.ui_test.execute_modeless_dialog_through_command(".uno:ManageXMLSource") as xDialog: + + xSource = xDialog.getChild("selectsource") + + with self.ui_test.execute_blocking_action(xSource.executeAction, args=('CLICK', ()), close_button="open") as xOpenDialog: + xFileName = xOpenDialog.getChild("file_name") + xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": get_url_for_data_file("tdf153604.xml")})) + + xTree = xDialog.getChild("tree") + self.assertEqual('2', get_state_as_dict(xTree)["Children"]) + + xTree.getChild('0').executeAction("SELECT", tuple()) + xTree.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"})) + + self.assertEqual("data", get_state_as_dict(xTree)["SelectEntryText"]) + + xEdit = xDialog.getChild("edit") + xEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "$A$1"})) + + # Without the fix in place, this test would have failed with + # AssertionError: 'data' != '' + self.assertEqual("data", get_cell_by_position(calc_doc, 0, 0, 0).getString()) + self.assertEqual("v1", get_cell_by_position(calc_doc, 0, 0, 1).getString()) + self.assertEqual("v2", get_cell_by_position(calc_doc, 0, 0, 2).getString()) + self.assertEqual("v3", get_cell_by_position(calc_doc, 0, 0, 3).getString()) + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/tdf153604.xml b/sc/qa/uitest/data/tdf153604.xml new file mode 100644 index 000000000000..e43b4773415f --- /dev/null +++ b/sc/qa/uitest/data/tdf153604.xml @@ -0,0 +1,6 @@ +<?xml encoding="utf-8"?> +<root> + <data>v1</data> + <data>v2</data> + <data>v3</data> +</root>
