aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@digia.com>2013-05-07 11:08:40 +0200
committerChristian Stenger <christian.stenger@digia.com>2013-05-15 08:59:16 +0200
commit8ca5b55a0bafd744cf62c20de379a7738cb76138 (patch)
treee60751bf9feeb2290c1cc8eaf24ea18c419dbbf7
parenta4e593c910cca212d1373ca32f803f4e50805a34 (diff)
Squish: Prepare re-usage of batch editing...
...of the environment variables for the next run. Change-Id: Iaf383dfa361971c75be0e180d72ab95c5df83ebe Reviewed-by: Robert Loehning <robert.loehning@digia.com>
-rw-r--r--tests/system/objects.map2
-rw-r--r--tests/system/shared/hook_utils.py26
2 files changed, 17 insertions, 11 deletions
diff --git a/tests/system/objects.map b/tests/system/objects.map
index b39ba183f6..abc6939063 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -137,6 +137,8 @@
:Restart required_QMessageBox {text='The language change will take effect after a restart of Qt Creator.' type='QMessageBox' unnamed='1' visible='1'}
:Revert to Saved.Proceed_QPushButton {text='Proceed' type='QPushButton' unnamed='1' visible='1' window=':Revert to Saved_QMessageBox'}
:Revert to Saved_QMessageBox {text?='You will lose your current changes if you proceed reverting*' type='QMessageBox' unnamed='1' visible='1'}
+:RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'}
:Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'}
:Symbol Server_Utils::CheckableMessageBox {type='Utils::CheckableMessageBox' unnamed='1' visible='1' windowTitle='Symbol Server'}
:User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'}
diff --git a/tests/system/shared/hook_utils.py b/tests/system/shared/hook_utils.py
index fca63726a1..1683a1dc3e 100644
--- a/tests/system/shared/hook_utils.py
+++ b/tests/system/shared/hook_utils.py
@@ -17,9 +17,7 @@ def modifyRunSettingsForHookInto(projectName, kitCount, port):
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN)
result = __configureCustomExecutable__(projectName, port, mkspec, qtVersion)
if result:
- clickButton(waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' text='Details' "
- "type='Utils::DetailsButton' unnamed='1' visible='1' "
- "leftWidget={type='QLabel' text~='Us(e|ing) <b>Build Environment</b>' unnamed='1' visible='1'}}"))
+ ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton")
envVarsTableView = waitForObject("{type='QTableView' visible='1' unnamed='1'}")
model = envVarsTableView.model()
changingVars = []
@@ -41,17 +39,23 @@ def modifyRunSettingsForHookInto(projectName, kitCount, port):
changingVars.append("SQUISH_LIBQTDIR=%s" % replacement)
else:
changingVars.append(varName)
- #test.log("Unsetting %s for run" % varName)
- clickButton(waitForObject("{text='Batch Edit...' type='QPushButton' unnamed='1' visible='1' "
- "window=':Qt Creator_Core::Internal::MainWindow'}"))
- editor = waitForObject("{type='TextEditor::SnippetEditorWidget' unnamed='1' visible='1' "
- "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}")
- typeLines(editor, changingVars)
- clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' "
- "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}"))
+ batchEditRunEnvironment(kitCount, 0, changingVars, True)
switchViewTo(ViewConstants.EDIT)
return result
+def batchEditRunEnvironment(kitCount, currentTarget, modifications, alreadyOnRunSettings=False):
+ if not alreadyOnRunSettings:
+ switchViewTo(ViewConstants.PROJECTS)
+ switchToBuildOrRunSettingsFor(kitCount, currentTarget, ProjectSettings.RUN)
+ ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton")
+ clickButton(waitForObject("{text='Batch Edit...' type='QPushButton' unnamed='1' visible='1' "
+ "window=':Qt Creator_Core::Internal::MainWindow'}"))
+ editor = waitForObject("{type='TextEditor::SnippetEditorWidget' unnamed='1' visible='1' "
+ "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}")
+ typeLines(editor, modifications)
+ clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' "
+ "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}"))
+
def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN, True)