getgauge / gauge-visualstudio

Visual Studio plugin for Gauge
10 stars 9 forks source link

Gauge linked in TFS Builds. #266

Closed salmankhwaja closed 4 years ago

salmankhwaja commented 4 years ago

Hi,

We are integrating Gauge with TFS Builds. We have successfully ran gauge with OWASP Zap. When we are implementing Gauge with TFS using TFS Build variables, our variables are not being transformed into values from TFS Builds to Gauge environment and ultimately in program.

Please provide help if you know.

Environment details:

Windows 2012, Command line. TFS is on Windows Also Agent is on Windows also.

Gauge is running with windows, python, and OWASP ZAP.

Syntax3r commented 4 years ago

I have the same issue..

Gauge

zabil commented 4 years ago

our variables are not being transformed into values from TFS Builds to Gauge environment and ultimately in program.

Can you give an example of how you are trying to access environment variables?

Syntax3r commented 4 years ago

I have put the %{variable} in Scenario of Spec file.

Example :

Open URL with OWASP ZAP

This is a scenario that starts OWASP ZAP

Want to replace the "login_page_url" with the variable provide through TFS during build.

zabil commented 4 years ago

This is not supported at the moment on specs. You can access the environment variable in the step implementation for example in Java

@Step("Start ZAP and Open URL")
public void startZap() {
 String url = System.getenv("login_page_url");
  ...
}

@salmankhwaja is this the same issue that you are facing too?

There's a discussion about this here https://github.com/getgauge/gauge/issues/1395

salmankhwaja commented 4 years ago

@zabil ,

Thanks. Yeah I was having the same problem.