diff options
Diffstat (limited to 'sc/qa/uitest/range_name/tdf138822.py')
-rw-r--r-- | sc/qa/uitest/range_name/tdf138822.py | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/sc/qa/uitest/range_name/tdf138822.py b/sc/qa/uitest/range_name/tdf138822.py index 361cc379e828..7cb8f990ed1b 100644 --- a/sc/qa/uitest/range_name/tdf138822.py +++ b/sc/qa/uitest/range_name/tdf138822.py @@ -11,53 +11,52 @@ from uitest.uihelper.common import type_text class tdf138822(UITestCase): def test_tdf138822(self): - self.ui_test.create_doc_in_start_center("calc") + with self.ui_test.create_doc_in_start_center_guarded("calc"): - calcDoc = self.xUITest.getTopFocusWindow() - xPosWindow = calcDoc.getChild('pos_window') - self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text']) + calcDoc = self.xUITest.getTopFocusWindow() + xPosWindow = calcDoc.getChild('pos_window') + self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text']) - self.ui_test.execute_modeless_dialog_through_command(".uno:DefineName") + self.ui_test.execute_modeless_dialog_through_command(".uno:DefineName") - xManageNamesDialog = self.xUITest.getTopFocusWindow() + xManageNamesDialog = self.xUITest.getTopFocusWindow() - xAddBtn = xManageNamesDialog.getChild("add") - self.ui_test.close_dialog_through_button(xAddBtn) + xAddBtn = xManageNamesDialog.getChild("add") + self.ui_test.close_dialog_through_button(xAddBtn) - xDefineNamesDialog = self.xUITest.getTopFocusWindow() + xDefineNamesDialog = self.xUITest.getTopFocusWindow() - xAddBtn = xDefineNamesDialog.getChild("add") - self.assertEqual("false", get_state_as_dict(xAddBtn)['Enabled']) + xAddBtn = xDefineNamesDialog.getChild("add") + self.assertEqual("false", get_state_as_dict(xAddBtn)['Enabled']) - xEdit = xDefineNamesDialog.getChild("edit") - type_text(xEdit, "rangeName") + xEdit = xDefineNamesDialog.getChild("edit") + type_text(xEdit, "rangeName") - self.assertEqual("true", get_state_as_dict(xAddBtn)['Enabled']) + self.assertEqual("true", get_state_as_dict(xAddBtn)['Enabled']) - self.ui_test.close_dialog_through_button(xAddBtn) + self.ui_test.close_dialog_through_button(xAddBtn) - xManageNamesDialog = self.xUITest.getTopFocusWindow() + xManageNamesDialog = self.xUITest.getTopFocusWindow() - xNamesList = xManageNamesDialog.getChild('names') - self.assertEqual(1, len(xNamesList.getChildren())) - self.assertEqual(get_state_as_dict(xNamesList.getChild('0'))["Text"], "rangeName\t$Sheet1.$A$1\tDocument (Global)") + xNamesList = xManageNamesDialog.getChild('names') + self.assertEqual(1, len(xNamesList.getChildren())) + self.assertEqual(get_state_as_dict(xNamesList.getChild('0'))["Text"], "rangeName\t$Sheet1.$A$1\tDocument (Global)") - xCancelBtn = xManageNamesDialog.getChild("cancel") - self.ui_test.close_dialog_through_button(xCancelBtn) + xCancelBtn = xManageNamesDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) - # Open the dialog again - self.ui_test.execute_modeless_dialog_through_command(".uno:DefineName") + # Open the dialog again + self.ui_test.execute_modeless_dialog_through_command(".uno:DefineName") - xManageNamesDialog = self.xUITest.getTopFocusWindow() - xNamesList = xManageNamesDialog.getChild('names') + xManageNamesDialog = self.xUITest.getTopFocusWindow() + xNamesList = xManageNamesDialog.getChild('names') - # Without the fix in place, this test would have failed with - # AssertionError: 0 != 1 - self.assertEqual(0, len(xNamesList.getChildren())) + # Without the fix in place, this test would have failed with + # AssertionError: 0 != 1 + self.assertEqual(0, len(xNamesList.getChildren())) - xOkBtn = xManageNamesDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOkBtn) + xOkBtn = xManageNamesDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) - self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: |