有一个配置值rerunFailingTestsCount但我想运行一个测试方法可配置的次数,即使它是成功的。有什么选择吗?
最佳答案
我认为不可能配置 maven-surefire-plugin
来重新运行通过的测试。
但是,您可以使用 TestNG(而非 JUnit)配置单个测试的调用计数 @Test
注释:
@Test(invocationCount = 5)
public void testSomething() {
}
这将导致 testSomething
方法被测试 5 次。
不想走TestNG路线的可以引用this answer使用 JUnit 的解决方案。
关于java - 是否可以使用 Maven Surefire 插件多次运行相同的测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32876894/