【发布时间】:2018-08-28 11:00:36
【问题描述】:
我有使用 cucumber 和 wdio 运行的硒测试。 我的 wdio.conf.js 文件如下所示:
cucumberOpts: {
tagExpression: 'not @ignore',
},
我有已标记的测试
@cats
Scenario: As a user I want to google cats
Given I have google open
When I type in 'cats'
And then I see pictures of cats
@dogs
Scenario: As a user I want to google dogs
Given I have google open
When I type in 'dogs'
And then I see pictures of dogs
@dogs @ignore
Scenario: As a user I want to google fierce dogs
Given I have google open
When I type in 'fierce dogs'
And then I see pictures of fierce dogs
如果我想运行所有未被忽略的狗测试,我可以运行:
./node_modules/.bin/wdio wdio.conf.js --cucumberOpts.tagExpression='@dogs and not @ignore'
我想做的就是跑
./node_modules/.bin/wdio wdio.conf.js --cucumberOpts.tagExpression='@dogs'
(或类似的)从命令行并让它从 wdio.conf.js 文件中获取“not @ignore”。
可以这样做吗?
【问题讨论】:
标签: cucumber webdriver-io