这是我的酷跑者。我试图通过重写 dataprovider 方法来使用 cucumber-jvm 4.0.0 中内置的并行性。我看到我的场景是并行调用的,但线程数始终默认为 10。我尝试使用 --threads 选项作为状态执行GitHub https://github.com/cucumber/cucumber-jvm/blob/v4.0.0/core/src/main/resources/cucumber/api/cli/USAGE.txt但它不起作用。
mvn test -Dcucumber.options="--tags @test --threads 3"
mvn test -Dcucumber.options="--threads 3"
两种方法都尝试过,但默认情况下仍然生成 10 个线程。我在这里缺少什么?我知道还有其他方法可以使用 temyers 插件或 qaf 第三方插件在 cukes 中实现并行性。但我的问题非常具体于本机并行支持黄瓜-jvm 4.0.0 https://github.com/cucumber/cucumber-jvm/tree/v4.0.0/testng我的 CLI 黄瓜选项中缺少什么?
package cuke.runner;
import org.testng.annotations.DataProvider;
import cucumber.api.CucumberOptions;
import cucumber.api.testng.AbstractTestNGCucumberTests;
@CucumberOptions(features= {"src/test/resources/features"},glue="com/sd")
public class TestRunner extends AbstractTestNGCucumberTests{
@Override
@DataProvider(parallel=true)
public Object[][] scenarios() {
return super.scenarios();
}
}
并行模式下 dataprovider 的默认线程数为 10。要更改此设置,需要将 dataproviderthreadcount 属性添加到 POM 中 Surefire 或 Failsafe 插件的配置部分。
<configuration>
<properties>
<property>
<name>dataproviderthreadcount</name>
<value>20</value>
</property>
</properties>
</configuration>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)