Commit 4fc9302c authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Move common code to shared file



Change-Id: I5e268d6faf9a2a5a779e850667c582328c42387d
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent 4c077878
......@@ -286,3 +286,19 @@ def getQtInformationByQMakeCall(qtDir, which):
test.fatal("You're trying to fetch an unknown information (%s)" % which)
return None
return getOutputFromCmdline("%s -query %s" % (qmake, query)).strip()
def invokeContextMenuOnProject(projectName, menuItem):
try:
projItem = waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", projectName, 3000)
except:
try:
projItem = waitForObjectItem(":Qt Creator_Utils::NavigationTreeView",
addBranchWildcardToRoot(projectName), 1000)
except:
test.fatal("Failed to find root node of the project '%s'." % projectName)
return
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
str(projItem.text).replace("_", "\\_").replace(".", "\\."), 5, 5, 0)
activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}", menuItem))
return projItem
......@@ -31,21 +31,7 @@ source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
def verifyChangeProject(projectName):
# select project
try:
projItem = waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", projectName, 3000)
except:
try:
projItem = waitForObjectItem(":Qt Creator_Utils::NavigationTreeView",
addBranchWildcardToRoot(projectName), 1000)
except:
test.fatal("Failed to find root node of the project '%s'." % projectName)
return
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
str(projItem.text).replace("_", "\\_").replace(".", "\\."), 5, 5, 0)
activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}",
'Set "%s" as Active Project' % projectName))
projItem = invokeContextMenuOnProject(projectName, 'Set "%s" as Active Project' % projectName)
waitFor("projItem.font.bold==True", 3000)
# check if bold is right project
test.verify(projItem.font.bold == True,
......
......@@ -127,10 +127,7 @@ def main():
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text='2dpainting' type='QModelIndex'}"),
"Verifying: The project is shown in 'Edit' mode.")
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
"2dpainting", 5, 5, 0)
activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Project_QMenu",
'Close Project "2dpainting"'))
invokeContextMenuOnProject('2dpainting', 'Close Project "2dpainting"')
navTree = waitForObject(":Qt Creator_Utils::NavigationTreeView")
res = waitFor("navTree.model().rowCount(navTree.rootIndex()) == 0", 2000)
test.verify(not checkIfObjectItemExists(":Qt Creator_Utils::NavigationTreeView", "2dpainting"),
......@@ -165,10 +162,7 @@ def main():
checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text='addressbook' type='QModelIndex'}"),
"Verifying: The project is shown in 'Edit' mode while old project isn't.")
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
"addressbook", 5, 5, 0)
activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Project_QMenu",
'Close Project "addressbook"'))
invokeContextMenuOnProject('addressbook', 'Close Project "addressbook"')
navTree = waitForObject(":Qt Creator_Utils::NavigationTreeView")
res = waitFor("navTree.model().rowCount(navTree.rootIndex()) == 0", 2000)
test.verify(not checkIfObjectItemExists(":Qt Creator_Utils::NavigationTreeView", "addressbook"),
......
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