diff options
-rw-r--r-- | tests/system/shared/mainwin.py | 59 | ||||
-rw-r--r-- | tests/system/shared/project.py | 44 | ||||
-rw-r--r-- | tests/system/shared/qtcreator.py | 1 | ||||
-rw-r--r-- | tests/system/shared/utils.py | 13 |
4 files changed, 57 insertions, 60 deletions
diff --git a/tests/system/shared/mainwin.py b/tests/system/shared/mainwin.py deleted file mode 100644 index 7a662aee526..00000000000 --- a/tests/system/shared/mainwin.py +++ /dev/null @@ -1,59 +0,0 @@ - -def invokeMenuItem(menu, item): - menuObject = waitForObjectItem("{type='QMenuBar' visible='true'}", menu) - activateItem(menuObject) - activateItem(waitForObjectItem(objectMap.realName(menuObject), item)) - -def openQmakeProject(projectPath): - invokeMenuItem("File", "Open File or Project...") - if platform.system()=="Darwin": - snooze(1) - nativeType("<Command+Shift+g>") - snooze(1) - nativeType(projectPath) - snooze(1) - nativeType("<Return>") - snooze(2) - nativeType("<Return>") - else: - waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}") - type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath) - clickButton(findObject("{text='Open' type='QPushButton'}")) - waitForObject("{type='Qt4ProjectManager::Internal::ProjectLoadWizard' visible='1' windowTitle='Project Setup'}") - selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox", "For Each Qt Version One Debug And One Release") - clickButton(findObject("{text~='(Finish|Done)' type='QPushButton'}")) - -def openCmakeProject(projectPath): - invokeMenuItem("File", "Open File or Project...") - if platform.system()=="Darwin": - snooze(1) - nativeType("<Command+Shift+g>") - snooze(1) - nativeType(projectPath) - snooze(1) - nativeType("<Return>") - snooze(2) - nativeType("<Return>") - else: - waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}") - type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath) - clickButton(findObject("{text='Open' type='QPushButton'}")) - clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000)) - generatorCombo = waitForObject(":Generator:_QComboBox") - index = generatorCombo.findText("MinGW Generator (MinGW from SDK)") - if index == -1: - index = generatorCombo.findText("NMake Generator (Microsoft Visual C++ Compiler 9.0 (x86))") - if index != -1: - generatorCombo.setCurrentIndex(index) - clickButton(waitForObject(":CMake Wizard.Run CMake_QPushButton", 20000)) - clickButton(waitForObject(":CMake Wizard.Finish_QPushButton", 60000)) - -def logApplicationOutput(): - # make sure application output is shown - toggleAppOutput = waitForObject("{type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow' occurrence='3'}", 20000) - if not toggleAppOutput.checked: - clickButton(toggleAppOutput) - output = waitForObject("{type='Core::OutputWindow' visible='1' windowTitle='Application Output Window'}", 20000) - test.log("Application Output:\n%s" % output.plainText) - diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 64eddec1a39..5fa719a347d 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -1,3 +1,47 @@ +def openQmakeProject(projectPath): + invokeMenuItem("File", "Open File or Project...") + if platform.system()=="Darwin": + snooze(1) + nativeType("<Command+Shift+g>") + snooze(1) + nativeType(projectPath) + snooze(1) + nativeType("<Return>") + snooze(2) + nativeType("<Return>") + else: + waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}") + type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath) + clickButton(findObject("{text='Open' type='QPushButton'}")) + waitForObject("{type='Qt4ProjectManager::Internal::ProjectLoadWizard' visible='1' windowTitle='Project Setup'}") + selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox", "For Each Qt Version One Debug And One Release") + clickButton(findObject("{text~='(Finish|Done)' type='QPushButton'}")) + +def openCmakeProject(projectPath): + invokeMenuItem("File", "Open File or Project...") + if platform.system()=="Darwin": + snooze(1) + nativeType("<Command+Shift+g>") + snooze(1) + nativeType(projectPath) + snooze(1) + nativeType("<Return>") + snooze(2) + nativeType("<Return>") + else: + waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}") + type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath) + clickButton(findObject("{text='Open' type='QPushButton'}")) + clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000)) + generatorCombo = waitForObject(":Generator:_QComboBox") + index = generatorCombo.findText("MinGW Generator (MinGW from SDK)") + if index == -1: + index = generatorCombo.findText("NMake Generator (Microsoft Visual C++ Compiler 9.0 (x86))") + if index != -1: + generatorCombo.setCurrentIndex(index) + clickButton(waitForObject(":CMake Wizard.Run CMake_QPushButton", 20000)) + clickButton(waitForObject(":CMake Wizard.Finish_QPushButton", 60000)) + def shadowBuildDir(path, project, qtVersion, debugVersion): qtVersion = qtVersion.replace(" ", "_") qtVersion = qtVersion.replace(".", "_") diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index de49c30b7c9..97b78778a3b 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -15,7 +15,6 @@ testSettings.logScreenshotOnFail = True source("../../shared/utils.py") source("../../shared/build_utils.py") -source("../../shared/mainwin.py") source("../../shared/project.py") source("../../shared/qtquick.py") source("../../shared/editor_utils.py") diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 640a1ee6e28..6f7e59ef485 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -121,3 +121,16 @@ def cleanUpUserFiles(pathsToProFiles=None): doneWithoutErrors = False return doneWithoutErrors +def invokeMenuItem(menu, item): + menuObject = waitForObjectItem("{type='QMenuBar' visible='true'}", menu) + activateItem(menuObject) + activateItem(waitForObjectItem(objectMap.realName(menuObject), item)) + +def logApplicationOutput(): + # make sure application output is shown + toggleAppOutput = waitForObject("{type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow' occurrence='3'}", 20000) + if not toggleAppOutput.checked: + clickButton(toggleAppOutput) + output = waitForObject("{type='Core::OutputWindow' visible='1' windowTitle='Application Output Window'}", 20000) + test.log("Application Output:\n%s" % output.plainText) |