diff options
author | Robert Loehning <robert.loehning@qt.io> | 2019-04-24 20:19:52 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@qt.io> | 2019-05-08 13:14:02 +0000 |
commit | 97ae2d1ac0a58190131dd2469e28d1fe1adc3250 (patch) | |
tree | 84ddb0443815fbf97b063cd980261befc476dc8c | |
parent | b1b52ac6746f5e7d935ecb106e48a87b656447c0 (diff) |
Squish: Fix and update tst_qtquick_creation3
Task-number: QTCREATORBUG-20056
Change-Id: I8b0980e423c2bf8921f615d04769d91c7e660dd3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r-- | tests/system/shared/project.py | 21 | ||||
-rw-r--r-- | tests/system/suite_qtquick/tst_qtquick_creation3/test.py | 34 |
2 files changed, 36 insertions, 19 deletions
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 00271bd77e..8a0d69b222 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -463,30 +463,29 @@ def __createProjectHandleClassInformation__(className, baseClass=None): def waitForProcessRunning(running=True): outputButton = waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") - if not waitFor("outputButton.checked", 10000): + if not waitFor("outputButton.checked", 5000): ensureChecked(outputButton) waitFor("object.exists(':Qt Creator.ReRun_QToolButton')", 20000) reRunButton = findObject(":Qt Creator.ReRun_QToolButton") waitFor("object.exists(':Qt Creator.Stop_QToolButton')", 20000) stopButton = findObject(":Qt Creator.Stop_QToolButton") - return waitFor("(reRunButton.enabled != running) and (stopButton.enabled == running)", 10000) + return waitFor("(reRunButton.enabled != running) and (stopButton.enabled == running)", 5000) # run and close an application # returns None if the build failed, False if the subprocess did not start, and True otherwise -def runAndCloseApp(isQtQuickUI=False): +def runAndCloseApp(): runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton") clickButton(runButton) - if not isQtQuickUI: - waitForCompile(300000) - buildSucceeded = checkLastBuild() - ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")) - if not buildSucceeded: - test.fatal("Build inside run wasn't successful - leaving test") - return None + waitForCompile(300000) + buildSucceeded = checkLastBuild() + ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")) + if not buildSucceeded: + test.fatal("Build inside run wasn't successful - leaving test") + return None if not waitForProcessRunning(): test.fatal("Couldn't start application - leaving test") return False - __closeSubprocessByPushingStop__(isQtQuickUI) + __closeSubprocessByPushingStop__(False) return True def __closeSubprocessByPushingStop__(isQtQuickUI): diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index e3171153c7..adf7c4f62f 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -25,21 +25,39 @@ source("../../shared/qtcreator.py") +def _exactlyOne_(iterable): + trueElements = 0 + for element in iterable: + if element: + trueElements += 1 + return trueElements == 1 + def main(): startQC() if not startedWithoutPluginError(): return - available = ["5.6"] + available = ["5.6", "5.10"] for qtVersion in available: # using a temporary directory won't mess up a potentially existing workingDir = tempDir() - createNewQtQuickUI(workingDir, qtVersion) - if runAndCloseApp(True) == None: - checkCompile() - else: - appOutput = logApplicationOutput() - test.verify(not ("untitled.qml" in appOutput or "MainForm.ui.qml" in appOutput), - "Does the Application Output indicate QML errors?") + checkedKits, projectName = createNewQtQuickUI(workingDir, qtVersion) + checkedKitNames = Targets.getTargetsAsStrings(checkedKits) + test.verify(_exactlyOne_(map(lambda name: qtVersion in name, checkedKitNames)), + "The requested kit should have been checked") + if qtVersion == "5.10": + test.verify(not any(map(lambda name: "5.6" in name, checkedKitNames)), + "The 5.6 kit should not have been checked when 5.10 is required") + clickButton(waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")) + if not waitForProcessRunning(): + test.fatal("Couldn't start application - leaving test") + continue + if test.verify(not waitForProcessRunning(False), "The application should keep running"): + __closeSubprocessByPushingStop__(True) + appOutput = logApplicationOutput() + test.verify(_exactlyOne_(map(lambda ver: ver in appOutput, available)), + "Does Creator use qmlscene from a checked kit?") + test.verify(projectName + ".qml:" not in appOutput, + "Does the Application Output indicate QML errors?") invokeMenuItem("File", "Close All Projects and Editors") invokeMenuItem("File", "Exit") |