diff options
-rw-r--r-- | sc/qa/uitest/calc_tests6/tdf116996.py | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/sc/qa/uitest/calc_tests6/tdf116996.py b/sc/qa/uitest/calc_tests6/tdf116996.py index 7e3f4e61c43b..d6b21115c5ac 100644 --- a/sc/qa/uitest/calc_tests6/tdf116996.py +++ b/sc/qa/uitest/calc_tests6/tdf116996.py @@ -12,36 +12,30 @@ from uitest.uihelper.common import get_state_as_dict #Bug 116996 - Crash recover on selecting Tools -> Options -> Advanced: Enable experimental features class tdf116996(UITestCase): - def test_tdf116996_enable_experimental_feature(self): - with self.ui_test.create_doc_in_start_center("calc"): - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog", close_button="") as xDialogOpt: - xPages = xDialogOpt.getChild("pages") - xLOEntry = xPages.getChild('0') # Libreoffice - xLOEntry.executeAction("EXPAND", tuple()) - xAdvancedEntry = xLOEntry.getChild('10') - xAdvancedEntry.executeAction("SELECT", tuple()) #Libreoffice / Advanced - xexperimental = xDialogOpt.getChild("experimental") - xexperimental.executeAction("CLICK", tuple()) #enable experimental features - xOKBtn = xDialogOpt.getChild("ok") + def change_experimental_features(self, enabled): + with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog", close_button="") as xDialogOpt: + xPages = xDialogOpt.getChild("pages") + xLOEntry = xPages.getChild('0') # Libreoffice + xLOEntry.executeAction("EXPAND", tuple()) + xAdvancedEntry = xLOEntry.getChild('10') + xAdvancedEntry.executeAction("SELECT", tuple()) #Libreoffice / Advanced + xexperimental = xDialogOpt.getChild("experimental") + if get_state_as_dict(xexperimental)['Selected'] != enabled: + xexperimental.executeAction("CLICK", tuple()) #enable experimental features - with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="no"): - pass + self.assertEqual(get_state_as_dict(xexperimental)["Selected"], enabled) - #reopen options dialog and verify - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog", close_button="") as xDialogOpt: - xPages = xDialogOpt.getChild("pages") - xLOEntry = xPages.getChild('0') # Libreoffice - xLOEntry.executeAction("EXPAND", tuple()) - xAdvancedEntry = xLOEntry.getChild('10') - xAdvancedEntry.executeAction("SELECT", tuple()) #Libreoffice / Advanced - xexperimental = xDialogOpt.getChild("experimental") + xOKBtn = xDialogOpt.getChild("ok") - self.assertEqual(get_state_as_dict(xexperimental)["Selected"], "true") - xexperimental.executeAction("CLICK", tuple()) #disable experimental features - xOKBtn = xDialogOpt.getChild("ok") + with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="no"): + pass - with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="no"): - pass + def test_tdf116996_enable_experimental_feature(self): + with self.ui_test.create_doc_in_start_center("calc"): + try: + self.change_experimental_features("true") + finally: + self.change_experimental_features("false") # vim: set shiftwidth=4 softtabstop=4 expandtab: |