我正在尝试使用Cucumber 4.0实现并行测试执行,但观察到问题。
根据黄瓜网站上的详细信息:https://cucumber.io/docs/guides/parallel-execution/#testng
我在pom.xml中包括以下依赖项:(除了testng等其他现有依赖项之外]
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-jvm</artifactId>
<version>4.4.0</version>
<type>pom</type>
</dependency>
我在运行文件中添加了以下代码:
@Override
@DataProvider(parallel = true)
public Object[][] scenarios() {
return super.scenarios();
}
我在上述代码中看到以下错误:
The method scenarios() of type Baserunner must override or implement a supertype method. (error on line 62)
The method scenarios() is undefined for the type AbstractTestNGCucumberTests (error on line 63)
如果我的实现看起来不正确,请告诉我!
我有同样的问题。实际上,根据https://www.javadoc.io/doc/info.cukes/cucumber-testng/1.2.5/cucumber/api/testng/AbstractTestNGCucumberTests.html在AbstractTestNGCucumberTests下不存在censing()方法。我不明白的是,为什么有这么多教程列出来作为在黄瓜testng中运行场景的方法?真的没有其他方法可以将黄瓜方案作为单独的测试运行吗?