【发布时间】:2016-11-24 12:00:48
【问题描述】:
我想重新运行一个我知道会失败的测试,因为我正在尝试测试 Surefire 参数以重新运行失败的测试。 我尝试使用这两个命令运行 Maven,它们都没有按预期工作
-Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails test
和
-Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails surefire:test
这是pom.xml的一部分
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-api</artifactId>
<version>2.19.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
我原以为 Surefire 会在失败后重新启动测试,但 Maven 只是抛出此错误,我知道如何解决,但我希望重新运行测试。
Results :
Tests in error:
testA(selenium.services.TestThatWillFail): Element is not currently visible and so may not be interacted with(..)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 55.060 s
[INFO] Finished at: 2016-11-24T12:58:02+01:00
[INFO] Final Memory: 18M/173M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project eskn_selenium: There are test failures.
【问题讨论】:
标签: java maven testing maven-surefire-plugin surefire