diff options
Diffstat (limited to 'sc/qa/uitest/goalSeek/tdf43693.py')
-rw-r--r-- | sc/qa/uitest/goalSeek/tdf43693.py | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/sc/qa/uitest/goalSeek/tdf43693.py b/sc/qa/uitest/goalSeek/tdf43693.py index 07e4ece7ab1a..43bce6da86bd 100644 --- a/sc/qa/uitest/goalSeek/tdf43693.py +++ b/sc/qa/uitest/goalSeek/tdf43693.py @@ -15,25 +15,24 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class tdf43693(UITestCase): def test_tdf43693_goalSeek(self): - calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf43693.ods")) - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - document = self.ui_test.get_component() - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "K248"})) - self.ui_test.execute_modeless_dialog_through_command(".uno:GoalSeekDialog") - xDialog = self.xUITest.getTopFocusWindow() - xformulaedit = xDialog.getChild("formulaedit") - xtarget = xDialog.getChild("target") - xvaredit = xDialog.getChild("varedit") - xtarget.executeAction("TYPE", mkPropertyValues({"TEXT":"0"})) - xvaredit.executeAction("TYPE", mkPropertyValues({"TEXT":"H5"})) - xOKBtn = xDialog.getChild("ok") + with self.ui_test.load_file(get_url_for_data_file("tdf43693.ods")) as calc_doc: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "K248"})) + self.ui_test.execute_modeless_dialog_through_command(".uno:GoalSeekDialog") + xDialog = self.xUITest.getTopFocusWindow() + xformulaedit = xDialog.getChild("formulaedit") + xtarget = xDialog.getChild("target") + xvaredit = xDialog.getChild("varedit") + xtarget.executeAction("TYPE", mkPropertyValues({"TEXT":"0"})) + xvaredit.executeAction("TYPE", mkPropertyValues({"TEXT":"H5"})) + xOKBtn = xDialog.getChild("ok") - with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="yes"): - pass + with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="yes"): + pass - #verify - self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue(), 0.04) - self.ui_test.close_doc() + #verify + self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue(), 0.04) # vim: set shiftwidth=4 softtabstop=4 expandtab: |