1

I am new to gauge testing tool .I have a maven project that consists of specs and step implementations. Mvn package phase does generate a jar file with all the required classes. However I cant figure out how i can run the gauge specs using a Main class in java, such that i can just run the jar file to run the tests. Is this possible?

trial999
  • 1,646
  • 6
  • 21
  • 36

2 Answers2

0

Unfortunately no, Gauge binary must be installed and available to execute the specs.

As the Gauge binary is not written in java it cannot be bundled in a jar file and invoked from a Main class.

If you'd like to automatically download and use Gauge in a CI/CD environment, try something like https://github.com/maven-download-plugin/maven-download-plugin to download gauge into a convenient location as part of your mvn build itself.

More info about this here

Zabil
  • 81
  • 2
0

There is a way to do this. You have to package maven and gauge inside the project directory and include them in the jar. In the main method, unzip all files, then run a shell script to export maven and gauge in the project directory to $PATH, then execute mvn gauge:execute as usual. It's a bit of a hack as it extracts everything to the directory in which the jar is located, but it works on RHEL 7 and I haven't managed to find a cleaner method.

mbj
  • 107
  • 2
  • 10