运行多个脚本的Cucumber Ruby使用Tags选项不起作用

时间:2016-02-23 16:47:27

标签: ruby rubygems cucumber bdd

我正在尝试使用标签选项在Cucumber Ruby中运行多个脚本,并且它会抛出错误

以下是黄瓜脚本

@excel @chrome @sprint1
Feature: RegistertoGmail2
Scenario:RegistertoGmail2

从cmd命令运行

cucumber --tags @sprint1

错误消息

C:\Ruby22\Project\Play>cucumber --tags @sprint1
DEPRECATED: #default_wait_time= is deprecated, please use       #default_max_wait_time= instead
invalid option: --tags (OptionParser::InvalidOption)
C:/Ruby22/Project/Play/features/cuke-steps.rb:23:in `<top (required)>'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-     2.1.0/lib/cucumber/rb_support/rb_language.rb:99:in `load'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-  2.1.0/lib/cucumber/rb_support/rb_language.rb:99:in `load_code_file'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:232:in `load_file'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:99:in `block in load_files!'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:98:in `each'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-  2.1.0/lib/cucumber/runtime/support_code.rb:98:in `load_files!'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime.rb:262:in `load_step_definitions'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime.rb:65:in `run!'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/cli/main.rb:32:in `execute!'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/bin/cucumber:8:in `<top    (required)>'
C:/Ruby22/bin/cucumber:23:in `load'
C:/Ruby22/bin/cucumber:23:in `<main>'

我按照建议尝试的选项是

C:\Ruby22\Project\Play>cucumber features -t @sprint1
DEPRECATED: #default_wait_time= is deprecated, please use   #default_max_wait_time= instead
invalid option: -t (OptionParser::InvalidOption)
C:/Ruby22/Project/Play/features/cuke-steps.rb:23:in `<top (required)>'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-  2.1.0/lib/cucumber/rb_support/rb_language.rb:99:in `load'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/rb_support/rb_language.rb:99:in `load_code_file'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:232:in `load_file'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:99:in `block in load_files!'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:98:in `each'

C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:98:in load_files!' C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime.rb:262:in load_step_definitions&#39;     C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/lib/cucumber/runtime.rb:65:in run!' C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber- 2.1.0/lib/cucumber/cli/main.rb:32:in执行!&#39;     C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-2.1.0/bin/cucumber:8:in <top (required)>' C:/Ruby22/bin/cucumber:23:in load&#39;     C:/ Ruby22 / bin / cucumber:23:在`&#39;

请提出建议

2 个答案:

答案 0 :(得分:0)

请尝试

cucumber features -t @sprint1

或更新到最新的Cucumber版本并尝试

答案 1 :(得分:0)

也许尝试更新到最新的Cucumber版本并再试一次,如果失败,可以试试这个命令:

cucumber -r features --tags @sprint1