Switch to capybara-webkit for Cucumber
This commit is contained in:
parent
bb50917a29
commit
28d903858e
|
@ -3,6 +3,7 @@ env:
|
||||||
- DB=sqlite
|
- DB=sqlite
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get install libicu-dev -y
|
- sudo apt-get install libicu-dev -y
|
||||||
|
- sudo apt-get install libqt4-dev libqtwebkit-dev -y
|
||||||
- gem install charlock_holmes -v="0.6.8"
|
- gem install charlock_holmes -v="0.6.8"
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -104,6 +104,7 @@ end
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem "rspec-rails"
|
gem "rspec-rails"
|
||||||
gem "capybara"
|
gem "capybara"
|
||||||
|
gem "capybara-webkit"
|
||||||
gem "autotest"
|
gem "autotest"
|
||||||
gem "autotest-rails"
|
gem "autotest-rails"
|
||||||
gem "pry"
|
gem "pry"
|
||||||
|
|
|
@ -118,6 +118,9 @@ GEM
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
selenium-webdriver (~> 2.0)
|
selenium-webdriver (~> 2.0)
|
||||||
xpath (~> 0.1.4)
|
xpath (~> 0.1.4)
|
||||||
|
capybara-webkit (0.12.1)
|
||||||
|
capybara (>= 1.0.0, < 1.2)
|
||||||
|
json
|
||||||
carrierwave (0.6.2)
|
carrierwave (0.6.2)
|
||||||
activemodel (>= 3.2.0)
|
activemodel (>= 3.2.0)
|
||||||
activesupport (>= 3.2.0)
|
activesupport (>= 3.2.0)
|
||||||
|
@ -379,6 +382,7 @@ DEPENDENCIES
|
||||||
awesome_print
|
awesome_print
|
||||||
bootstrap-sass (= 2.0.3.1)
|
bootstrap-sass (= 2.0.3.1)
|
||||||
capybara
|
capybara
|
||||||
|
capybara-webkit
|
||||||
carrierwave
|
carrierwave
|
||||||
charlock_holmes
|
charlock_holmes
|
||||||
chosen-rails
|
chosen-rails
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
||||||
# files.
|
# files.
|
||||||
|
|
||||||
require "selenium-webdriver"
|
|
||||||
require 'cucumber/rails'
|
require 'cucumber/rails'
|
||||||
require 'webmock/cucumber'
|
require 'webmock/cucumber'
|
||||||
WebMock.allow_net_connect!
|
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
|
# prefer to use XPath just remove this line and adjust any selectors in your
|
||||||
# steps to use the XPath syntax.
|
# steps to use the XPath syntax.
|
||||||
Capybara.default_selector = :css
|
Capybara.default_selector = :css
|
||||||
|
Capybara.javascript_driver = :webkit
|
||||||
|
|
||||||
# By default, any exception happening in your Rails application will bubble up
|
# 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
|
# 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.
|
# 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
|
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
|
||||||
Cucumber::Rails::Database.javascript_strategy = :truncation
|
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
|
|
||||||
|
|
Loading…
Reference in a new issue