/examplejavagauge

gauge custom example java maven

Primary LanguageCSS

Build Status

Gauge example in Java using Maven

This is an example project for doing web automation testing with Gauge.

Running this example

The tests are run on Chrome by default.

Prerequisites

This example requires the following softwares to run.

  • Java 1.7 or above
    • Note that Gauge works with Java 1.6 and above. But this particular example uses Java 1.7
  • Gauge
  • Gauge Java plugin
    • can be installed using gauge install java
  • Chrome

Setting up Maven

Run specs

If you already have Maven installed, you can execute specs as mvn test or mvn gauge:execute -DspecsDir=specs -Dtags="test" This runs Gauge specs with Maven.

This uses Chrome as default browser for specs execution. Make sure Chrome is installed in your machine and chromedriver is in PATH.

If you want to use Firefox/IE as browser, pass the corresponding argument to set browser environment as follows:

mvn gauge:execute -DspecsDir=specs -Denv="firefox"
or
mvn gauge:execute -DspecsDir=specs -Denv="ie"

Note:

  • Gauge can also be used with other build tools.
  • You can use Gauge even without a build script!

Topics covered in the example