【cucumber】CucumberOptions详解

@CucumberOptions注解:相当于Cucumber的初始化配置

Maven依赖包

 <!-- 用户验收测试框架  io.cucumber.junit.CucumberOptions -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>7.8.1</version>
        </dependency>

Cucumber提供了以下主要选项:

Options Type

(选项类型)

Purpose(用途)

Default Value(默认值)

dryRun

true:检查所有步骤是否都有步骤(Step Definition)定义

false

plugin添加插件,可以添加cucumber内置或者第三方插件,比如测试报告插件{}

features(剧本)

set:feature文件的路径

{}

glue

set:步骤定义(Step Definition)文件的路径

{}

tags

instruct(指示): 指定应该执行features文件中的哪些标签

{}

monochrome

True:以可读的方式显示控制台输出

false

format

set:What all report formaters to use

false

strict

true:如果存在未定义或挂起的步骤,则执行将失败。

false

sampl

@CucumberOptions(
     //publish = true,
     //plugin = {"com.cucumber.listener.ExtentCumberFormatter:extent-report/report.html"}, //格式化插件
     //plugin ={"pretty", "html:target/html-report.html", "json:target/json-report/run.json","junit:target/cucumber-reports/cucumber.xml"},
     plugin ={"pretty","json:target/json-report/run.json"}, // 生成的json文件
     //features = {"src\\test\\resources" },      //feature路,
     features = {"classpath:features" },        //features路路径,
     glue = "com.cacho.s2b.lesson",             //步骤所在的包名
     monochrome = true,                        //
     tags = "@test"                            //指定标签,多标签:"标签1 or/and/and not 标签2"
)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值