diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-09-10 17:45:55 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-09-13 10:36:51 +0200 |
commit | 47847b879bf6b5bb6e0f6117e0f9683b3a932a08 (patch) | |
tree | f22e2316b69fa74630d8ec7ed48da0e9077a16df /sc/qa/uitest/function_wizard | |
parent | a917d4abd8577cf7d6655f0484ff55dd86a0a8a1 (diff) |
uitest: guard execute_modeless_dialog_through_command in sc
Change-Id: Ifd03ae26659ff56d36bfe8d4938d690ada761d5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121912
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/uitest/function_wizard')
-rw-r--r-- | sc/qa/uitest/function_wizard/function_wizard.py | 9 | ||||
-rw-r--r-- | sc/qa/uitest/function_wizard/tdf123479.py | 19 | ||||
-rw-r--r-- | sc/qa/uitest/function_wizard/tdf132173.py | 11 |
3 files changed, 15 insertions, 24 deletions
diff --git a/sc/qa/uitest/function_wizard/function_wizard.py b/sc/qa/uitest/function_wizard/function_wizard.py index f2356e9ba4fc..b31649edb0cf 100644 --- a/sc/qa/uitest/function_wizard/function_wizard.py +++ b/sc/qa/uitest/function_wizard/function_wizard.py @@ -14,15 +14,12 @@ class FunctionWizardTest(UITestCase): def test_open_function_wizard(self): with self.ui_test.create_doc_in_start_center("calc"): - self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog") + with self.ui_test.execute_modeless_dialog_through_command_guarded(".uno:FunctionDialog", close_button="cancel") as xFunctionDlg: - xFunctionDlg = self.xUITest.getTopFocusWindow() - xArrayChkBox = xFunctionDlg.getChild("array") - xArrayChkBox.executeAction("CLICK", tuple()) + xArrayChkBox = xFunctionDlg.getChild("array") + xArrayChkBox.executeAction("CLICK", tuple()) - xCancelBtn = xFunctionDlg.getChild("cancel") - self.ui_test.close_dialog_through_button(xCancelBtn) # 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 index b94037855c16..d37e8e879683 100644 --- a/sc/qa/uitest/function_wizard/tdf123479.py +++ b/sc/qa/uitest/function_wizard/tdf123479.py @@ -25,19 +25,16 @@ class tdf123479(UITestCase): #Select D14:D16 gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D14:D16"})) #Open Formula Wizard (Ctrl+F2) - self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog") - xDialog = self.xUITest.getTopFocusWindow() - edArg1 = xDialog.getChild("ED_ARG1") - edArg2 = xDialog.getChild("ED_ARG2") - formulaRes = xDialog.getChild("formula_result") + with self.ui_test.execute_modeless_dialog_through_command_guarded(".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}") + #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}") - xOk = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOk) #verify; no crashes self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getString(), "Pass/Fail") diff --git a/sc/qa/uitest/function_wizard/tdf132173.py b/sc/qa/uitest/function_wizard/tdf132173.py index cad38a306d64..f29cc32171b9 100644 --- a/sc/qa/uitest/function_wizard/tdf132173.py +++ b/sc/qa/uitest/function_wizard/tdf132173.py @@ -13,15 +13,12 @@ class tdf132173(UITestCase): def test_tdf132173(self): with self.ui_test.create_doc_in_start_center("calc") as document: - self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog") - xDialog = self.xUITest.getTopFocusWindow() - xFormula = xDialog.getChild("ed_formula") - xFormula.executeAction("TYPE", mkPropertyValues({"TEXT": 'FIND({"A";"B";"C"},"SAMPLE TEXT")'})) + with self.ui_test.execute_modeless_dialog_through_command_guarded(".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")') + self.assertEqual(get_state_as_dict(xFormula)["Text"], '=FIND({"A";"B";"C"},"SAMPLE TEXT")') - xOk = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOk) #Without the fix in place, cell's value would have been #NAME? |