Squish: Use examples and docs from Qt 5 in suite_WELP

Change-Id: Iddfa426e9c6133bd1f12ec8e119816c2d38ba55a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Loehning
2016-08-19 12:56:03 +02:00
committed by Christian Stenger
parent 309be8277d
commit b252733e63
2 changed files with 10 additions and 21 deletions

View File

@@ -38,8 +38,8 @@ def main():
test.log("Welcome mode is not scriptable with this Squish version") test.log("Welcome mode is not scriptable with this Squish version")
return return
# prepare example project # prepare example project
sourceExample = os.path.join(sdkPath, "Examples", "4.7", "declarative", "animation", "basics", sourceExample = os.path.join(Qt5Path.examplesPath(Targets.DESKTOP_561_DEFAULT),
"property-animation") "quick", "animation")
if not neededFilePresent(sourceExample): if not neededFilePresent(sourceExample):
return return
# open Qt Creator # open Qt Creator
@@ -72,16 +72,16 @@ def main():
checkTypeAndProperties(typePropDet) checkTypeAndProperties(typePropDet)
# select "Open project" and select a project # select "Open project" and select a project
examplePath = os.path.join(prepareTemplate(sourceExample), "propertyanimation.pro") examplePath = os.path.join(prepareTemplate(sourceExample), "animation.pro")
openQmakeProject(examplePath, fromWelcome = True) openQmakeProject(examplePath, fromWelcome = True)
progressBarWait(30000) progressBarWait(30000)
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'" test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text~='propertyanimation( \(.*\))?' type='QModelIndex'}"), " text~='animation( \(.*\))?' type='QModelIndex'}"),
"Verifying: The project is opened in 'Edit' mode after configuring.") "Verifying: The project is opened in 'Edit' mode after configuring.")
# go to "Welcome page" again and check if there is an information about recent projects # go to "Welcome page" again and check if there is an information about recent projects
switchViewTo(ViewConstants.WELCOME) switchViewTo(ViewConstants.WELCOME)
test.verify(checkIfObjectExists(getQmlItem("Text", welcomePage, False, test.verify(checkIfObjectExists(getQmlItem("Text", welcomePage, False,
"text='propertyanimation'")) and "text='animation'")) and
checkIfObjectExists(getQmlItem("Text", welcomePage, False, checkIfObjectExists(getQmlItem("Text", welcomePage, False,
"text='SampleApp'")), "text='SampleApp'")),
"Verifying: 'Welcome page' displays information about recently created and " "Verifying: 'Welcome page' displays information about recently created and "

View File

@@ -44,13 +44,12 @@ def main():
if not canTestEmbeddedQtQuick(): if not canTestEmbeddedQtQuick():
test.log("Welcome mode is not scriptable with this Squish version") test.log("Welcome mode is not scriptable with this Squish version")
return return
global sdkPath
welcomePage = ":Qt Creator.WelcomePage_QQuickWidget" welcomePage = ":Qt Creator.WelcomePage_QQuickWidget"
# open Qt Creator # open Qt Creator
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
qchs = [os.path.join(sdkPath, "Documentation", "qt.qch")] qchs = []
for p in Qt5Path.getPaths(Qt5Path.DOCS): for p in Qt5Path.getPaths(Qt5Path.DOCS):
qchs.extend([os.path.join(p, "qtopengl.qch"), os.path.join(p, "qtwidgets.qch")]) qchs.extend([os.path.join(p, "qtopengl.qch"), os.path.join(p, "qtwidgets.qch")])
addHelpDocumentation(qchs) addHelpDocumentation(qchs)
@@ -67,13 +66,8 @@ def main():
5, 5, 0, Qt.LeftButton) 5, 5, 0, Qt.LeftButton)
test.verify(checkIfObjectExists(getQmlItem("Text", welcomePage, False, "text='Examples'")), test.verify(checkIfObjectExists(getQmlItem("Text", welcomePage, False, "text='Examples'")),
"Verifying: 'Examples' topic is opened and the examples are shown.") "Verifying: 'Examples' topic is opened and the examples are shown.")
basePath = "opengl/2dpainting/2dpainting.pro" proFiles = map(lambda p: os.path.join(p, "opengl", "2dpainting", "2dpainting.pro"),
qt4Exmpl = os.path.join(sdkPath, "Examples", "4.7", basePath) Qt5Path.getPaths(Qt5Path.EXAMPLES))
qt5Exmpls = []
for p in Qt5Path.getPaths(Qt5Path.EXAMPLES):
qt5Exmpls.append(os.path.join(p, basePath))
proFiles = [qt4Exmpl]
proFiles.extend(qt5Exmpls)
cleanUpUserFiles(proFiles) cleanUpUserFiles(proFiles)
for p in proFiles: for p in proFiles:
removePackagingDirectory(os.path.dirname(p)) removePackagingDirectory(os.path.dirname(p))
@@ -115,13 +109,8 @@ def main():
# go to "Welcome" page and choose another example # go to "Welcome" page and choose another example
switchViewTo(ViewConstants.WELCOME) switchViewTo(ViewConstants.WELCOME)
basePath = "itemviews/addressbook/addressbook.pro" proFiles = map(lambda p: os.path.join(p, "widgets", "itemviews", "addressbook", "addressbook.pro"),
qt4Exmpl = os.path.join(sdkPath, "Examples", "4.7", basePath) Qt5Path.getPaths(Qt5Path.EXAMPLES))
qt5Exmpls = []
for p in Qt5Path.getPaths(Qt5Path.EXAMPLES):
qt5Exmpls.append(os.path.join(p, "widgets", basePath))
proFiles = [qt4Exmpl]
proFiles.extend(qt5Exmpls)
cleanUpUserFiles(proFiles) cleanUpUserFiles(proFiles)
for p in proFiles: for p in proFiles:
removePackagingDirectory(os.path.dirname(p)) removePackagingDirectory(os.path.dirname(p))