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 <robert.loehning@nokia.com>
parent 347d0e4e
...@@ -423,6 +423,8 @@ def __getSupportedPlatforms__(text, getAsStrings=False): ...@@ -423,6 +423,8 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
result.append(QtQuickConstants.Targets.EMBEDDED_LINUX) result.append(QtQuickConstants.Targets.EMBEDDED_LINUX)
if 'MeeGo/Harmattan' in supports: if 'MeeGo/Harmattan' in supports:
result.append(QtQuickConstants.Targets.HARMATTAN) result.append(QtQuickConstants.Targets.HARMATTAN)
addSimulator = True
if 'Maemo/Fremantle' in supports:
result.append(QtQuickConstants.Targets.MAEMO5) result.append(QtQuickConstants.Targets.MAEMO5)
addSimulator = True addSimulator = True
if len(result) == 0 or addSimulator: if len(result) == 0 or addSimulator:
......
...@@ -286,23 +286,40 @@ def __checkParentAccess__(filePath): ...@@ -286,23 +286,40 @@ def __checkParentAccess__(filePath):
# options dialog and returns a dict holding the targets as keys # options dialog and returns a dict holding the targets as keys
# and a list of supported versions as value # and a list of supported versions as value
def getCorrectlyConfiguredTargets(): def getCorrectlyConfiguredTargets():
def __retrieveQtVersionName__(target, version):
treeWidget = waitForObject(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget")
return treeWidget.currentItem().text(0)
targetQtVersionNames = {}
result = {} result = {}
for tv in iterateQtVersions(): targetsQtVersions, qtVersionNames = iterateQtVersions(True, __retrieveQtVersionName__)
for target,version in tv.iteritems(): clickTab(waitForObject(":Options.qt_tabwidget_tabbar_QTabBar"), "Targets")
# Dialog sometimes differs from targets' names treeView = waitForObject(":Targets_QTreeView")
if target == "Maemo": model = treeView.model()
target = "Maemo5" test.compare(model.rowCount(), 2, "Verifying expected target section count")
implicitTargets = [target] autoDetected = model.index(0, 0)
if target == "Desktop" and platform.system() in ("Linux", "Darwin"): test.compare(autoDetected.data().toString(), "Auto-detected",
implicitTargets.append("Embedded Linux") "Verifying label for target section")
for currentTarget in implicitTargets: manual = model.index(1, 0)
if currentTarget in result: test.compare(manual.data().toString(), "Manual", "Verifying label for target section")
oldV = result[currentTarget] for section in [autoDetected, manual]:
if version not in oldV: for index in [section.child(i, 0) for i in range(model.rowCount(section))]:
oldV.append(version) targetName = str(index.data().toString())
result.update({currentTarget:oldV}) if (targetName.endswith(" (default)")):
else: targetName = targetName.rstrip(" (default)")
result.update({currentTarget:[version]}) item = ".".join([str(section.data().toString()),
str(index.data().toString()).replace(".", "\\.")])
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]
clickButton(waitForObject(":Options.Cancel_QPushButton"))
# 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)) test.log("Correctly configured targets: %s" % str(result))
return result return result
......
...@@ -70,23 +70,24 @@ def main(): ...@@ -70,23 +70,24 @@ def main():
except LookupError: except LookupError:
pass pass
waitForObject("{type='QLabel' unnamed='1' visible='1' text='Target Setup'}") 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) JIRA.performWorkaroundIfStillOpen(6994, JIRA.Bug.CREATOR, template, displayedPlatforms)
# verification whether expected, found and configured match # verification whether expected, found and configured match
for t in targets: for t in targets:
if requiredVersion: if requiredVersion:
if max(targets[t]) < requiredVersion: if targets[t][1] < requiredVersion:
if t in availableCheckboxes: if t in availableCheckboxes:
test.fail("Target '%s' found as checkbox, but required version (%s) is higher " test.fail("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,
str(targets[t][1])))
availableCheckboxes.remove(t) availableCheckboxes.remove(t)
else: else:
test.passes("Irrelevant target '%s' not found on 'Target setup' page - " test.passes("Irrelevant target '%s' not found on 'Target setup' page - "
"required version is '%s', current version(s) are '%s'." % "required version is '%s', current version is '%s'." %
(t, requiredVersion, str(targets[t]))) (t, requiredVersion, str(targets[t][1])))
continue continue
found = False found = False
if t in displayedPlatforms: if targets[t][0] in displayedPlatforms:
if t in availableCheckboxes: if t in availableCheckboxes:
test.passes("Found expected target '%s' on 'Target setup' page." % t) test.passes("Found expected target '%s' on 'Target setup' page." % t)
availableCheckboxes.remove(t) availableCheckboxes.remove(t)
......
Markdown is supported
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