Commit 8a857ecc authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Updated existing tests to run on Mac

Change-Id: Id4c3bd97f806e502fe64ca9bd4864938d918dc73
Reviewed-on: http://codereview.qt-project.org/6156

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarRobert Löhning <robert.loehning@nokia.com>
parent dc5e5765
......@@ -7,9 +7,9 @@
:*Qt Creator_Utils::IconButton {occurrence='4' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Build:_QComboBox {aboveWidget=':Desktop_QLabel' container=':QtCreator.MenuBar_ProjectExplorer::Internal::ProjectListWidget' leftWidget=':Build:_QLabel' type='QComboBox'}
:Build:_QLabel {container=':QtCreator.MenuBar_ProjectExplorer::Internal::ProjectListWidget' name='buildLabel' text='Build:' type='QLabel' visible='1'}
:CMake Wizard.Finish_QPushButton {text='Finish' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Generator:_QLabel {text='Generator:' type='QLabel' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Next_QPushButton {name='__qt__passive_wizardbutton1' text?='Next*' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Next_QPushButton {name='__qt__passive_wizardbutton1' text~='(Next.*|Continue)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Run CMake_QPushButton {text='Run CMake' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard {type='CMakeProjectManager::Internal::CMakeOpenProjectWizard' unnamed='1' visible='1' windowTitle='CMake Wizard'}
:Desktop_QLabel {container=':QtCreator.MenuBar_ProjectExplorer::Internal::ProjectListWidget' name='target' text='Desktop' type='QLabel' visible='1'}
......@@ -28,10 +28,10 @@
:Qt Creator_QToolButton {occurrence='13' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::IconButton {occurrence='2' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Gui Application.Finish_QPushButton {text='Finish' type='QPushButton' unnamed='1' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' unnamed='1' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Next_QPushButton {name='__qt__passive_wizardbutton1' text?='Next*' type='QPushButton' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Next_QPushButton {name='__qt__passive_wizardbutton1' text~='(Next.*|Continue)' type='QPushButton' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.frame_QFrame {name='frame' type='QFrame' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
......
......@@ -12,6 +12,7 @@ def placeCursorToLine(editor,line,isRegex=False):
found = False
if isRegex:
regex = re.compile(line)
editorRealName = objectMap.realName(editor)
while not found:
currentLine = str(lineUnderCursor(editor)).strip()
if isRegex:
......@@ -26,7 +27,7 @@ def placeCursorToLine(editor,line,isRegex=False):
if currentLine==line:
found = True
else:
type(editor, "<Down>")
type(editorRealName, "<Down>")
if oldPosition==editor.textCursor().position():
break
oldPosition = editor.textCursor().position()
......
......@@ -2,22 +2,42 @@
def invokeMenuItem(menu, item):
menuObject = waitForObjectItem("{type='QMenuBar' visible='true'}", menu)
activateItem(menuObject)
activateItem(waitForObjectItem(menuObject, item))
activateItem(waitForObjectItem(objectMap.realName(menuObject), item))
def openQmakeProject(projectPath):
invokeMenuItem("File", "Open File or Project...")
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
clickButton(findObject("{text='Open' type='QPushButton'}"))
if platform.system()=="Darwin":
snooze(1)
nativeType("<Command+Shift+g>")
snooze(1)
nativeType(projectPath)
snooze(1)
nativeType("<Return>")
snooze(2)
nativeType("<Return>")
else:
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
clickButton(findObject("{text='Open' type='QPushButton'}"))
waitForObject("{type='Qt4ProjectManager::Internal::ProjectLoadWizard' visible='1' windowTitle='Project Setup'}")
selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox", "For Each Qt Version One Debug And One Release")
clickButton(findObject("{text='Finish' type='QPushButton'}"))
clickButton(findObject("{text~='(Finish|Done)' type='QPushButton'}"))
def openCmakeProject(projectPath):
invokeMenuItem("File", "Open File or Project...")
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
clickButton(findObject("{text='Open' type='QPushButton'}"))
if platform.system()=="Darwin":
snooze(1)
nativeType("<Command+Shift+g>")
snooze(1)
nativeType(projectPath)
snooze(1)
nativeType("<Return>")
snooze(2)
nativeType("<Return>")
else:
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
clickButton(findObject("{text='Open' type='QPushButton'}"))
clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000))
generatorCombo = waitForObject(":Generator:_QComboBox")
index = generatorCombo.findText("MinGW Generator (MinGW from SDK)")
......
......@@ -120,5 +120,8 @@ def runAndCloseQtQuickUI():
if (waitForObject(":Qt Creator_Core::Internal::OutputPaneToggleButton").checked!=True):
clickButton(":Qt Creator_Core::Internal::OutputPaneToggleButton")
clickButton(":Qt Creator.Stop_QToolButton")
if platform.system()=="Darwin":
snooze(2)
nativeType("<Escape>")
return True
......@@ -74,6 +74,7 @@ def which(program):
signalObjects = {}
# do not call this function directly - it's only a helper
def __callbackFunction__(object, *args):
global signalObjects
# test.log("__callbackFunction__: "+objectMap.realName(object))
......
......@@ -34,7 +34,7 @@ def main():
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), " xi")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
type(cppwindow, "<F2>")
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "extern int xi;")
test.compare(lineUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "extern int xi;")
# - Move the cursor to a function call.
# - Press F2 or select from the menu: Tools / C++ / Follow Symbol under Cursor
......@@ -44,7 +44,7 @@ def main():
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "freefunc2")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
type(cppwindow, "<F2>")
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "int freefunc2(double)")
test.compare(lineUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "int freefunc2(double)")
# - Move the cursor to a function declaration
# - Press Shift+F2 or select from menu: Tools / C++ / Switch Between Method Declaration/Definition
......@@ -68,9 +68,10 @@ def main():
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "Dummy::Dummy")
# Take us to the second instance
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
type(cppwindow, "<Shift+F2>")
cppWindowRealName = objectMap.realName(cppwindow)
type(cppWindowRealName, "<Shift+F2>")
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), " Dummy(int a);")
type(cppwindow, "<Shift+F2>")
type(cppWindowRealName, "<Shift+F2>")
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "Dummy::Dummy(int)")
invokeMenuItem("File", "Exit")
......
......@@ -8,11 +8,11 @@ def main():
startApplication("qtcreator" + SettingsPath)
openQmakeProject(pathCreator)
openQmakeProject(pathSpeedcrunch)
# Wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
openQmakeProject(pathCreator)
# Wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
# Test that some of the expected items are in the navigation tree
......
......@@ -46,7 +46,7 @@ def createNewQtQuickApplication():
if cbDefaultLocation.checked:
clickButton(cbDefaultLocation)
# now there's the 'untitled' project inside a temporary directory - step forward...!
nextButton = waitForObject("{text?='Next*' type='QPushButton' visible='1'}", 20000)
nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)
clickButton(nextButton)
chooseComponents(QtQuickConstants.Components.EXISTING_QML)
# define the existing qml file to import
......@@ -56,7 +56,7 @@ def createNewQtQuickApplication():
chooseDestination()
snooze(1)
clickButton(nextButton)
clickButton(waitForObject("{type='QPushButton' text='Finish' visible='1'}", 20000))
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def testRenameId():
test.log("Testing rename of id")
......@@ -78,7 +78,8 @@ def testRenameId():
return False
type(editor, "<Down>")
openContextMenuOnTextCursorPosition(editor)
activateItem(waitForObjectItem("{type='QMenu' visible='1' unnamed='1'}", "Rename Symbol Under Cursor"))
ctxtMenu = waitForObject("{type='QMenu' visible='1' unnamed='1'}")
activateItem(waitForObjectItem(objectMap.realName(ctxtMenu), "Rename Symbol Under Cursor"))
type(waitForObject("{leftWidget={text='Replace with:' type='QLabel' unnamed='1' visible='1'} "
"type='Find::Internal::WideEnoughLineEdit' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}"), "renamedView")
......@@ -91,7 +92,7 @@ def testRenameId():
modifiedText = "%s" % editor.plainText
originalText = originalTexts.get(file).replace("mainView", "renamedView")
test.compare(originalText,modifiedText)
type(editor, "<Ctrl+S>")
invokeMenuItem("File","Save All")
def doubleClickFile(navTree, file):
treeElement = ("untitled.QML.%s/qml.%s" %
......
......@@ -37,14 +37,14 @@ def createNewQtQuickApplication():
if cbDefaultLocation.checked:
clickButton(cbDefaultLocation)
# now there's the 'untitled' project inside a temporary directory - step forward...!
nextButton = waitForObject("{text?='Next*' type='QPushButton' visible='1'}", 20000)
nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)
clickButton(nextButton)
chooseComponents()
clickButton(nextButton)
chooseDestination(QtQuickConstants.Destinations.DESKTOP)
snooze(1)
clickButton(nextButton)
clickButton(waitForObject("{type='QPushButton' text='Finish' visible='1'}", 20000))
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def prepareQmlFile():
# make sure the QML file is opened
......
......@@ -36,14 +36,14 @@ def createNewQtQuickApplication():
if cbDefaultLocation.checked:
clickButton(cbDefaultLocation)
# now there's the 'untitled' project inside a temporary directory - step forward...!
nextButton = waitForObject("{text?='Next*' type='QPushButton' visible='1'}", 20000)
nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)
clickButton(nextButton)
chooseComponents()
clickButton(nextButton)
chooseDestination(QtQuickConstants.Destinations.DESKTOP)
snooze(1)
clickButton(nextButton)
clickButton(waitForObject("{type='QPushButton' text='Finish' visible='1'}", 20000))
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def cleanup():
global workingDir
......
......@@ -47,7 +47,7 @@ def createNewQtQuickApplication():
if cbDefaultLocation.checked:
clickButton(cbDefaultLocation)
# now there's the 'untitled' project inside a temporary directory - step forward...!
nextButton = waitForObject("{text?='Next*' type='QPushButton' visible='1'}", 20000)
nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)
clickButton(nextButton)
chooseComponents(QtQuickConstants.Components.EXISTING_QML)
# define the existing qml file to import
......@@ -57,7 +57,7 @@ def createNewQtQuickApplication():
chooseDestination()
snooze(1)
clickButton(nextButton)
clickButton(waitForObject("{type='QPushButton' text='Finish' visible='1'}", 20000))
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def cleanup():
global workingDir,templateDir
......
......@@ -29,8 +29,8 @@ def createNewQtQuickUI():
if cbDefaultLocation.checked:
clickButton(cbDefaultLocation)
# now there's the 'untitled' project inside a temporary directory - step forward...!
clickButton(waitForObject("{text?='Next*' type='QPushButton' visible='1'}", 20000))
clickButton(waitForObject("{type='QPushButton' text='Finish' visible='1'}", 20000))
clickButton(waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000))
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def cleanup():
global workingDir
......
......@@ -33,7 +33,7 @@ def createNewQmlExtension():
if cbDefaultLocation.checked:
clickButton(cbDefaultLocation)
# now there's the 'untitled' project inside a temporary directory - step forward...!
nextButton = waitForObject("{text?='Next*' type='QPushButton' visible='1'}", 20000)
nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)
clickButton(nextButton)
chooseDestination()
clickButton(nextButton)
......@@ -45,7 +45,7 @@ def createNewQmlExtension():
"type='QLineEdit' unnamed='1' visible='1'}", 20000)
replaceEditorContent(uriLineEd, "com.nokia.test.qmlcomponents")
clickButton(nextButton)
clickButton(waitForObject("{type='QPushButton' text='Finish' visible='1'}", 20000))
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def cleanup():
global workingDir
......
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