我有使用Watir 5.0在RubyMine上执行的脚本。是的,他们是老而金。
我希望升级到更高版本的Watir。但是,我收到了错误。
以下是我的gem文件,我执行了bundle更新和bundle install。没问题。 gem list
显示watir为6.8.4
source 'https://rubygems.org'
gem 'watir'
gem 'watir-scroll'
gem 'cucumber'
gem 'rspec'
gem 'page-object'
gem 'require_all'
gem 'selenium-webdriver'
gem 'nokogiri'
gem 'webdriver-user-agent'
gem 'headless'
gem 'bundle'
gem 'appium_lib'
gem 'rake'
gem 'typhoeus'
gem 'test-unit'
gem 'syntax'
gem 'grid_struct'
gem 'childprocess'
gem 'power_assert'
gem 'pdf-reader'
当我执行我的脚本时,我收到以下错误:
uninitialized constant Cucumber::Ast (NameError)
C:/Program Files (x86)/JetBrains/RubyMine 8.0.3/rb/testing/patch/bdd/teamcity/cucumber/common.rb:218:in `scenario_outline?'
C:/Program Files (x86)/JetBrains/RubyMine 8.0.3/rb/testing/patch/bdd/teamcity/cucumber/common.rb:223:in `tc_before_feature_element'
C:/Program Files (x86)/JetBrains/RubyMine 8.0.3/rb/testing/patch/bdd/teamcity/cucumber/formatter_03103.rb:98:in `before_feature_element'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/formatter/ignore_missing_messages.rb:11:in `method_missing'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/formatter/legacy_api/adapter.rb:602:in `before'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/formatter/legacy_api/adapter.rb:414:in `switch_to_child'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/formatter/legacy_api/adapter.rb:336:in `switch_step_container'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/formatter/legacy_api/adapter.rb:369:in `print_step'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/formatter/legacy_api/adapter.rb:251:in `after_test_step'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/formatter/legacy_api/adapter.rb:107:in `after_test_step'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/formatter/legacy_api/adapter.rb:31:in `block in initialize'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/event_bus.rb:34:in `call'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/event_bus.rb:34:in `block in broadcast'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/event_bus.rb:34:in `each'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/event_bus.rb:34:in `broadcast'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/event_bus.rb:40:in `method_missing'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/runner.rb:35:in `around_hook'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/around_hook.rb:12:in `describe_to'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:120:in `block (2 levels) in compose_around_hooks'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:121:in `call'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:121:in `compose_around_hooks'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:26:in `block in describe_to'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/runner.rb:19:in `call'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/runner.rb:19:in `test_case'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/filters/prepare_world.rb:12:in `test_case'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:57:in `test_case'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/filters/retry.rb:18:in `test_case'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/filters/quit.rb:12:in `test_case'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/filters/broadcast_test_run_started_event.rb:20:in `block in done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/filters/broadcast_test_run_started_event.rb:19:in `map'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/filters/broadcast_test_run_started_event.rb:19:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/filters/locations_filter.rb:20:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/filter.rb:62:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/test/filters/tag_filter.rb:18:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/compiler.rb:24:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core/gherkin/parser.rb:37:in `done'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core.rb:32:in `parse'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-core-3.0.0/lib/cucumber/core.rb:21:in `compile'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/runtime.rb:74:in `run!'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/lib/cucumber/cli/main.rb:33:in `execute!'
D:/-/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-3.0.1/bin/cucumber:9:in `<top (required)>'
D:/-/Ruby22/bin/cucumber:23:in `load'
D:/-/Ruby22/bin/cucumber:23:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
Process finished with exit code 2
我想知道有人遇到过这个问题吗?请帮助,thx。
答案 0 :(得分:3)
降级到黄瓜2.99.0对我有用。现在我可以从Rubymine运行测试了。我仍然没有想出如何为3.0.1修复它。