forked from qt-creator/qt-creator
Squish: Move common code to shared file
Change-Id: I5e268d6faf9a2a5a779e850667c582328c42387d Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -286,3 +286,19 @@ def getQtInformationByQMakeCall(qtDir, which):
|
|||||||
test.fatal("You're trying to fetch an unknown information (%s)" % which)
|
test.fatal("You're trying to fetch an unknown information (%s)" % which)
|
||||||
return None
|
return None
|
||||||
return getOutputFromCmdline("%s -query %s" % (qmake, query)).strip()
|
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")
|
source("../../shared/suites_qtta.py")
|
||||||
|
|
||||||
def verifyChangeProject(projectName):
|
def verifyChangeProject(projectName):
|
||||||
# select project
|
projItem = invokeContextMenuOnProject(projectName, 'Set "%s" as Active Project' % projectName)
|
||||||
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))
|
|
||||||
waitFor("projItem.font.bold==True", 3000)
|
waitFor("projItem.font.bold==True", 3000)
|
||||||
# check if bold is right project
|
# check if bold is right project
|
||||||
test.verify(projItem.font.bold == True,
|
test.verify(projItem.font.bold == True,
|
||||||
|
@@ -127,10 +127,7 @@ def main():
|
|||||||
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
|
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
|
||||||
" text='2dpainting' type='QModelIndex'}"),
|
" text='2dpainting' type='QModelIndex'}"),
|
||||||
"Verifying: The project is shown in 'Edit' mode.")
|
"Verifying: The project is shown in 'Edit' mode.")
|
||||||
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
|
invokeContextMenuOnProject('2dpainting', 'Close Project "2dpainting"')
|
||||||
"2dpainting", 5, 5, 0)
|
|
||||||
activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Project_QMenu",
|
|
||||||
'Close Project "2dpainting"'))
|
|
||||||
navTree = waitForObject(":Qt Creator_Utils::NavigationTreeView")
|
navTree = waitForObject(":Qt Creator_Utils::NavigationTreeView")
|
||||||
res = waitFor("navTree.model().rowCount(navTree.rootIndex()) == 0", 2000)
|
res = waitFor("navTree.model().rowCount(navTree.rootIndex()) == 0", 2000)
|
||||||
test.verify(not checkIfObjectItemExists(":Qt Creator_Utils::NavigationTreeView", "2dpainting"),
|
test.verify(not checkIfObjectItemExists(":Qt Creator_Utils::NavigationTreeView", "2dpainting"),
|
||||||
@@ -165,10 +162,7 @@ def main():
|
|||||||
checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
|
checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
|
||||||
" text='addressbook' type='QModelIndex'}"),
|
" text='addressbook' type='QModelIndex'}"),
|
||||||
"Verifying: The project is shown in 'Edit' mode while old project isn't.")
|
"Verifying: The project is shown in 'Edit' mode while old project isn't.")
|
||||||
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
|
invokeContextMenuOnProject('addressbook', 'Close Project "addressbook"')
|
||||||
"addressbook", 5, 5, 0)
|
|
||||||
activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Project_QMenu",
|
|
||||||
'Close Project "addressbook"'))
|
|
||||||
navTree = waitForObject(":Qt Creator_Utils::NavigationTreeView")
|
navTree = waitForObject(":Qt Creator_Utils::NavigationTreeView")
|
||||||
res = waitFor("navTree.model().rowCount(navTree.rootIndex()) == 0", 2000)
|
res = waitFor("navTree.model().rowCount(navTree.rootIndex()) == 0", 2000)
|
||||||
test.verify(not checkIfObjectItemExists(":Qt Creator_Utils::NavigationTreeView", "addressbook"),
|
test.verify(not checkIfObjectItemExists(":Qt Creator_Utils::NavigationTreeView", "addressbook"),
|
||||||
|
Reference in New Issue
Block a user