Commit 49a5f8be authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Some smaller refactorings

Change-Id: I5f8b5ec982e8a38d32ba15d81317c2308dc00106
Reviewed-on: http://codereview.qt-project.org/5544

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarBill King <bill.king@nokia.com>
Reviewed-by: default avatarRobert Löhning <robert.loehning@nokia.com>
parent 692806bb
......@@ -65,12 +65,10 @@ def checkLastBuild(expectedToFail=False):
if warnings == "":
warnings = "none"
gotErrors = errors != "none" and errors != "0"
if (gotErrors and expectedToFail) or (not expectedToFail and not gotErrors):
test.passes("Errors: %s" % errors)
test.passes("Warnings: %s" % warnings)
if not (gotErrors ^ expectedToFail):
test.passes("Errors: %s | Warnings: %s" % (errors, warnings))
else:
test.fail("Errors: %s" % errors)
test.fail("Warnings: %s" % warnings)
test.fail("Errors: %s | Warnings: %s" % (errors, warnings))
# additional stuff - could be removed... or improved :)
toggleBuildIssues = waitForObject("{type='Core::Internal::OutputPaneToggleButton' unnamed='1' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 20000)
......
......@@ -56,3 +56,8 @@ def markText(editor, startPosition, endPosition):
cursor.setPosition(endPosition, QTextCursor.KeepAnchor)
editor.setTextCursor(cursor)
# works for all standard editors
def replaceEditorContent(editor, newcontent):
type(editor, "<Ctrl+A>")
type(editor, "<Delete>")
type(editor, newcontent)
......@@ -71,11 +71,6 @@ def which(program):
return None
def replaceLineEditorContent(lineEditor, newcontent):
type(lineEditor, "<Ctrl+A>")
type(lineEditor, "<Delete>")
type(lineEditor, newcontent)
signalObjects = {}
def __callbackFunction__(object, *args):
......
......@@ -29,7 +29,7 @@ def main():
# Now check some basic lookups in the search box
mouseClick(waitForObject(":*Qt Creator_Utils::FilterLineEdit", 20000), 5, 5, 0, Qt.LeftButton)
replaceLineEditorContent(waitForObject(":*Qt Creator_Utils::FilterLineEdit", 20000), ": Qlist::QList")
replaceEditorContent(waitForObject(":*Qt Creator_Utils::FilterLineEdit", 20000), ": Qlist::QList")
type(waitForObject(":*Qt Creator_Utils::FilterLineEdit", 20000), "<Return>")
test.compare(wordUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "QList")
......
......@@ -35,9 +35,9 @@ def createNewQtQuickApplication():
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
baseLineEd = waitForObject("{name='nameLineEdit' visible='1' "
"type='Utils::ProjectNameValidatingLineEdit'}", 20000)
replaceLineEditorContent(baseLineEd, "untitled")
replaceEditorContent(baseLineEd, "untitled")
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
replaceLineEditorContent(baseLineEd, workingDir)
replaceEditorContent(baseLineEd, workingDir)
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
test.verify(labelCheck, "Project name and base directory without warning or error")
......
......@@ -26,9 +26,9 @@ def createNewQtQuickApplication():
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
baseLineEd = waitForObject("{name='nameLineEdit' visible='1' "
"type='Utils::ProjectNameValidatingLineEdit'}", 20000)
replaceLineEditorContent(baseLineEd, "untitled")
replaceEditorContent(baseLineEd, "untitled")
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
replaceLineEditorContent(baseLineEd, workingDir)
replaceEditorContent(baseLineEd, workingDir)
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
test.verify(labelCheck, "Project name and base directory without warning or error")
......
......@@ -27,7 +27,7 @@ def createNewQtQuickApplication():
clickItem(waitForObject("{name='templatesView' type='QListView'}", 20000), "Qt Quick Application", 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
replaceLineEditorContent(baseLineEd, workingDir)
replaceEditorContent(baseLineEd, workingDir)
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
test.verify(labelCheck, "Project name and base directory without warning or error")
......
......@@ -38,7 +38,7 @@ def createNewQtQuickApplication():
clickItem(waitForObject("{name='templatesView' type='QListView'}", 20000), "Qt Quick Application", 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
replaceLineEditorContent(baseLineEd, workingDir)
replaceEditorContent(baseLineEd, workingDir)
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
test.verify(labelCheck, "Project name and base directory without warning or error")
......
......@@ -20,7 +20,7 @@ def createNewQtQuickUI():
clickItem(waitForObject("{name='templatesView' type='QListView'}", 20000), "Qt Quick UI", 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
replaceLineEditorContent(baseLineEd, workingDir)
replaceEditorContent(baseLineEd, workingDir)
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
test.verify(labelCheck, "Project name and base directory without warning or error")
......
......@@ -24,7 +24,7 @@ def createNewQmlExtension():
clickItem(waitForObject("{name='templatesView' type='QListView'}", 20000), "Custom QML Extension Plugin", 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
replaceLineEditorContent(baseLineEd, workingDir)
replaceEditorContent(baseLineEd, workingDir)
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
test.verify(labelCheck, "Project name and base directory without warning or error")
......@@ -40,10 +40,10 @@ def createNewQmlExtension():
# buddy = waitForObject("{type='QLabel' text='Object Class-name:' unnamed='1' visible='1'}", 20000)
nameLineEd = waitForObject("{buddy={type='QLabel' text='Object Class-name:' unnamed='1' visible='1'} "
"type='QLineEdit' unnamed='1' visible='1'}", 20000)
replaceLineEditorContent(nameLineEd, "TestItem")
replaceEditorContent(nameLineEd, "TestItem")
uriLineEd = waitForObject("{buddy={type='QLabel' text='URI:' unnamed='1' visible='1'} "
"type='QLineEdit' unnamed='1' visible='1'}", 20000)
replaceLineEditorContent(uriLineEd, "com.nokia.test.qmlcomponents")
replaceEditorContent(uriLineEd, "com.nokia.test.qmlcomponents")
clickButton(nextButton)
clickButton(waitForObject("{type='QPushButton' text='Finish' visible='1'}", 20000))
......
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