diff options
Diffstat (limited to 'tests/system/shared/qtquick.py')
-rw-r--r-- | tests/system/shared/qtquick.py | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/tests/system/shared/qtquick.py b/tests/system/shared/qtquick.py index 899bdeeda0..a8d6dd3c85 100644 --- a/tests/system/shared/qtquick.py +++ b/tests/system/shared/qtquick.py @@ -53,7 +53,7 @@ def __handleProcessExited__(object, exitCode): processExited = True # parameter components can only be one of the Constants defined in QtQuickConstants.Components -def chooseComponents(components=QtQuickConstants.Components.BUILTIN): +def __chooseComponents__(components=QtQuickConstants.Components.BUILTIN): rbComponentToChoose = waitForObject("{type='QRadioButton' text='%s' visible='1'}" % QtQuickConstants.getStringForComponents(components), 20000) if rbComponentToChoose.checked: @@ -64,22 +64,21 @@ def chooseComponents(components=QtQuickConstants.Components.BUILTIN): % QtQuickConstants.getStringForComponents(components)) # parameter target can be an OR'd value of QtQuickConstants.Targets -def chooseTargets(targets=QtQuickConstants.Targets.DESKTOP): +def __chooseTargets__(targets=QtQuickConstants.Targets.DESKTOP): # DESKTOP should be always accessible - destDesktop = waitForObject("{type='QCheckBox' text='%s' visible='1'}" - % QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.DESKTOP), 20000) - mustCheck = targets & QtQuickConstants.Targets.DESKTOP==QtQuickConstants.Targets.DESKTOP - if (mustCheck ^ destDesktop.checked): - clickButton(destDesktop) + ensureChecked("{type='QCheckBox' text='%s' visible='1'}" + % QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.DESKTOP), + targets & QtQuickConstants.Targets.DESKTOP) # following targets depend on the build environment - added for further/later tests - available = [QtQuickConstants.Targets.SYMBIAN, QtQuickConstants.Targets.MAEMO5, + available = [QtQuickConstants.Targets.MAEMO5, QtQuickConstants.Targets.SIMULATOR, QtQuickConstants.Targets.HARMATTAN] + if platform.system() in ('Windows', 'Microsoft'): + available += [QtQuickConstants.Targets.SYMBIAN] for current in available: mustCheck = targets & current == current try: - targetCheckbox = findObject("{type='QCheckBox' text='%s' visible='1'}" % QtQuickConstants.getStringForTarget(current)) - if mustCheck ^ targetCheckbox.checked: - clickButton(targetCheckbox) + ensureChecked("{type='QCheckBox' text='%s' visible='1'}" % QtQuickConstants.getStringForTarget(current), + mustCheck) except LookupError: if mustCheck: test.fail("Failed to check target '%s'" % QtQuickConstants.getStringForTarget(current)) @@ -103,9 +102,12 @@ def runAndCloseApp(): invokeMenuItem("File", "Exit") return False # the following is currently a work-around for not using hooking into subprocesses - if (waitForObject(":Qt Creator_Core::Internal::OutputPaneToggleButton").checked!=True): - clickButton(":Qt Creator_Core::Internal::OutputPaneToggleButton") - clickButton(":Qt Creator.Stop_QToolButton") + ensureChecked(":Qt Creator_Core::Internal::OutputPaneToggleButton") + playButton = verifyEnabled(":Qt Creator.ReRun_QToolButton", False) + stopButton = verifyEnabled(":Qt Creator.Stop_QToolButton") + clickButton(stopButton) + test.verify(playButton.enabled) + test.compare(stopButton.enabled, False) return True def runAndCloseQtQuickUI(): @@ -117,8 +119,7 @@ def runAndCloseQtQuickUI(): clickButton(runButton) waitFor("processStarted==True", 10000) # the following is currently a work-around for not using hooking into subprocesses - if (waitForObject(":Qt Creator_Core::Internal::OutputPaneToggleButton").checked!=True): - clickButton(":Qt Creator_Core::Internal::OutputPaneToggleButton") + ensureChecked(":Qt Creator_Core::Internal::OutputPaneToggleButton") stop = findObject(":Qt Creator.Stop_QToolButton") waitFor("stop.enabled==True") clickButton(stop) |