I have a cucumber test suite which fails to run since I have moved to a new computer.
The test suite uses Capybara (v1.1.2)
, Chrome Driver (v26.0.1383.0)
and Selenium-Webdriver (v2.27.1)
to run JavaScript tests in Chrome.
Every test hangs with Chrome's blue "aw snap" of death. If I kill the current test run with CTRL-C
the next test runs and also fails.
I am at a complete loss. This exact same test suite runs fine on Circle CI and on a colleagues Mac.
I have also tried swapping out Chrome Driver for other Capybara drivers Phantom JS and Capybara Webkit.
Phantom JS is a bit of a wipe out :(
Capybara Webkit gets a lot further but still fails many tests with: Broken pipe (Errno::EPIPE)
I think there is something fundamentally wrong with Webkit on my machine.
I'm running Mac OS X 10.8.
Any ideas at all?
UPDATE
features/support/env.rb
require 'cucumber/rails'
Capybara.default_selector = :css
ActionController::Base.allow_rescue = false
begin
require 'database_cleaner'
require 'database_cleaner/cucumber'
DatabaseCleaner.orm = 'mongoid'
DatabaseCleaner.strategy = :truncation
rescue NameError
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end
Cucumber::Rails::Database.javascript_strategy = :truncation
require 'minitest/spec'
World(MiniTest::Assertions)
MiniTest::Spec.new(nil)
features/support/chrome.rb
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
Capybara.javascript_driver = :chrome
Gemfile
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.11'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'bootstrap-sass'
gem 'font-awesome-rails'
gem 'uglifier', '>= 1.0.3'
gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
end
group :test, :development do
gem 'factory_girl_rails'
gem 'minitest-rails'
gem 'minitest-rails-capybara' # provides integration_test generator
gem 'capybara_minitest_spec' # provides RSpec-like matchers
gem 'capybara-screenshot'
gem 'debugger' # please only enable debugger when needed
gem 'quiet_assets'
gem 'jasmine-rails'
end
group :test do
gem 'minitest-matchers'
gem 'shoulda-matchers'
gem 'cucumber-rails', :require => false
gem 'capybara'
gem 'capybara-email'
gem 'database_cleaner'
gem 'factory_girl_rails'
gem 'launchy' # for save and open page
gem 'timecop'
gem 'mocha', :require => false
gem 'vcr'
gem 'webmock'
end
group :staging, :qa do
gem 'database_cleaner'
gem 'factory_girl_rails'
end
gem 'jquery-rails'
gem 'thin'
gem 'ey_config'
gem 'memcachier'
gem 'dalli'
gem 'mongoid'
gem 'mongoid-history', github: 'stengland/mongoid-history'
gem 'bson_ext'
gem 'devise'
gem 'devise_invitable'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
gem 'switch_user'
gem 'cancan'
gem 'simple_form', '~> 2.0'
gem 'dragonfly', '~> 0.9.12'
gem 'mongoid-grid_fs'
gem 'momentjs-rails', github: 'tkrotoff/momentjs-rails'
gem 'tabulous'
gem 'cocoon'
gem 'backbone-on-rails'
gem 'mustache'
gem 'gon'
gem 'activemerchant'
gem 'state_machine'
gem 'ruby-graphviz', :require => 'graphviz'
gem 'twilio-ruby'
gem 'twitter'
gem 'prawn'
gem "bootstrap-wysihtml5-rails", "~> 0.3.1.14"
gem 'country_select'