六回:Cucumber 之 Commond Line

和很多命令行工具一样,可以通过’cucumber -hep'来查看命令行选项。这里我们只列举一些常用的选项。

(1). 支持的自然语言:

$ cucumber —il8n LANG  列举特殊语言的关键字。

$ cucumber --i18n help  列举所有语言。

例如:汉语:cucumber —il8n zh-CN。

输出格式:

$ cucumber -f FORMAT

$ cucumber --format FORMAT     

FORMAT (默认为pretty):          

                debug: For developing formatters - prints the calls made to the listeners.

                html: Generates a nice looking HTML report.

                json: Prints the feature as JSON

                json_pretty: Prints the feature as prettified JSON

                junit: Generates a report similar to Ant+JUnit.

                pretty: Prints the feature as is - in colours.

                progress: Prints one character per scenario.

                rerun: Prints failing files with line numbers.

                stepdefs:Prints All step definitions with their locations (steps are not printed).

                usage: Prints where step definitions are used.

例如:cucumber -f pretty:

(2). 将输出保存在文档里:

$ cucumber -o [FILE|DIR]  

$ cucumber --out [FILE|DIR] 

(3). 执行相关命令:

只执行用Tag标记的特殊features或scenarios

$ cucumber -t TAG_EXPRESSION

$ cucumber --tags TAG_EXPRESSION

例如:$ cucumber --tags @tag1

执行指定名称的feature elements:

$ cucumber -n NAME

$ cucumber --name NAME

不执行指定格式的features文件或ruby文件:

$ cucumber -e PATTERN

$ cucumber --exclude PATTERN

显示执行格式但不执行steps:

$ cucumber -d

$ cucumber --dry-run           

   

例如 :cucumber --dry-run  

跳过pending的step:

$ cucumber -i

$ cucumber --no-snippets 

$ cucumber -q

$ cucumber —quiet 

执行指定到行:

$ cucumber features/XXXXX.feature —line LINE_NUM

不在执行结束时打印所用的时间:

$ cucumber --no-duration

(4). 显示版本信息命令:

$ cucumber --version

(5). 生成Cucumber Project文件目录结构命令:

$ cucumber --init    初始化并生成常规的Cucumber Project文件目录结构

(6). 帮助命令:

$ cucumber -h

$ cucu —help

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值