• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

getgauge-contrib/gauge-maven-plugin: Maven plugin to run gauge specs

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

getgauge-contrib/gauge-maven-plugin

开源软件地址(OpenSource Url):

https://github.com/getgauge-contrib/gauge-maven-plugin

开源编程语言(OpenSource Language):

Java 96.4%

开源软件介绍(OpenSource Introduction):

gauge-maven-plugin

Actions Status Maven Central

This plugin is used to integrate gauge with maven so that the specs can be run using maven.

Maven plugin to run Gauge specs.

Prerequisites

  • Gauge should be installed and in $PATH (0.9.0 or higher version). Latest version of Gauge can be downloaded using these instructions.
  • Gauge Java plugin 0.6.0 or higher.

Create project from archetype

Gauge-mvn-archetypes provide templates to create gauge-maven projects.

Add to project

Add the below snippet to pom.xml

<build>
     <plugins>
         <plugin>
             <groupId>com.thoughtworks.gauge.maven</groupId>
             <artifactId>gauge-maven-plugin</artifactId>
             <version>1.4.0</version>
         </plugin>
     </plugins>
 </build>

Executing specs

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.

Execute specs In parallel

mvn gauge:execute -DspecsDir=specs -DinParallel=true

Execute specs by tags expression

mvn gauge:execute -DspecsDir=specs -Dtags="!in-progress"

Execute spec by scenario name

mvn gauge:execute -DspecsDir=specs -Dscenario="Scenario Name"

Specifying execution environment

mvn gauge:execute -DspecsDir=specs -Denv="dev"

As a part of maven test phase

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.4.0</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

Validate specs in project

Run the below command to execute all specifications in specs directory

mvn gauge:validate -DspecsDir=specs

Run the below command to validate and ignore stub implementation suggestions

mvn gauge:validate -Dflags="--hide-suggestion"

As a part of maven test-compile phase

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.4.0</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>

Running both goals (validate and execute) as part of maven

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.4.0</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>

All Properties

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

Docs

License

GNU Public License version 3.0 Gauge maven plugin is released under GNU Public License version 3.0

Copyright

Copyright 2015 ThoughtWorks, Inc.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap