forked from qt-creator/qt-creator
Squish: Stabilize tests that rely on a parsed project
As more and more progress bars might be present for different purposes and we are not able to easily distinguish them we need to use a more reliable way to wait for the end of parsing a project. Add a respective function and use the new approach where this appears to be appropriate or necessary. Change-Id: I20e2b9b0efd4785f8f0b1ddbc8496be111628669 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
@@ -662,3 +662,12 @@ def addCPlusPlusFile(name, template, projectName, forceOverwrite=False, addToVCS
|
||||
buttonToClick = 'Cancel'
|
||||
clickButton("{text='%s' type='QPushButton' unnamed='1' visible='1' window=%s}"
|
||||
% (buttonToClick, overwriteDialog))
|
||||
|
||||
# if one of the parameters is set to 0 or below the respective parsing won't be waited for
|
||||
def waitForProjectParsing(projectParsingTimeout=10000, codemodelParsingTimeout=10000):
|
||||
if projectParsingTimeout > 0:
|
||||
runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton')
|
||||
# Wait for parsing to complete
|
||||
waitFor("runButton.enabled", projectParsingTimeout)
|
||||
if codemodelParsingTimeout > 0:
|
||||
progressBarWait(codemodelParsingTimeout)
|
||||
|
@@ -44,7 +44,7 @@ def main():
|
||||
# open example project
|
||||
openQmakeProject(examplePath)
|
||||
# wait for parsing to complete
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
checkCodeModelSettings(useClang)
|
||||
# open .cpp file in editor
|
||||
if not openDocument("openglwindow.Sources.main\\.cpp"):
|
||||
|
@@ -43,7 +43,7 @@ def main():
|
||||
# open example project
|
||||
openQmakeProject(examplePath)
|
||||
# wait for parsing to complete
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
checkCodeModelSettings(useClang)
|
||||
# open .cpp file in editor
|
||||
if not openDocument("openglwindow.Sources.main\\.cpp"):
|
||||
|
@@ -99,7 +99,7 @@ def main():
|
||||
# select "Open project" and select a project
|
||||
examplePath = os.path.join(prepareTemplate(sourceExample), "animation.pro")
|
||||
openQmakeProject(examplePath, fromWelcome = True)
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
|
||||
" text~='animation( \(.*\))?' type='QModelIndex'}"),
|
||||
"Verifying: The project is opened in 'Edit' mode after configuring.")
|
||||
|
@@ -42,7 +42,7 @@ def main():
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(proFile)
|
||||
progressBarWait(20000)
|
||||
waitForProjectParsing()
|
||||
selectFromLocator("dummy.cpp")
|
||||
|
||||
## Waiting for a solution from Froglogic to make the below work.
|
||||
|
@@ -42,7 +42,7 @@ def main():
|
||||
if not startedWithoutPluginError():
|
||||
return
|
||||
openQmakeProject(SpeedCrunchPath, [Targets.DESKTOP_4_8_7_DEFAULT])
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
|
||||
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
||||
|
||||
|
@@ -60,7 +60,7 @@ def main():
|
||||
test.fatal("Could not open/create cmake project - leaving test")
|
||||
invokeMenuItem("File", "Exit")
|
||||
return
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
||||
if cmakeSupportsServerMode():
|
||||
treeFile = "projecttree_speedcrunch_server.tsv"
|
||||
|
@@ -46,7 +46,7 @@ def main():
|
||||
"OTHER_FILES += example.qml")
|
||||
invokeMenuItem("File", "Save All")
|
||||
invokeMenuItem("File", "Close All")
|
||||
progressBarWait()
|
||||
waitForProjectParsing()
|
||||
for filetype, filename in [["Headers", "person.h"],
|
||||
["Sources", "main.cpp"],
|
||||
["Sources", "person.cpp"],
|
||||
@@ -66,7 +66,7 @@ def main():
|
||||
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
|
||||
previous, filename)
|
||||
# QTCREATORBUG-13176 does update the navigator async
|
||||
progressBarWait()
|
||||
waitForProjectParsing()
|
||||
if filetype == "Headers":
|
||||
verifyRenamedIncludes(templateDir, "main.cpp", previous, filename)
|
||||
verifyRenamedIncludes(templateDir, "person.cpp", previous, filename)
|
||||
|
@@ -40,7 +40,7 @@ def main():
|
||||
checkWelcomePage(sessionName, True)
|
||||
for project in projects:
|
||||
openQmakeProject(project, [Targets.DESKTOP_5_6_1_DEFAULT])
|
||||
progressBarWait(20000)
|
||||
waitForProjectParsing()
|
||||
checkNavigator(52, "Verifying whether all projects have been opened.")
|
||||
openDocument("animation.Resources.animation\\.qrc./animation.basics.animators\\.qml")
|
||||
openDocument("keyinteraction.Sources.main\\.cpp")
|
||||
|
@@ -33,7 +33,7 @@ def main():
|
||||
# using a temporary directory won't mess up a potentially existing
|
||||
createNewQmlExtension(tempDir(), [target])
|
||||
# wait for parsing to complete
|
||||
progressBarWait(30000)
|
||||
waitForProjectParsing()
|
||||
test.log("Building project Qt Quick 2 Extension Plugin (%s)"
|
||||
% Targets.getStringForTarget(target))
|
||||
invokeMenuItem("Build","Build All")
|
||||
|
Reference in New Issue
Block a user