diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-07-23 21:04:20 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-07-23 21:09:56 +0200 |
commit | 3c077e587d36170be53bad90bd5c87364295426c (patch) | |
tree | c55c9e4d65e132a8e1aafb68d6019f6641d23d4f /uitest/writer_tests | |
parent | 741d794adc0fabbcfb9ef847ad0369d7281b964d (diff) |
uitest: handle the case without dictionaries in the UI tests
Change-Id: Icc63deeb182f0c380780332793a3af1f7a51577b
Diffstat (limited to 'uitest/writer_tests')
-rw-r--r-- | uitest/writer_tests/spellDialog.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/uitest/writer_tests/spellDialog.py b/uitest/writer_tests/spellDialog.py index 9b36ea2a0aa6..41453fac2f33 100644 --- a/uitest/writer_tests/spellDialog.py +++ b/uitest/writer_tests/spellDialog.py @@ -6,8 +6,25 @@ from uitest.framework import UITestCase +from libreoffice.linguistic.linguservice import get_spellchecker + class SpellingAndGrammarDialog(UITestCase): + def is_supported_locale(self, language, country): + xSpellChecker = get_spellchecker(self.ui_test._xContext) + locales = xSpellChecker.getLocales() + for locale in locales: + if language != None: + if locale.Language != language: + continue + + if country != None: + if locale.Country != country: + continue + + # we found the correct combination + return True + def launch_dialog(self): self.ui_test.execute_modeless_dialog_through_command( ".uno:SpellingAndGrammarDialog") @@ -33,6 +50,9 @@ dog tact frog, dog, tact""" def test_tdf46852(self): + supported_locale = self.is_supported_locale("en", "US") + if not supported_locale: + self.skipTest("no dictionary support for en_US available") # This automates the steps described in the bug report tdf#46852 # Step 1: Create a document with repetitious misspelled words |