Issue Snapshot尝试实施黄瓜进行一些自动化测试。当我尝试执行我的功能文件(myfeature.feature)时,我收到以下错误
错误:无法找到或加载主类cucumber.api.cli.Main
项目路径
src
-cucumber(package)
-CucumberRunner.java
-cucumber.feature(package)
-myfeature.feature
课程代码:
package cucumber;
import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;
import cucumber.junit.Cucumber.Options;
@RunWith(Cucumber.class)
@Options (
format = {"pretty", "json:target/"},
features = {"src/cucumber/"}
)
public class CucumberRunner {
}
答案 0 :(得分:0)
我也遇到了同样的问题,您应该在pom.xml中添加黄瓜java依赖项,以下是依赖项并构建项目
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>5.7.0</version>
</dependency>