从运行者类执行方案时,我得到空指针执行。当我从功能文件执行然后执行测试没有任何错误,我使用标签运行场景,我已经提到了跑步者类中的标签,请让我知道可能是什么原因。
亚军类代码:
@RunWith(Cucumber.class)
@CucumberOptions( features={"Features"} ,glue={"project.stepdef"} ,tags = {"@chrome","@smoke"} , format = {"pretty", "html:target/site/cucuber-pretty","json:target/site/cucumber.json"} // ,monochrome = true )
public class CucumberRunner
{
}
答案 0 :(得分:0)
您需要对runner
类进行一些小调整,如下所示:
import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
features="Features",
glue="stepdef",
tags = {"@chrome","@smoke"},
plugin = {"html:target/cucumber-html-report",
"pretty:target/cucumber-pretty.text",
"json:target/cucumber.json"},
)
public class CucumberRunner {}