diff options
Diffstat (limited to 'sc/qa/uitest/function_wizard')
-rw-r--r-- | sc/qa/uitest/function_wizard/function_wizard.py | 26 | ||||
-rw-r--r-- | sc/qa/uitest/function_wizard/tdf123479.py | 39 | ||||
-rw-r--r-- | sc/qa/uitest/function_wizard/tdf132173.py | 30 | ||||
-rw-r--r-- | sc/qa/uitest/function_wizard/tdf37864.py | 35 |
4 files changed, 130 insertions, 0 deletions
diff --git a/sc/qa/uitest/function_wizard/function_wizard.py b/sc/qa/uitest/function_wizard/function_wizard.py new file mode 100644 index 000000000..5b5ff6533 --- /dev/null +++ b/sc/qa/uitest/function_wizard/function_wizard.py @@ -0,0 +1,26 @@ +# -*- 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 + + +class FunctionWizardTest(UITestCase): + # tdf#98427 + def test_open_function_wizard(self): + with self.ui_test.create_doc_in_start_center("calc"): + + with self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog", close_button="cancel") as xFunctionDlg: + + + xArrayChkBox = xFunctionDlg.getChild("array") + xArrayChkBox.executeAction("CLICK", tuple()) + + + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/function_wizard/tdf123479.py b/sc/qa/uitest/function_wizard/tdf123479.py new file mode 100644 index 000000000..aee7b97aa --- /dev/null +++ b/sc/qa/uitest/function_wizard/tdf123479.py @@ -0,0 +1,39 @@ +# -*- 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.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues + + +# Bug 123479 - Crash in: ScFormulaResult::GetMatrixFormulaCellToken() +class tdf123479(UITestCase): + def test_tdf123479_Crash_ScFormulaResult_GetMatrixFormulaCellToken(self): + #numberingformatpage.ui + with self.ui_test.load_file(get_url_for_data_file("tdf123479.ods")) as calc_doc: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + #Select D14:D16 + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D14:D16"})) + #Open Formula Wizard (Ctrl+F2) + with self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog") as xDialog: + edArg1 = xDialog.getChild("ED_ARG1") + edArg2 = xDialog.getChild("ED_ARG2") + formulaRes = xDialog.getChild("formula_result") + + #check formula wizard data + self.assertEqual(get_state_as_dict(edArg1)["Text"], "CHAR(10)") + self.assertEqual(get_state_as_dict(edArg2)["Text"], "OFFSET($Data.$A$2:$Data.$A$4,0,COLUMN()-3)") + self.assertEqual(get_state_as_dict(formulaRes)["Text"], "{4;4;4}") + + #verify; no crashes + self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getString(), "Pass/Fail") + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/function_wizard/tdf132173.py b/sc/qa/uitest/function_wizard/tdf132173.py new file mode 100644 index 000000000..18724b5c1 --- /dev/null +++ b/sc/qa/uitest/function_wizard/tdf132173.py @@ -0,0 +1,30 @@ +# -*- 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 +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf132173(UITestCase): + def test_tdf132173(self): + with self.ui_test.create_doc_in_start_center("calc") as document: + + with self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog") as xDialog: + xFormula = xDialog.getChild("ed_formula") + xFormula.executeAction("TYPE", mkPropertyValues({"TEXT": 'FIND({"A";"B";"C"},"SAMPLE TEXT")'})) + + self.assertEqual(get_state_as_dict(xFormula)["Text"], '=FIND({"A";"B";"C"},"SAMPLE TEXT")') + + + + #Without the fix in place, cell's value would have been #NAME? + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "2") + + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/function_wizard/tdf37864.py b/sc/qa/uitest/function_wizard/tdf37864.py new file mode 100644 index 000000000..b38b550fc --- /dev/null +++ b/sc/qa/uitest/function_wizard/tdf37864.py @@ -0,0 +1,35 @@ +# -*- 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 +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf37864(UITestCase): + + def test_tdf37864(self): + + with self.ui_test.create_doc_in_start_center("calc"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + enter_text_to_cell(gridwin, "A1", "test") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + + self.xUITest.executeCommand(".uno:Copy") + + with self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog") as xDialog: + xFormula = xDialog.getChild("ed_formula") + xFormula.executeAction("TYPE", mkPropertyValues({"KEYCODE": 'CTRL+v'})) + + # Without the fix in place, this test would have failed with + # AssertionError: '=test' != '=test\n' + self.assertEqual("=test", get_state_as_dict(xFormula)["Text"]) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: |