Commit ac6ca18e authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Fix tst_create_proj_wizard

Change-Id: Ibccb5b6c1496d5ae4c9021086d55dc4236f6ac71
Reviewed-by: default avatarRobert Loehning <>
parent 347d0e4e
......@@ -423,6 +423,8 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
if 'MeeGo/Harmattan' in supports:
addSimulator = True
if 'Maemo/Fremantle' in supports:
addSimulator = True
if len(result) == 0 or addSimulator:
......@@ -286,23 +286,40 @@ def __checkParentAccess__(filePath):
# options dialog and returns a dict holding the targets as keys
# and a list of supported versions as value
def getCorrectlyConfiguredTargets():
def __retrieveQtVersionName__(target, version):
treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget")
return treeWidget.currentItem().text(0)
targetQtVersionNames = {}
result = {}
for tv in iterateQtVersions():
for target,version in tv.iteritems():
# Dialog sometimes differs from targets' names
if target == "Maemo":
target = "Maemo5"
implicitTargets = [target]
if target == "Desktop" and platform.system() in ("Linux", "Darwin"):
implicitTargets.append("Embedded Linux")
for currentTarget in implicitTargets:
if currentTarget in result:
oldV = result[currentTarget]
if version not in oldV:
targetsQtVersions, qtVersionNames = iterateQtVersions(True, __retrieveQtVersionName__)
clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Targets")
treeView = waitForObject(":Targets_QTreeView")
model = treeView.model(), 2, "Verifying expected target section count")
autoDetected = model.index(0, 0), "Auto-detected",
"Verifying label for target section")
manual = model.index(1, 0), "Manual", "Verifying label for target section")
for section in [autoDetected, manual]:
for index in [section.child(i, 0) for i in range(model.rowCount(section))]:
targetName = str(
if (targetName.endswith(" (default)")):
targetName = targetName.rstrip(" (default)")
item = ".".join([str(,
str(".", "\\.")])
clickItem(treeView, item, 5, 5, 0, Qt.LeftButton)
qtVersionStr = str(waitForObject(":Targets_QtVersion_QComboBox").currentText)
targetQtVersionNames[targetName] = qtVersionStr
# merge defined target names with their configured Qt versions and devices
for target,qtVersion in targetQtVersionNames.iteritems():
result[target] = targetsQtVersions[qtVersionNames.index(qtVersion)].items()[0]
# adjust device name(s) to match getStringForTarget() - some differ from time to time
for targetName in result.keys():
targetInfo = result[targetName]
if targetInfo[0] == "Maemo":
result.update({targetName:("Maemo5", targetInfo[1])})
test.log("Correctly configured targets: %s" % str(result))
return result
......@@ -70,23 +70,24 @@ def main():
except LookupError:
waitForObject("{type='QLabel' unnamed='1' visible='1' text='Target Setup'}")
availableCheckboxes = filter(visibleCheckBoxExists, QtQuickConstants.getAllTargetStrings())
availableCheckboxes = filter(visibleCheckBoxExists, targets.keys())
JIRA.performWorkaroundIfStillOpen(6994, JIRA.Bug.CREATOR, template, displayedPlatforms)
# verification whether expected, found and configured match
for t in targets:
if requiredVersion:
if max(targets[t]) < requiredVersion:
if targets[t][1] < requiredVersion:
if t in availableCheckboxes:"Target '%s' found as checkbox, but required version (%s) is higher "
"than configured version(s) (%s)!" % (t, requiredVersion, str(targets[t])))
"than configured version (%s)!" % (t, requiredVersion,
test.passes("Irrelevant target '%s' not found on 'Target setup' page - "
"required version is '%s', current version(s) are '%s'." %
(t, requiredVersion, str(targets[t])))
"required version is '%s', current version is '%s'." %
(t, requiredVersion, str(targets[t][1])))
found = False
if t in displayedPlatforms:
if targets[t][0] in displayedPlatforms:
if t in availableCheckboxes:
test.passes("Found expected target '%s' on 'Target setup' page." % t)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment