diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-21 16:21:30 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-22 14:46:39 +0200 |
commit | be0a41679fea524e0935dc6617b5e65349812dd1 (patch) | |
tree | f14372226d5054c045f954e38ea09da5c412215b /sfx2 | |
parent | 14069d84174ca7a4e60db4d75912903e9679b643 (diff) |
uitest: guard load_file
Mostly done by a script
for motivation, see 89aaa17a0a4413f07da2bc5084b0164f15dc01ac
< UITest: introduce guarded context managers >
Change-Id: Ia924293dc2a12230fd13f69fd734875ced86be8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117593
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/qa/uitest/doc/objserv.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sfx2/qa/uitest/doc/objserv.py b/sfx2/qa/uitest/doc/objserv.py index 369c2a4393fd..7c658be8dfd8 100644 --- a/sfx2/qa/uitest/doc/objserv.py +++ b/sfx2/qa/uitest/doc/objserv.py @@ -13,17 +13,15 @@ class Test(UITestCase): def testPdfSigning(self): # Start Impress. - impress_doc = self.ui_test.load_file(get_url_for_data_file("pdf-sign.pdf")) - doc = self.xUITest.getTopFocusWindow() - - # Now use File -> Digital signatures -> Digital signatures. - self.ui_test.execute_dialog_through_command(".uno:Signature") - xDialog = self.xUITest.getTopFocusWindow() - # Without the accompanying fix in place, this test would have failed with: - # uno.com.sun.star.uno.RuntimeException: Could not find child with id: close vcl/source/uitest/uiobject.cxx:452 - self.ui_test.close_dialog_through_button(xDialog.getChild("close")) - - self.ui_test.close_doc() + with self.ui_test.load_file(get_url_for_data_file("pdf-sign.pdf")) as impress_doc: + doc = self.xUITest.getTopFocusWindow() + + # Now use File -> Digital signatures -> Digital signatures. + self.ui_test.execute_dialog_through_command(".uno:Signature") + xDialog = self.xUITest.getTopFocusWindow() + # Without the accompanying fix in place, this test would have failed with: + # uno.com.sun.star.uno.RuntimeException: Could not find child with id: close vcl/source/uitest/uiobject.cxx:452 + self.ui_test.close_dialog_through_button(xDialog.getChild("close")) # vim: set shiftwidth=4 softtabstop=4 expandtab: |