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/calc_tests6 | |
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/calc_tests6')
-rw-r--r-- | sc/qa/uitest/calc_tests6/multipleOperations.py | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/sc/qa/uitest/calc_tests6/multipleOperations.py b/sc/qa/uitest/calc_tests6/multipleOperations.py index d649bb8dea9d..ade3008f9af1 100644 --- a/sc/qa/uitest/calc_tests6/multipleOperations.py +++ b/sc/qa/uitest/calc_tests6/multipleOperations.py @@ -38,15 +38,12 @@ class multipleOperations(UITestCase): #Select the range D2:E11 xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "D2:E11"})) #Choose Data > Multiple Operations. - self.ui_test.execute_modeless_dialog_through_command(".uno:TableOperationDialog") - xDialog = self.xUITest.getTopFocusWindow() - #Formulas = B5 ; Column input cell = B4 - formulas = xDialog.getChild("formulas") - col = xDialog.getChild("col") - formulas.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$5"})) - col.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$4"})) - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) + with self.ui_test.execute_modeless_dialog_through_command_guarded(".uno:TableOperationDialog") as xDialog: + #Formulas = B5 ; Column input cell = B4 + formulas = xDialog.getChild("formulas") + col = xDialog.getChild("col") + formulas.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$5"})) + col.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$4"})) #verify self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), -6000) self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), -2000) @@ -85,15 +82,12 @@ class multipleOperations(UITestCase): #Select the range D2:F11 xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "D2:F11"})) #Choose Data > Multiple Operations. - self.ui_test.execute_modeless_dialog_through_command(".uno:TableOperationDialog") - xDialog = self.xUITest.getTopFocusWindow() - #Formulas = B5 ; Column input cell = B4 - formulas = xDialog.getChild("formulas") - col = xDialog.getChild("col") - formulas.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$5:$C$5"})) - col.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$4"})) - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) + with self.ui_test.execute_modeless_dialog_through_command_guarded(".uno:TableOperationDialog") as xDialog: + #Formulas = B5 ; Column input cell = B4 + formulas = xDialog.getChild("formulas") + col = xDialog.getChild("col") + formulas.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$5:$C$5"})) + col.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$4"})) #verify self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), -6000) self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), -2000) |