Not able to run Project specific configuration when running Gauge Spec/Scenario by code lens

125 views
Skip to first unread message

Gaurav Srivastava

unread,
Sep 15, 2020, 4:49:05 PM9/15/20
to getgauge

Is there any way to set the project specific variable( in our case we need to pass envName=”someValue”) when running Gauge Spec/Scenario by code lens?

Environment information:
• Operating System: Windows 10 64bit
*JDK version:*11 •
Visual Studio Code version: 1.48.2
• Gauge version: 1.1.2 •
Java extension pack: 0.10.0
• Java Debugger extension version: 0.28.0
• Gauge extension: 0.0.15
• Maven for Java : 0.24.2

Steps To Reproduce
[step 1] enable code lens

[step 2] run test or debug by clicking code lens

Current Result environment variables weren't set Expected Result there should be any way to set environment variables.

Things I have already tried: Refer the link : https://github.com/microsoft/vscode-java-test/wiki/Run-with-Configurationand do the changes in Workspace setting.xml file

Setting.xml looks like after update:

{
"java.home": "somejavapath",
"files.associations": {
".spec": "gauge",
"
.cpt": "gauge"
},
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 500,
"maven.view": "flat",
"java.configuration.updateBuildConfiguration": "interactive",
"http.proxyAuthorization": "someproxy",
"gauge.recommendedSettings.options": "Apply & Reload",
"gauge.codeLenses.reference": true,
"editor.suggestSelection": "first",
"files.exclude": {
"/.classpath": true,
"
/.project": true,
"/.settings": true,
"
/.factorypath": true
},
"java.configuration.maven.userSettings": "somemavenpath",
"java.test.config": {"name": "myconfig,"env": {"envName" : "UAT"},
"java.test.defaultConfig": "myconfig"
}

Below command fires when we Run the spec via code lens
Running tool: mvn.cmd -q clean compile test-compile gauge:execute -Dflags=--hide-suggestion,--simple-console -DspecsDir=someSpecFilePath.spec

_Expected command when we Run the spec via code lens _
Running tool: mvn.cmd -q clean compile test-compile gauge:execute -Dflags=--hide-suggestion,--simple-console -DenvName=”someEvnName” -DspecsDir=someSpecFilePath.spec

Srikanth V

unread,
Sep 15, 2020, 11:11:57 PM9/15/20
to getgauge
discussed here

Gaurav Srivastava

unread,
Sep 17, 2020, 3:14:44 AM9/17/20
to getgauge
Reply all
Reply to author
Forward
0 new messages