This plugin is used to integrate gauge with maven so that the specs can be run using maven.
Maven plugin to run Gauge specs.
- Gauge should be installed and in $PATH (0.9.0 or higher version). Latest version of Gauge can be downloaded from the website.
- Gauge Java plugin 0.6.0 or higher.
Gauge-mvn-archetypes provide templates to create gauge-maven projects.
Add the below snippet to pom.xml
<build>
<plugins>
<plugin>
<groupId>com.thoughtworks.gauge.maven</groupId>
<artifactId>gauge-maven-plugin</artifactId>
<version>1.3.0</version>
</plugin>
</plugins>
</build>
Run the below command to execute all specifications in specs
directory
mvn gauge:execute -DspecsDir=specs
Run the below command to execute a single specification
mvn gauge:execute -DspecsDir=specs/example.spec
Run the below command to execute specifications in specs
and specDir
directories
mvn gauge:execute -DspecsDir="specs,specDir"
Run the below command to execute the failed scenarios
mvn gauge:execute -Dflags="--failed"
Run the below command to execute the repeat scenarios
mvn gauge:execute -Dflags="--repeat"
Note
mvn test-compile
should be used for the tool to get latest changes of user code.
mvn gauge:execute -DspecsDir=specs -DinParallel=true
Execute specs by tags expression
mvn gauge:execute -DspecsDir=specs -Dtags="!in-progress"
Specifying execution environment
mvn gauge:execute -DspecsDir=specs -Denv="dev"
Run gauge specs in project as a part of maven test phase by adding the below execution to yor pom.xml
<build>
<plugins>
<plugin>
<groupId>com.thoughtworks.gauge.maven</groupId>
<artifactId>gauge-maven-plugin</artifactId>
<version>1.3.0</version>
<executions>
<execution>
<phase>test</phase>
<configuration>
<specsDir>specs</specsDir>
</configuration>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
mvn test
command will also run gauge specs if the above mentioned execution is added to the projects pom.xml
The following plugin properties can be additionally set:
Property name | Usage | Description |
---|---|---|
specsDir | -DspecsDir=specs | Gauge specs directory path. Required for executing specs. Takes a comma separated list of specification files/directories |
tags | -Dtags="tag1 & tag2" | Filter specs by specified tags expression |
inParallel | -DinParallel=true | Execute specs in parallel |
nodes | -Dnodes=3 | Number of parallel execution streams. Use with parallel |
env | -Denv=qa | gauge env to run against |
flags | -Dflags="--verbose,--simpleConsole" | Add additional gauge flags to execution |
- Read the user docs for more details.
- See gauge-tests for project example of usage.
Gauge maven plugin is released under GNU Public License version 3.0
Copyright 2015 ThoughtWorks, Inc.