summaryrefslogtreecommitdiff
path: root/sw/qa/uitest/writer_tests7/tdf122780.py
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/uitest/writer_tests7/tdf122780.py')
-rw-r--r--sw/qa/uitest/writer_tests7/tdf122780.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/sw/qa/uitest/writer_tests7/tdf122780.py b/sw/qa/uitest/writer_tests7/tdf122780.py
index 09f881c5c781..45f6a75b5906 100644
--- a/sw/qa/uitest/writer_tests7/tdf122780.py
+++ b/sw/qa/uitest/writer_tests7/tdf122780.py
@@ -13,16 +13,14 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class tdf122780(UITestCase):
def test_tdf122780(self):
- writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf122780.docx"))
- self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
+ with self.ui_test.load_file(get_url_for_data_file("tdf122780.docx")) as writer_doc:
+ self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
- # Without the fix in place, this test would have hung here
- xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual("Normal_x005F", get_state_as_dict(xDialog.getChild('showtemplate'))['Text'][:12])
- self.assertEqual(32767, len(get_state_as_dict(xDialog.getChild('showtemplate'))['Text']))
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have hung here
+ xDialog = self.xUITest.getTopFocusWindow()
+ self.assertEqual("Normal_x005F", get_state_as_dict(xDialog.getChild('showtemplate'))['Text'][:12])
+ self.assertEqual(32767, len(get_state_as_dict(xDialog.getChild('showtemplate'))['Text']))
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
# vim: set shiftwidth=4 softtabstop=4 expandtab: