diff options
Diffstat (limited to 'tests/system/suite_HELP/tst_HELP02/test.py')
-rw-r--r-- | tests/system/suite_HELP/tst_HELP02/test.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/system/suite_HELP/tst_HELP02/test.py b/tests/system/suite_HELP/tst_HELP02/test.py index 31a3e7c2de4..b6246e4f05e 100644 --- a/tests/system/suite_HELP/tst_HELP02/test.py +++ b/tests/system/suite_HELP/tst_HELP02/test.py @@ -53,10 +53,6 @@ def checkQtCreatorHelpVersion(expectedVersion): test.fail("Missing Qt Creator Manual.") -def _shortcutMatches_(shortcutEdit, expectedText): - return str(findObject(shortcutEdit).text) == expectedText - - def setKeyboardShortcutForAboutQtC(): invokeMenuItem("Edit", "Preferences...") mouseClick(waitForObjectItem(":Options_QListView", "Environment")) @@ -78,16 +74,16 @@ def setKeyboardShortcutForAboutQtC(): "placeholderText='Enter key sequence as text'}" % shortcutGB) clickButton(record) nativeType(keysToType) - waitFor("_shortcutMatches_(shortcut, expectedKeys)", 5000) + waitFor(lambda: str(findObject(shortcut).text) == expectedKeys, 5000) clickButton(record) - gotExpectedShortcut = _shortcutMatches_(shortcut, expectedKeys) - if not gotExpectedShortcut and platform.system() == 'Darwin': + foundShortcut = str(findObject(shortcut).text) + if foundShortcut != expectedKeys and platform.system() == 'Darwin': test.warning("Squish Issue: shortcut was set to %s - entering it manually now" % waitForObject(shortcut).text) replaceEditorContent(shortcut, expectedKeys) else: - test.verify(gotExpectedShortcut, "Expected key sequence is displayed.") + test.compare(foundShortcut, expectedKeys, "Expected key sequence is displayed?") clickButton(waitForObject(":Options.OK_QPushButton")) def main(): |