我是java黄瓜的新手。遇到此错误:
cucumber.runtime.CucumberException: Couldn't load plugin class: json-pretty
原因:java.lang.ClassNotFoundException:json-pretty
@RunWith(Cucumber.class)
@CucumberOptions(
plugin={"pretty", "html:target/cucumber-htmlreport", "json-pretty:target/cucmber-report.json"})
public class CucumberTest {
//codes
}
答案 0 :(得分:1)
好像你很近。
您需要按以下方式更改插件的定义:
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions( plugin={"pretty:target/cucumber-htmlreport.text", "json:target/cucmber-report.json"})
public class CucumberTest { //codes }