Commit 368726d6 authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Moved contents of mainwin.py to other files

Change-Id: I998b1304dc9ad8832990da5e90ab426c38eb329e
Reviewed-on: http://codereview.qt-project.org/6182

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent b44d3ad1
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)
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(".", "_")
......
......@@ -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")
......
......@@ -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)
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