forked from qt-creator/qt-creator
Squish: Fix searching for filename in windowTitle
Currently, only the end of a filename as actually compared since the title also contains "filename.h" when the title starts with "otherfilename.h" Change-Id: I60dd4dc1fd7c53fee2ddbc44953bcfe4d75c7530 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -267,7 +267,7 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False):
|
||||
if treeViewSyntax:
|
||||
expected = simpleFileName(curFile)
|
||||
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
|
||||
if not waitFor("expected in str(mainWindow.windowTitle)", 5000):
|
||||
if not waitFor("str(mainWindow.windowTitle).startswith(expected + ' ')", 5000):
|
||||
test.fatal("Window title (%s) did not switch to expected file (%s)."
|
||||
% (str(mainWindow.windowTitle), expected))
|
||||
try:
|
||||
@@ -387,7 +387,7 @@ def openDocument(treeElement):
|
||||
doubleClickItem(navigator, treeElement, 5, 5, 0, Qt.LeftButton)
|
||||
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
|
||||
expected = str(item.text).split("/")[-1]
|
||||
if waitFor("expected in str(mainWindow.windowTitle)", 5000):
|
||||
if waitFor("str(mainWindow.windowTitle).startswith(expected + ' ')", 5000):
|
||||
return True
|
||||
test.log("Expected file (%s) was not being opened in openDocument()" % expected)
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user