diff options
author | Robert Löhning <robert.loehning@qt.io> | 2024-04-11 15:37:25 +0200 |
---|---|---|
committer | Robert Löhning <robert.loehning@qt.io> | 2024-04-18 09:32:52 +0000 |
commit | db492c461cc532e0419978643ff23cc87ee6d4ad (patch) | |
tree | 38eb9582bed88983afb25791049aa6677c238b58 /tests | |
parent | 6e44fd29f1151b330adbe60e3e51b2fa9edb034a (diff) |
SquishTests: Log found shortcut in tst_HELP02
Change-Id: I144dc9961d97968d3b0355487714d287d22abb71
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'tests')
-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 31a3e7c2de..b6246e4f05 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(): |