diff options
author | Christian Stenger <christian.stenger@digia.com> | 2014-01-23 09:25:28 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@digia.com> | 2014-01-24 11:12:10 +0100 |
commit | 7f4c9a19f2a8bddc1a0b0ef8c7da97d6a94e58bd (patch) | |
tree | 5369f8919ba6210a92b6fe1e546f2950c4b145e8 | |
parent | b4a5c2322804c988135ebb93259b84063551f020 (diff) | |
download | qt-creator-7f4c9a19f2a8bddc1a0b0ef8c7da97d6a94e58bd.tar.gz |
Squish: Unify invoking add custom executable
Change-Id: If090ca16a9cc358ff38de5564d2e8ef2a2cf8200
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
-rw-r--r-- | tests/system/shared/hook_utils.py | 61 |
1 files changed, 26 insertions, 35 deletions
diff --git a/tests/system/shared/hook_utils.py b/tests/system/shared/hook_utils.py index bc1a81b9fe..c89dc1e761 100644 --- a/tests/system/shared/hook_utils.py +++ b/tests/system/shared/hook_utils.py @@ -111,29 +111,12 @@ def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, por executable = os.path.abspath(os.path.dirname(qmake) + "/qmlscene") if platform.system() in ('Microsoft', 'Windows'): executable = executable + ".exe" - addRunConfig = waitForObject("{container={window=':Qt Creator_Core::Internal::MainWindow' " - "type='ProjectExplorer::Internal::RunSettingsWidget' unnamed='1' " - "visible='1'} occurrence='2' text='Add' type='QPushButton' " - "unnamed='1' visible='1'}") - clickButton(addRunConfig) - activateItem(waitForObject("{type='QMenu' visible='1' unnamed='1'}"), "Custom Executable") - exePathChooser = waitForObject(":Executable:_Utils::PathChooser") - exeLineEd = getChildByClass(exePathChooser, "Utils::BaseValidatingLineEdit") - argLineEd = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' " - "type='QLabel' text='Arguments:' visible='1'} type='QLineEdit' " - "unnamed='1' visible='1'}") - wdPathChooser = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' " - "text='Working directory:' type='QLabel'} " - "type='Utils::PathChooser' unnamed='1' visible='1'}") - wdLineEd = getChildByClass(wdPathChooser, "Utils::BaseValidatingLineEdit") startAUT = os.path.abspath(squishPath + "/bin/startaut") if platform.system() in ('Microsoft', 'Windows'): startAUT = startAUT + ".exe" + args = "--verbose --port=%d %s %s.qml" % (port, executable, projectName) projectPath = os.path.abspath("%s/%s" % (workingDir, projectName)) - replaceEditorContent(exeLineEd, startAUT) - replaceEditorContent(argLineEd, "--verbose --port=%d %s %s.qml" - % (port, executable, projectName)) - replaceEditorContent(wdLineEd, projectPath) + __invokeAddCustomExecutable__(startAUT, args, projectPath) clickButton(waitForObject("{text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow' " "leftWidget={type='QLabel' text~='Us(e|ing) <b>Build Environment</b>'" @@ -231,27 +214,13 @@ def __configureCustomExecutable__(projectName, port, mkspec, qmakeVersion): "Failed to find '%s'" % startAUT) return False progressBarWait() - addButton = waitForObject("{container={window=':Qt Creator_Core::Internal::MainWindow' " - "type='ProjectExplorer::Internal::RunSettingsWidget' unnamed='1' " - "visible='1'} occurrence='2' text='Add' type='QPushButton' " - "unnamed='1' visible='1'}") - clickButton(addButton) - addMenu = addButton.menu() - activateItem(waitForObjectItem(addMenu, 'Custom Executable')) - exePathChooser = waitForObject(":Executable:_Utils::PathChooser", 2000) - exeLineEd = getChildByClass(exePathChooser, "Utils::BaseValidatingLineEdit") - argLineEd = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' " - "type='QLabel' text='Arguments:' visible='1'} type='QLineEdit' " - "unnamed='1' visible='1'}") - wdPathChooser = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' text='Working directory:' type='QLabel'} " - "type='Utils::PathChooser' unnamed='1' visible='1'}") - replaceEditorContent(exeLineEd, startAUT) # the following is currently only configured for release builds (will be enhanced later) if platform.system() in ('Microsoft', 'Windows'): debOrRel = "release" + os.sep else: debOrRel = "" - replaceEditorContent(argLineEd, "--verbose --port=%d %s%s" % (port, debOrRel, projectName)) + args = "--verbose --port=%d %s%s" % (port, debOrRel, projectName) + __invokeAddCustomExecutable__(startAUT, args) return True # function that retrieves a specific child object by its class @@ -424,3 +393,25 @@ def __getSquishServer__(): test.fatal("SQUISH_PREFIX isn't set - leaving test") return None return os.path.abspath(squishSrv + "/bin/squishserver") + +def __invokeAddCustomExecutable__(exe, args, workingDir=None): + addButton = waitForObject("{container={window=':Qt Creator_Core::Internal::MainWindow' " + "type='ProjectExplorer::Internal::RunSettingsWidget' unnamed='1' " + "visible='1'} occurrence='2' text='Add' type='QPushButton' " + "unnamed='1' visible='1'}") + clickButton(addButton) + addMenu = addButton.menu() + activateItem(waitForObjectItem(addMenu, 'Custom Executable')) + exePathChooser = waitForObject(":Executable:_Utils::PathChooser") + exeLineEd = getChildByClass(exePathChooser, "Utils::BaseValidatingLineEdit") + argLineEd = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' " + "type='QLabel' text='Arguments:' visible='1'} type='QLineEdit' " + "unnamed='1' visible='1'}") + wdPathChooser = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' " + "text='Working directory:' type='QLabel'} " + "type='Utils::PathChooser' unnamed='1' visible='1'}") + wdLineEd = getChildByClass(wdPathChooser, "Utils::BaseValidatingLineEdit") + replaceEditorContent(exeLineEd, exe) + replaceEditorContent(argLineEd, args) + if workingDir: + replaceEditorContent(wdLineEd, workingDir) |