summaryrefslogtreecommitdiff
path: root/sw/qa/uitest/writer_tests4/spellDialog.py
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/uitest/writer_tests4/spellDialog.py')
-rw-r--r--sw/qa/uitest/writer_tests4/spellDialog.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/sw/qa/uitest/writer_tests4/spellDialog.py b/sw/qa/uitest/writer_tests4/spellDialog.py
index fe329ab344c3..fea337bd2c3f 100644
--- a/sw/qa/uitest/writer_tests4/spellDialog.py
+++ b/sw/qa/uitest/writer_tests4/spellDialog.py
@@ -104,28 +104,28 @@ frog, dogg, catt"""
supported_locale = self.is_supported_locale("en", "US")
if not supported_locale:
self.skipTest("no dictionary support for en_US available")
- writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf66043.fodt"))
- document = self.ui_test.get_component()
- # Step 1: Initiate spellchecking, and make sure "Check grammar" is
- # unchecked
- spell_dialog = self.launch_dialog()
- checkgrammar = spell_dialog.getChild('checkgrammar')
- if get_state_as_dict(checkgrammar)['Selected'] == 'true':
- checkgrammar.executeAction('CLICK', ())
- self.assertTrue(get_state_as_dict(checkgrammar)['Selected'] == 'false')
-
- # Step 2: Click on "Correct all" for each misspelling
- # prompt until end of document is reached.
- changeall = spell_dialog.getChild('changeall')
- changeall.executeAction("CLICK", ())
-
- xCloseBtn = spell_dialog.getChild("close")
- xCloseBtn.executeAction("CLICK", tuple())
-
- output_text = document.Text.getString().replace('\r\n', '\n')
- # This was "gooodgood baaad eeend" ("goood" is a deletion,
- # "good" is an insertion by fixing the first misspelling),
- # but now "goood" is not a misspelling because it is accepted
- # correctly without the redline containing a deleted "o"
- self.assertEqual(output_text, 'goood baaadbaaed eeend')
+ with self.ui_test.load_file(get_url_for_data_file("tdf66043.fodt")) as writer_doc:
+ document = self.ui_test.get_component()
+ # Step 1: Initiate spellchecking, and make sure "Check grammar" is
+ # unchecked
+ spell_dialog = self.launch_dialog()
+ checkgrammar = spell_dialog.getChild('checkgrammar')
+ if get_state_as_dict(checkgrammar)['Selected'] == 'true':
+ checkgrammar.executeAction('CLICK', ())
+ self.assertTrue(get_state_as_dict(checkgrammar)['Selected'] == 'false')
+
+ # Step 2: Click on "Correct all" for each misspelling
+ # prompt until end of document is reached.
+ changeall = spell_dialog.getChild('changeall')
+ changeall.executeAction("CLICK", ())
+
+ xCloseBtn = spell_dialog.getChild("close")
+ xCloseBtn.executeAction("CLICK", tuple())
+
+ output_text = document.Text.getString().replace('\r\n', '\n')
+ # This was "gooodgood baaad eeend" ("goood" is a deletion,
+ # "good" is an insertion by fixing the first misspelling),
+ # but now "goood" is not a misspelling because it is accepted
+ # correctly without the redline containing a deleted "o"
+ self.assertEqual(output_text, 'goood baaadbaaed eeend')