Cucumber JVM Maven集成问题



我能够使用@RunWith&CucumberOptions标签。但是我无法使用Maven执行测试。有人能给我指正确的方向吗?

我正在尝试使用maven sure fire插件,在搜索了互联网之后。我确实认为,我犯了一个我不知道的错误。

目录结构为:

 srctest 
   --config
   --resources (has the .feature files)
   --steps  (classes for the steps)

===================maven POM文件================

http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>Project</groupId>
<artifactId>Project</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
    <cucumber.options>--format pretty</cucumber.options>
    <testsrc>src/test/</testsrc>
</properties>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.0</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.2.0</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>1.2.0</version>
    </dependency>
    <dependency> <!-- External Dependency -->
        <groupId>ojdbc6</groupId>
        <artifactId>ojdbc6</artifactId>
        <scope>system</scope>
        <version>1.0</version>
        <systemPath>E:worktestProjectlibsojdbc6dms.jar</systemPath>
    </dependency>
    <dependency> <!-- External Dependency -->
        <groupId>sqljdbc</groupId>
        <artifactId>ojdbc6</artifactId>
        <scope>system</scope>
        <version>1.0</version>
        <systemPath>E:worktestProjectlibssqljdbc4.jar</systemPath>
    </dependency>
</dependencies>
<build>
    <testSourceDirectory>${testsrc}</testSourceDirectory>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</version>
            <configuration>
                <parallel>classes</parallel>
                <threadCount>1</threadCount>
                <includes>
                    <include>**/RunCukeTests.java</include>
                </includes>
            </configuration>
        </plugin>
    </plugins>
</build>

也可以尝试添加Maven编译器插件。

最新更新