Commit 42236fc7 authored by Christian Stenger's avatar Christian Stenger

Squish: Fix some tests due to latest refactorings in QC

Refactoring of dialog wizards and editors.

Change-Id: I6604a302b04579519c78698375bc4b1027ac8b02
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent 8fe9df26
...@@ -108,9 +108,9 @@ ...@@ -108,9 +108,9 @@
:JavaScript.QmlProfilerEventsTable_QmlProfiler::Internal::QV8ProfilerEventsMainView {container=':*Qt Creator.JavaScript_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QV8ProfilerEventsMainView' visible='1'} :JavaScript.QmlProfilerEventsTable_QmlProfiler::Internal::QV8ProfilerEventsMainView {container=':*Qt Creator.JavaScript_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QV8ProfilerEventsMainView' visible='1'}
:Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='5' type='QComboBox' unnamed='1' visible='1'} :Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='5' type='QComboBox' unnamed='1' visible='1'}
:Locals and Expressions_Debugger::Internal::WatchTreeView {container=':DebugModeWidget.Locals and Expressions_QDockWidget' name='WatchWindow' type='Debugger::Internal::WatchTreeView' visible='1' windowTitle='Locals and Expressions'} :Locals and Expressions_Debugger::Internal::WatchTreeView {container=':DebugModeWidget.Locals and Expressions_QDockWidget' name='WatchWindow' type='Debugger::Internal::WatchTreeView' visible='1' windowTitle='Locals and Expressions'}
:New Text File.Add to project:_QLabel {name='projectLabel' text='Add to project:' type='QLabel' visible='1' window=':New Text File_Core::BaseFileWizard'} :New Text File.Add to project:_QLabel {name='projectLabel' text='Add to project:' type='QLabel' visible='1' window=':New Text File_ProjectExplorer::JsonWizard'}
:New Text File.nameLineEdit_Utils::FileNameValidatingLineEdit {name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1' window=':New Text File_Core::BaseFileWizard'} :New Text File.nameLineEdit_Utils::FileNameValidatingLineEdit {name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1' window=':New Text File_ProjectExplorer::JsonWizard'}
:New Text File_Core::BaseFileWizard {type='Core::BaseFileWizard' unnamed='1' visible='1' windowTitle='New Text File'} :New Text File_ProjectExplorer::JsonWizard {type='ProjectExplorer::JsonWizard' unnamed='1' visible='1'}
:New.comboBox_QComboBox {name='comboBox' type='QComboBox' visible='1' window=':New_Core::Internal::NewDialog'} :New.comboBox_QComboBox {name='comboBox' type='QComboBox' visible='1' window=':New_Core::Internal::NewDialog'}
:New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'} :New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'}
:New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'} :New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'}
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
:Qt Creator_QmlJSEditor::QmlJSTextEditorWidget {type='QmlJSEditor::Internal::QmlJSEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QmlJSEditor::QmlJSTextEditorWidget {type='QmlJSEditor::Internal::QmlJSEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_SystemSettings.Details_Utils::DetailsButton {occurrence='4' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_SystemSettings.Details_Utils::DetailsButton {occurrence='4' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_TextEditor::BaseTextEditorWidget {type='TextEditor::BaseTextEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_TextEditor::TextEditorWidget {type='TextEditor::TextEditorWidget' 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 Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit {container=':Qt Creator_Utils::NavigationTreeView' type='QExpandingLineEdit' unnamed='1' visible='1'} :Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit {container=':Qt Creator_Utils::NavigationTreeView' type='QExpandingLineEdit' unnamed='1' visible='1'}
:Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_QmakeProjectManager::Internal::GuiAppWizardDialog'}
......
...@@ -276,11 +276,11 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False): ...@@ -276,11 +276,11 @@ def getEditorForFileSuffix(curFile, treeViewSyntax=False):
elif suffix in qmlEditorSuffixes: elif suffix in qmlEditorSuffixes:
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
elif suffix in proEditorSuffixes or suffix in glslEditorSuffixes or suffix in pytEditorSuffixes: elif suffix in proEditorSuffixes or suffix in glslEditorSuffixes or suffix in pytEditorSuffixes:
editor = waitForObject(":Qt Creator_TextEditor::BaseTextEditorWidget") editor = waitForObject(":Qt Creator_TextEditor::TextEditorWidget")
else: else:
test.log("Trying BaseTextEditorWidget (file suffix: %s)" % suffix) test.log("Trying TextEditorWidget (file suffix: %s)" % suffix)
try: try:
editor = waitForObject(":Qt Creator_TextEditor::BaseTextEditorWidget", 3000) editor = waitForObject(":Qt Creator_TextEditor::TextEditorWidget", 3000)
except: except:
test.fatal("Unsupported file suffix for file '%s'" % curFile) test.fatal("Unsupported file suffix for file '%s'" % curFile)
editor = None editor = None
......
...@@ -722,7 +722,7 @@ def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False, addTo ...@@ -722,7 +722,7 @@ def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False, addTo
test.fatal("File must have a name - got None.") test.fatal("File must have a name - got None.")
return return
__createProjectOrFileSelectType__(" C++", template, isProject=False) __createProjectOrFileSelectType__(" C++", template, isProject=False)
window = "{type='Core::BaseFileWizard' unnamed='1' visible='1'}" window = "{type='ProjectExplorer::JsonWizard' unnamed='1' visible='1'}"
basePath = str(waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' " basePath = str(waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' "
"window=%s}" % window).text) "window=%s}" % window).text)
lineEdit = waitForObject("{name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' " lineEdit = waitForObject("{name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' "
......
...@@ -55,7 +55,7 @@ def main(): ...@@ -55,7 +55,7 @@ def main():
# Rely on code completion for closing bracket # Rely on code completion for closing bracket
invokeMenuItem("File", "Save All") invokeMenuItem("File", "Save All")
openDocument(project + "." + project + "\\.pro") openDocument(project + "." + project + "\\.pro")
proEditor = waitForObject(":Qt Creator_TextEditor::BaseTextEditorWidget") proEditor = waitForObject(":Qt Creator_TextEditor::TextEditorWidget")
test.verify("CONFIG += console" in str(proEditor.plainText), "Verifying that program is configured with console") test.verify("CONFIG += console" in str(proEditor.plainText), "Verifying that program is configured with console")
availableConfigs = iterateBuildConfigs(len(checkedTargets)) availableConfigs = iterateBuildConfigs(len(checkedTargets))
......
...@@ -34,7 +34,8 @@ def createFile(folder, filename): ...@@ -34,7 +34,8 @@ def createFile(folder, filename):
replaceEditorContent(waitForObject("{name='nameLineEdit' visible='1' " replaceEditorContent(waitForObject("{name='nameLineEdit' visible='1' "
"type='Utils::FileNameValidatingLineEdit'}"), filename) "type='Utils::FileNameValidatingLineEdit'}"), filename)
replaceEditorContent(waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' " replaceEditorContent(waitForObject("{type='Utils::FancyLineEdit' unnamed='1' visible='1' "
"window=':New Text File_Core::BaseFileWizard'}"), folder) "window={type='ProjectExplorer::JsonWizard' unnamed='1' "
"visible='1'}}"), folder)
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
__createProjectHandleLastPage__() __createProjectHandleLastPage__()
...@@ -172,6 +173,9 @@ def main(): ...@@ -172,6 +173,9 @@ def main():
for current in filesToTest: for current in filesToTest:
createFile(folder, current) createFile(folder, current)
editor = getEditorForFileSuffix(current) editor = getEditorForFileSuffix(current)
if editor == None:
earlyExit("Something's really wrong! (did the UI change?)")
return
expectHint = hasSuffix(current, patterns) expectHint = hasSuffix(current, patterns)
mssg = "Verifying whether hint for missing highlight definition is present. (expected: %s)" mssg = "Verifying whether hint for missing highlight definition is present. (expected: %s)"
try: try:
......
...@@ -32,7 +32,7 @@ source("../../shared/qtcreator.py") ...@@ -32,7 +32,7 @@ source("../../shared/qtcreator.py")
def main(): def main():
global testFolder global testFolder
cppEditorStr = ":Qt Creator_CppEditor::Internal::CPPEditorWidget" cppEditorStr = ":Qt Creator_CppEditor::Internal::CPPEditorWidget"
proEditorStr = ":Qt Creator_TextEditor::BaseTextEditorWidget" proEditorStr = ":Qt Creator_TextEditor::TextEditorWidget"
testFolder = prepareTemplate(os.path.abspath(os.path.join(os.getcwd(), "..", "shared", testFolder = prepareTemplate(os.path.abspath(os.path.join(os.getcwd(), "..", "shared",
"simplePlainCPP"))) "simplePlainCPP")))
if testFolder == None: if testFolder == None:
......
...@@ -76,7 +76,7 @@ def __modifyFile__(fileName, modificationFunc): ...@@ -76,7 +76,7 @@ def __modifyFile__(fileName, modificationFunc):
# add some stuff to pro file # add some stuff to pro file
def __modifyProFile__(): def __modifyProFile__():
proEditorStr = ":Qt Creator_TextEditor::BaseTextEditorWidget" proEditorStr = ":Qt Creator_TextEditor::TextEditorWidget"
addConfig = ["", "CONFIG += thread", "", addConfig = ["", "CONFIG += thread", "",
"lessThan(QT_VER_MAJ, 4) | lessThan(QT_VER_MIN, 7) {", "lessThan(QT_VER_MAJ, 4) | lessThan(QT_VER_MIN, 7) {",
" error(Qt 4.7 or newer is required but version $$[QT_VERSION] was detected.)", " error(Qt 4.7 or newer is required but version $$[QT_VERSION] was detected.)",
......
...@@ -152,7 +152,7 @@ def main(): ...@@ -152,7 +152,7 @@ def main():
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
readmeName += ".txt" readmeName += ".txt"
__createProjectHandleLastPage__([readmeName], "Git", "<None>") __createProjectHandleLastPage__([readmeName], "Git", "<None>")
replaceEditorContent(waitForObject(":Qt Creator_TextEditor::BaseTextEditorWidget"), replaceEditorContent(waitForObject(":Qt Creator_TextEditor::TextEditorWidget"),
"Some important advice in the README") "Some important advice in the README")
invokeMenuItem("File", "Save All") invokeMenuItem("File", "Save All")
commitsInProject = list(commitMessages) # deep copy commitsInProject = list(commitMessages) # deep copy
......
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