summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
Diffstat (limited to 'uitest')
-rw-r--r--uitest/uitest/uihelper/guarded.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/uitest/uitest/uihelper/guarded.py b/uitest/uitest/uihelper/guarded.py
index b7e5ce099d1e..b75aea332ff3 100644
--- a/uitest/uitest/uihelper/guarded.py
+++ b/uitest/uitest/uihelper/guarded.py
@@ -18,6 +18,16 @@ def load_file(testCase, url):
finally:
testCase.ui_test.close_doc()
+# Calls UITest.close_doc at exit
+@contextmanager
+def create_doc_in_start_center(testCase, app):
+ testCase.ui_test.create_doc_in_start_center(app)
+ component = testCase.ui_test.get_component()
+ try:
+ yield component
+ finally:
+ testCase.ui_test.close_doc()
+
# Calls UITest.close_dialog_through_button at exit
@contextmanager
def execute_dialog_through_action(testCase, ui_object, action, parameters = None, event_name = "DialogExecute", close_button = "ok"):
@@ -28,4 +38,14 @@ def execute_dialog_through_action(testCase, ui_object, action, parameters = None
finally:
testCase.ui_test.close_dialog_through_button(xDialog.getChild(close_button))
+# Calls UITest.close_dialog_through_button at exit
+@contextmanager
+def execute_dialog_through_command(testCase, command, printNames=False, close_button = "ok"):
+ testCase.ui_test.execute_dialog_through_command(command, printNames)
+ xDialog = testCase.xUITest.getTopFocusWindow()
+ try:
+ yield xDialog
+ finally:
+ testCase.ui_test.close_dialog_through_button(xDialog.getChild(close_button))
+
# vim: set shiftwidth=4 softtabstop=4 expandtab: