forked from qt-creator/qt-creator
Squish: Stabilize tst_HELP02
On Windows, the shortcut gets lost when clicking "Stop Recording" too quickly. Change-Id: Ieb89b7f59ded0792bf09fbad0b4b44a78d369c0f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -66,6 +66,11 @@ def checkQtCreatorHelpVersion(expectedVersion):
|
|||||||
test.log("Exception caught", "%s(%s)" % (str(t), str(v)))
|
test.log("Exception caught", "%s(%s)" % (str(t), str(v)))
|
||||||
test.fail("Missing Qt Creator Manual.")
|
test.fail("Missing Qt Creator Manual.")
|
||||||
|
|
||||||
|
|
||||||
|
def _shortcutMatches_(shortcutEdit, expectedText):
|
||||||
|
return str(findObject(shortcutEdit).text) == expectedText
|
||||||
|
|
||||||
|
|
||||||
def setKeyboardShortcutForAboutQtC():
|
def setKeyboardShortcutForAboutQtC():
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
mouseClick(waitForObjectItem(":Options_QListView", "Environment"))
|
mouseClick(waitForObjectItem(":Options_QListView", "Environment"))
|
||||||
@@ -85,20 +90,19 @@ def setKeyboardShortcutForAboutQtC():
|
|||||||
"visible='1' text~='(Stop Recording|Record)'}" % shortcutGB)
|
"visible='1' text~='(Stop Recording|Record)'}" % shortcutGB)
|
||||||
shortcut = ("{container=%s type='Utils::FancyLineEdit' unnamed='1' visible='1' "
|
shortcut = ("{container=%s type='Utils::FancyLineEdit' unnamed='1' visible='1' "
|
||||||
"placeholderText='Enter key sequence as text'}" % shortcutGB)
|
"placeholderText='Enter key sequence as text'}" % shortcutGB)
|
||||||
|
expected = 'Ctrl+Opt+A' if platform.system() == 'Darwin' else 'Ctrl+Alt+A'
|
||||||
clickButton(record)
|
clickButton(record)
|
||||||
nativeType("<Ctrl+Alt+a>")
|
nativeType("<Ctrl+Alt+a>")
|
||||||
|
waitFor("_shortcutMatches_(shortcut, expected)", 5000)
|
||||||
clickButton(record)
|
clickButton(record)
|
||||||
expected = 'Ctrl+Alt+A'
|
|
||||||
if platform.system() == 'Darwin':
|
|
||||||
expected = 'Ctrl+Opt+A'
|
|
||||||
|
|
||||||
shortcutMatches = waitFor("str(findObject(shortcut).text) == expected", 5000)
|
gotExpectedShortcut = _shortcutMatches_(shortcut, expected)
|
||||||
if not shortcutMatches and platform.system() == 'Darwin':
|
if not gotExpectedShortcut and platform.system() == 'Darwin':
|
||||||
test.warning("Squish Issue: shortcut was set to %s - entering it manually now"
|
test.warning("Squish Issue: shortcut was set to %s - entering it manually now"
|
||||||
% waitForObject(shortcut).text)
|
% waitForObject(shortcut).text)
|
||||||
replaceEditorContent(shortcut, expected)
|
replaceEditorContent(shortcut, expected)
|
||||||
else:
|
else:
|
||||||
test.verify(shortcutMatches, "Expected key sequence is displayed.")
|
test.verify(gotExpectedShortcut, "Expected key sequence is displayed.")
|
||||||
clickButton(waitForObject(":Options.OK_QPushButton"))
|
clickButton(waitForObject(":Options.OK_QPushButton"))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Reference in New Issue
Block a user