1

我正在尝试在 rails 3 环境中运行几个黄瓜文件。以下是相关文件的列表。

宝石文件:-

group :test do
  # Pretty printed test output
  gem 'turn', '< 0.8.3'
  gem 'capybara'#,'1.1.2'
  gem 'launchy','2.0.5'
  gem 'cucumber-rails','1.2.1'
  gem 'cucumber','1.1.4'
  gem 'rspec-rails','2.8.1'
  gem 'rspec-cells','0.1.2'
  gem 'email_spec' 
  gem 'machinist', '>= 2.0.0.beta2'
  gem "factory_girl_rails"
  gem "guard-rspec"
  gem "minitest"
  gem 'headless'
  gem 'minitest-rails'
  gem 'minitest-rails-capybara'
  # gem 'minitest-rails',:git => "git://github.com/rawongithub/minitest-rails.git"  
  # gem 'capybara_minitest_spec'
  gem 'rails_sql_views', :git => 'https://github.com/mremolt/rails_sql_views.git'
 end

环境.rb

require 'fakeweb' 
require 'simplecov'
SimpleCov.start 'rails'
require 'cucumber/rails'
require 'email_spec' # add this line if you use spork
require 'email_spec/cucumber'

Capybara.default_selector = :css
ActionController::Base.allow_rescue = false

begin
  DatabaseCleaner.strategy = :transaction
rescue NameError
  raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end

  Before do
     DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
     DatabaseCleaner.clean
     DatabaseCleaner.start
  end

   After do
     DatabaseCleaner.strategy = :transaction
     DatabaseCleaner.clean
   end


After('@javascript, @selenium') do
   wait_until { page.has_content? '' }
end    


end

当我跑步时rake ruby -S bundle exec cucumber -p default --require features features/running_files/login.feature:27

我得到这个错误

 And I fill in "user[email]" with "admin@newadmin.com"               # features/step_definitions/web_steps.rb:109
      Object.keys is not a function (Selenium::WebDriver::Error::UnknownError)
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/driver_component.js:8169:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/driver_component.js:388:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/driver_component.js:390:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/driver_component.js:8205:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/driver_component.js:388:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/driver_component.js:390:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/driver_component.js:8206:in `injectAndExecuteScript'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/driver_component.js:8211:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/command_processor.js:263:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/command_processor.js:10222:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/command_processor.js:10227:in `unknown'
      [remote server] file:///tmp/webdriver-profile20121220-28325-14ft8a7/extensions/fxdriver@googlecode.com/components/command_processor.js:10167:in `unknown'
      ./features/step_definitions/web_steps.rb:110:in `/^I fill in "([^"]*)" with "([^"]*)"$/'

我仍然无法弄清楚是什么原因。而且我还没有做任何重大改变。

4

0 回答 0