Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java RerRunningTestScont=N对我不起作用_Java_Maven_Selenium_Maven Surefire Plugin_Cucumber Junit - Fatal编程技术网

Java RerRunningTestScont=N对我不起作用

Java RerRunningTestScont=N对我不起作用,java,maven,selenium,maven-surefire-plugin,cucumber-junit,Java,Maven,Selenium,Maven Surefire Plugin,Cucumber Junit,我正在尝试使用maven surefire插件重新运行失败的测试,并使用参数“RerRunningTestScont=N” 我无法通过以下POm和我的runner类实现重试,从2.19.1开始,我在maven Surefire上尝试了不同的版本 感谢您的帮助 ***************我的POM如下:*********************** <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http

我正在尝试使用maven surefire插件重新运行失败的测试,并使用参数“RerRunningTestScont=N”

我无法通过以下POm和我的runner类实现重试,从2.19.1开始,我在maven Surefire上尝试了不同的版本

感谢您的帮助 ***************我的POM如下:***********************

     <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>OnlineTest</groupId>
    <artifactId>VehicleRegistrationTest</artifactId>
    <version>1.0-SNAPSHOT</version>

    <packaging>jar</packaging>
    <name>${name}</name>
    <properties>
        <name>VehicleRegistration</name>
        <maven.build.timestamp.format>yyyy-MM-dd-HHmm</maven.build.timestamp.format>
        <buildNumber>${maven.build.timestamp}</buildNumber>
        <reports.directory>${project.build.directory}/../reports/</reports.directory>
        <selenium.enabled>true</selenium.enabled>
        <test.parallel.count>2</test.parallel.count>
        <surefire.maven.plugin.version>2.20.1</surefire.maven.plugin.version>
        <cucumber.jvm.parallel.version>4.2.0</cucumber.jvm.parallel.version>
        <parallel.scheme>SCENARIO</parallel.scheme>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-api</artifactId>
            <version>2.20.1</version>
        </dependency>

        <dependency>
            <groupId>com.github.mkolisnyk</groupId>
            <artifactId>cucumber-runner</artifactId>
            <version>1.3.3</version>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.11.0</version>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-junit</artifactId>
            <version>2.0.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>3.11.0</version>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.2.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.mkolisnyk</groupId>
            <artifactId>cucumber-report-generator</artifactId>
            <version>1.3.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.mkolisnyk</groupId>
            <artifactId>cucumber-runner</artifactId>
            <version>1.3.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.mkolisnyk</groupId>
            <artifactId>cucumber-runner</artifactId>
            <version>1.3.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.mkolisnyk</groupId>
            <artifactId>cucumber-report-generator</artifactId>
            <version>1.3.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.mkolisnyk</groupId>
            <artifactId>cucumber-runner</artifactId>
            <version>1.3.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.mkolisnyk</groupId>
            <artifactId>cucumber-report-generator</artifactId>
            <version>1.3.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.mkolisnyk</groupId>
            <artifactId>cucumber-report-generator</artifactId>
            <version>1.3.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.2.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <pluginRepositories>
        <pluginRepository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>hindsighttesting.release</id>
            <name>Hindsight Software Release Repository</name>
            <url>http://repo.hindsightsoftware.com/public-maven</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.20.1</version>
                <configuration>
                    <forkCount>${test.parallel.count}</forkCount>
                    <reuseForks>true</reuseForks>
                    <workingDirectory>parallel-tests-fork-${surefire.forkNumber}</workingDirectory>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20.1</version>
                <configuration>
                    <skip>true</skip>
                    <includes>
                        <include>**/*testRunner.java</include>
                    </includes>
                    <rerunFailingTestsCount>3</rerunFailingTestsCount>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.5</version>
            </plugin>

            <plugin>
                <groupId>com.github.temyers</groupId>
                <artifactId>cucumber-jvm-parallel-plugin</artifactId>
                <version>${cucumber.jvm.parallel.version}</version>
                <executions>
                    <execution>
                        <id>generateRunners</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>generateRunners</goal>
                        </goals>
                        <configuration>
                            <glue>
                                <package>stepDefinition.Hooks</package>
                                <package>webDriver</package>
                                <package>stepDefinitions</package>
                            </glue>
                            <featuresDirectory>src/test/resources/featureFiles/</featuresDirectory>
                            <cucumberOutputDir>target/json-reports</cucumberOutputDir>
                            <format>json</format>
                            <parallelScheme>${parallel.scheme}</parallelScheme>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>report.donut</groupId>
                <artifactId>donut-maven-plugin</artifactId>
                <version>0.0.6</version>
                <executions>
                    <execution>
                        <id>execution</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <sourceDirectory>${project.build.directory}/json-reports</sourceDirectory>
                            <outputDirectory>reports/testReports</outputDirectory>
                            <prefix>rcf-test-${maven.build.timestamp}</prefix>
                            <timestamp>${maven.build.timestamp}</timestamp>
                            <template>default</template>
                            <projectName>${project.name}</projectName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArgument>-Werror</compilerArgument>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>




***************my testRunner class is as follow:*******************

    import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;


@RunWith(Cucumber.class)
@CucumberOptions(
        features = {"featureFiles"},
        glue = {"stepDefinitions"},
        plugin ={"rerun:target/rerun.txt"}
)

public class testRunner { }



4.0.0
在线测试
车辆登记测试
1.0-快照
罐子
${name}
车辆登记
yyyy MM dd HHmm
${maven.build.timestamp}
${project.build.directory}/./报告/
真的
2.
2.20.1
4.2.0
脚本
org.apache.maven.surefire
SurefireAPI
2.20.1
com.github.mkolisnyk
黄瓜赛跑者
1.3.3
org.seleniumhq.selenium
硒爪哇
3.11.0
org.hamcrest
汉克雷斯特朱松
2.0.0.0
org.seleniumhq.selenium
硒服务器
3.11.0
信息杯
黄瓜爪哇
1.2.5
测试
信息杯
黄瓜刺柏
1.2.5
测试
朱尼特
朱尼特
4.12
测试
com.github.mkolisnyk
黄瓜报告生成器
1.3.5
测试
com.github.mkolisnyk
黄瓜赛跑者
1.3.5
测试
com.github.mkolisnyk
黄瓜赛跑者
1.3.5
测试
com.github.mkolisnyk
黄瓜报告生成器
1.3.3
测试
com.github.mkolisnyk
黄瓜赛跑者
1.3.5
测试
com.github.mkolisnyk
黄瓜报告生成器
1.3.5
测试
com.github.mkolisnyk
黄瓜报告生成器
1.3.5
测试
信息杯
黄瓜刺柏
1.2.5
测试
假的
后视释放
事后诸葛亮软件发布库
http://repo.hindsightsoftware.com/public-maven
org.apache.maven.plugins
maven故障保护插件
2.20.1
${test.parallel.count}
真的
并行测试fork-${surefire.forkNumber}
集成测试
验证
org.apache.maven.plugins
maven surefire插件
2.20.1
真的
**/*testRunner.java
3.
org.apache.maven.plugins
maven jxr插件
2.5
com.github.temyers
黄瓜jvm并行插件
${cumber.jvm.parallel.version}
发电商
生成测试源
发电商
步骤定义。挂钩
网络驱动程序
步骤定义
src/test/resources/featureFiles/
目标/json报告
json
${parallel.scheme}
报告,甜甜圈
甜甜圈maven插件
0.0.6
执行
整合后测试
生成
${project.build.directory}/json报告
报告/测试报告
rcf测试-${maven.build.timestamp}
${maven.build.timestamp}
违约
${project.name}
org.apache.maven.plugins
maven编译器插件
3.7.0
1.8
1.8
-沃罗
***************我的testRunner类如下所示:*******************
进口cucumber.api.CucumberOptions;
进口cucumber.api.junit.cucumber;
导入org.junit.runner.RunWith;
@RunWith(cumber.class)
@黄瓜选项(
features={“featureFiles”},
glue={“步骤定义”},
插件={“rerun:target/rerun.txt”}
)
公共类testRunner{}

您正在使用哪个插件执行。Surefire或failsafe?您如何在mvn命令中使用该参数我使用Surefire执行失败的测试,命令是:mvn clean verify-Dcucumber.tags