目录
新建Junit Runner类
参考代码
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
monochrome = true,
plugin = {
"pretty",
"io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm"},
stepNotifications = true,
features = {"src/test/resources"},
tags = "@test",
glue = {
"com.app.automation.steps"
}
)
public class RunTest {}
关键参数
@RunWith注解:类文件添加该注解告诉Junit该文件是Test Runner文件,Junit会通过该文件来运行你的测试
@CucumberOptions注解:相当于Cucumber的初始化配置