forked from qt-creator/qt-creator
Squish: Fix switchToBuildOrRunSettingsFor()
Properties of the model indices did change recently and so checking for enabled does no more work - use its toolTip content instead to check for the enabled state. Change-Id: Idc2b5ed1a0a14cfabdbdb4231eab243d28c0aee7 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
committed by
Robert Loehning
parent
ccc5359c42
commit
3ffec118d0
@@ -83,6 +83,7 @@ def prepareBuildSettings(targetCount, currentTarget, setReleaseBuild=True, disab
|
|||||||
# param targetCount specifies the number of targets currently defined (must be correct!)
|
# param targetCount specifies the number of targets currently defined (must be correct!)
|
||||||
# param projectSettings specifies where to switch to (must be one of ProjectSettings.BUILD or ProjectSettings.RUN)
|
# param projectSettings specifies where to switch to (must be one of ProjectSettings.BUILD or ProjectSettings.RUN)
|
||||||
def switchToBuildOrRunSettingsFor(targetCount, currentTarget, projectSettings):
|
def switchToBuildOrRunSettingsFor(targetCount, currentTarget, projectSettings):
|
||||||
|
clickToActivate = "<h3>Click to activate:</h3>"
|
||||||
try:
|
try:
|
||||||
treeView = waitForObject(":Projects.ProjectNavigationTreeView")
|
treeView = waitForObject(":Projects.ProjectNavigationTreeView")
|
||||||
except LookupError:
|
except LookupError:
|
||||||
@@ -90,13 +91,14 @@ def switchToBuildOrRunSettingsFor(targetCount, currentTarget, projectSettings):
|
|||||||
bAndRIndex = getQModelIndexStr("text='Build & Run'", ":Projects.ProjectNavigationTreeView")
|
bAndRIndex = getQModelIndexStr("text='Build & Run'", ":Projects.ProjectNavigationTreeView")
|
||||||
|
|
||||||
targetIndices = dumpIndices(treeView.model(), waitForObject(bAndRIndex))
|
targetIndices = dumpIndices(treeView.model(), waitForObject(bAndRIndex))
|
||||||
targets = map(lambda t: str(t.data(0)), filter(lambda x: x.enabled, targetIndices))
|
targets = map(lambda t: str(t.data(0)),
|
||||||
|
filter(lambda x: not str(x.toolTip).startswith(clickToActivate), targetIndices))
|
||||||
if not test.compare(targetCount, len(targets), "Check whether all chosen targets are listed."):
|
if not test.compare(targetCount, len(targets), "Check whether all chosen targets are listed."):
|
||||||
return False
|
return False
|
||||||
# we assume the targets are still ordered the same way
|
# we assume the targets are still ordered the same way
|
||||||
currentTargetIndex = getQModelIndexStr("text='%s'" % targets[currentTarget], bAndRIndex)
|
currentTargetIndex = getQModelIndexStr("text='%s'" % targets[currentTarget], bAndRIndex)
|
||||||
if not test.verify(findObject(currentTargetIndex).enabled, "Verifying target '%s' is enabled."
|
if not test.verify(not str(findObject(currentTargetIndex).toolTip).startswith(clickToActivate),
|
||||||
% targets[currentTarget]):
|
"Verifying target '%s' is enabled." % targets[currentTarget]):
|
||||||
return False
|
return False
|
||||||
mouseClick(waitForObject(currentTargetIndex))
|
mouseClick(waitForObject(currentTargetIndex))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user