forked from qt-creator/qt-creator
Squish: Fix triggering items listed under "Recent Files"
UI has changed again, so adapt the test to reflect this. Change-Id: I5d6bcf2b48b8b625f6086f5a1101041a73d7e329 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
@@ -198,7 +198,7 @@ def invokeMenuItem(menu, item, *subItems):
|
|||||||
itemObject = waitForObjectItem(objectMap.realName(menuObject), item)
|
itemObject = waitForObjectItem(objectMap.realName(menuObject), item)
|
||||||
waitFor("itemObject.enabled", 2000)
|
waitFor("itemObject.enabled", 2000)
|
||||||
activateItem(itemObject)
|
activateItem(itemObject)
|
||||||
numberedPrefix = "&?\\d+: "
|
numberedPrefix = "(&\\d \| )?"
|
||||||
for subItem in subItems:
|
for subItem in subItems:
|
||||||
sub = itemObject.menu()
|
sub = itemObject.menu()
|
||||||
waitFor("sub.visible", 1000)
|
waitFor("sub.visible", 1000)
|
||||||
@@ -209,7 +209,7 @@ def invokeMenuItem(menu, item, *subItems):
|
|||||||
for i in range(actions.count()):
|
for i in range(actions.count()):
|
||||||
current = actions.at(i)
|
current = actions.at(i)
|
||||||
nonPrefix = subItem[len(numberedPrefix):]
|
nonPrefix = subItem[len(numberedPrefix):]
|
||||||
matcher = re.match("(%s)(.*)" % numberedPrefix, str(current.text))
|
matcher = re.match("%s(.*)" % numberedPrefix, str(current.text))
|
||||||
if matcher and matcher.group(2) == nonPrefix:
|
if matcher and matcher.group(2) == nonPrefix:
|
||||||
itemObject = current
|
itemObject = current
|
||||||
activateItem(itemObject)
|
activateItem(itemObject)
|
||||||
|
@@ -213,7 +213,7 @@ def main():
|
|||||||
recentFile = os.path.join(folder, current)
|
recentFile = os.path.join(folder, current)
|
||||||
if recentFile.startswith(home) and platform.system() in ('Linux', 'Darwin'):
|
if recentFile.startswith(home) and platform.system() in ('Linux', 'Darwin'):
|
||||||
recentFile = recentFile.replace(home, "~", 1)
|
recentFile = recentFile.replace(home, "~", 1)
|
||||||
invokeMenuItem("File", "Recent Files", "&?\\d+: %s" % recentFile)
|
invokeMenuItem("File", "Recent Files", "(&\\d \| )?%s" % recentFile)
|
||||||
editor = getEditorForFileSuffix(current)
|
editor = getEditorForFileSuffix(current)
|
||||||
display = displayHintForHighlighterDefinition(current, patterns, lPatterns,
|
display = displayHintForHighlighterDefinition(current, patterns, lPatterns,
|
||||||
addedHighlighterDefinition,
|
addedHighlighterDefinition,
|
||||||
|
Reference in New Issue
Block a user