Commit 28d90385 authored by randx's avatar randx

Switch to capybara-webkit for Cucumber

parent bb50917a
......@@ -3,6 +3,7 @@ env:
- DB=sqlite
before_install:
- sudo apt-get install libicu-dev -y
- sudo apt-get install libqt4-dev libqtwebkit-dev -y
- gem install charlock_holmes -v="0.6.8"
branches:
only:
......
......@@ -104,6 +104,7 @@ end
group :development, :test do
gem "rspec-rails"
gem "capybara"
gem "capybara-webkit"
gem "autotest"
gem "autotest-rails"
gem "pry"
......
......@@ -118,6 +118,9 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
capybara-webkit (0.12.1)
capybara (>= 1.0.0, < 1.2)
json
carrierwave (0.6.2)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
......@@ -379,6 +382,7 @@ DEPENDENCIES
awesome_print
bootstrap-sass (= 2.0.3.1)
capybara
capybara-webkit
carrierwave
charlock_holmes
chosen-rails
......
......@@ -4,7 +4,6 @@
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require "selenium-webdriver"
require 'cucumber/rails'
require 'webmock/cucumber'
WebMock.allow_net_connect!
......@@ -19,6 +18,7 @@ require Rails.root.join 'spec/support/valid_commit'
# prefer to use XPath just remove this line and adjust any selectors in your
# steps to use the XPath syntax.
Capybara.default_selector = :css
Capybara.javascript_driver = :webkit
# By default, any exception happening in your Rails application will bubble up
# to Cucumber so that your scenario will fail. This is a different from how
......@@ -64,12 +64,3 @@ end
# The :transaction strategy is faster, but might give you threading problems.
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
Cucumber::Rails::Database.javascript_strategy = :truncation
# We need this to fix the random timeout error that we were seeing in CI.
Capybara.register_driver :selenium_with_long_timeout do |app|
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120
Capybara::Selenium::Driver.new(app, :browser => :firefox, :http_client => client)
end
Capybara.javascript_driver = :selenium_with_long_timeout
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment