Files
qt-creator/tests/system/suite_QMLS/tst_QMLS02/test.py
Christian Stenger 4cb9f675aa Squish: use new approach for markText()
This new approach is a bit slower than using Qt functionality,
but it's now completely relying on user-interaction.

Change-Id: I361f6f201dfff8122a11aae30204eb79967fe4ae
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
2013-01-28 17:07:12 +01:00

35 lines
1.3 KiB
Python

source("../shared/qmls.py")
def main():
editorArea = startQtCreatorWithNewAppAtQMLEditor(tempDir(), "SampleApp", "Text {")
if not editorArea:
return
# write code with error (C should be lower case)
testingCodeLine = 'Color : "blue"'
type(editorArea, "<Return>")
type(editorArea, testingCodeLine)
# invoke QML parsing
invokeMenuItem("Tools", "QML/JS", "Run Checks")
# verify that error properly reported
issuesView = waitForObject(":Qt Creator.Issues_QListView")
test.verify(checkSyntaxError(issuesView, ["invalid property name 'Color'"], True),
"Verifying if error is properly reported")
# repair error - go to written line
placeCursorToLine(editorArea, testingCodeLine)
for i in range(14):
type(editorArea, "<Left>")
markText(editorArea, "Right")
type(editorArea, "c")
# invoke QML parsing
invokeMenuItem("Tools", "QML/JS", "Run Checks")
# verify that there is no error/errors cleared
issuesView = waitForObject(":Qt Creator.Issues_QListView")
issuesModel = issuesView.model()
# wait for issues
test.verify(waitFor("issuesModel.rowCount() == 0", 3000),
"Verifying if error was properly cleared after code fix")
#save and exit
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")