This project serves as a boilerplate for automating web applications across various browsers and environments using Gauge and Selenium.
- Java
- Maven
Follow the instructions mentioned in Installing Gauge in the official Gauge Documentation
Open Command Prompt and execute following commands.
gauge install java
gauge install html-report
gauge install json-report
gauge install xml-report
gauge install spectacle
gauge install flash
You can check the installation using the following command.
gauge -v
Note: If the installation is success, it will output like this:
Gauge version: <version number>
Plugins
-------
flash (<version number>)
html-report (<version number>)
java (<version number>)
json-report (<version number>)
spectacle (<version number>)
xml-report (<version number>)
Run the below command to execute all specifications in
specs
directorymvn 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
andspecDir
directoriesmvn 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
mvn gauge:execute -DspecsDir=specs -Dtags="!in-progress"
mvn gauge:execute -DspecsDir=specs -Dscenario="Scenario Name"
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.6.1</version>
<executions>
<execution>
<phase>test</phase>
<configuration>
<specsDir>specs</specsDir>
<environmentVariables>
<CUSTOM_ENV_VARIABLE>value</CUSTOM_ENV_VARIABLE>
</environmentVariables>
</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
Run the below command to execute all specifications in
specs
directorymvn gauge:validate -DspecsDir=specs
Run the below command to validate and ignore stub implementation suggestions
mvn gauge:validate -Dflags="--hide-suggestion"
Validate gauge specs in project as a part of maven test-compile 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.6.1</version>
<executions>
<execution>
<phase>test-compile</phase>
<configuration>
<specsDir>specs</specsDir>
<flags>
<flag>--hide-suggestion</flag>
</flags>
</configuration>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Add the following execution to pom.xml to run both goals:
<plugin>
<groupId>com.thoughtworks.gauge.maven</groupId>
<artifactId>gauge-maven-plugin</artifactId>
<version>1.6.1</version>
<executions>
<execution>
<id>validate</id>
<phase>test-compile</phase>
<goals>
<goal>validate</goal>
</goals>
</execution>
<execution>
<id>execute</id>
<phase>test</phase>
<goals><goal>execute</goal></goals>
<configuration>
<specsDir>specs</specsDir>
</configuration>
</execution>
</executions>
</plugin>
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 |
Open "Registry Editor" (Windows Key + R → Type regedit → Press Enter).
For 32-bit Windows installations, the key you must examine in the registry editor is
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
For 64-bit Windows installations, the key is
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
Please note that the "FEATURE_BFCACHE" sub key may or may not be present, and should be created if it is not present.
Inside this key, create a "DWORD" value named "iexplore.exe" with the value of "0".
Go to "Internet Options" on Internet Explorer.
Go to "Security" tab.
Check "Enable Protected Mode" for all zones (Internet, Local intranet, Trusted sites and Restricted sites).
Click on "Apply" button.
Click on "OK" button.
Note: Tested using a Windows 10 Core i7 Machine.