mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Add poltergeist as default driver for capybara
This commit is contained in:
@@ -159,6 +159,7 @@ group :test do
|
||||
gem 'capybara-select2', github: 'goodwill/capybara-select2'
|
||||
gem 'capybara-ng', '~> 0.2.1'
|
||||
gem 'selenium-webdriver', '~> 2.47.1'
|
||||
gem 'poltergeist'
|
||||
gem 'timecop', '~> 0.7.1'
|
||||
|
||||
gem 'rb-readline', '~> 0.5.1' # ruby on CI needs this
|
||||
|
||||
@@ -170,6 +170,7 @@ GEM
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
climate_control (0.0.3)
|
||||
activesupport (>= 3.0)
|
||||
cliver (0.3.2)
|
||||
cocaine (0.5.7)
|
||||
climate_control (>= 0.0.3, < 1.0)
|
||||
codecov (0.0.8)
|
||||
@@ -324,6 +325,11 @@ GEM
|
||||
parser (2.2.2.5)
|
||||
ast (>= 1.1, < 3.0)
|
||||
pg (0.18.3)
|
||||
poltergeist (1.7.0)
|
||||
capybara (~> 2.1)
|
||||
cliver (~> 0.3.1)
|
||||
multi_json (~> 1.0)
|
||||
websocket-driver (>= 0.2.0)
|
||||
powerpack (0.1.1)
|
||||
protected_attributes (1.0.9)
|
||||
activemodel (>= 4.0.1, < 5.0)
|
||||
@@ -512,6 +518,9 @@ GEM
|
||||
warden-basic_auth (0.2.1)
|
||||
warden (~> 1.2)
|
||||
websocket (1.2.2)
|
||||
websocket-driver (0.6.2)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.2)
|
||||
will_paginate (3.0.7)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
@@ -572,6 +581,7 @@ DEPENDENCIES
|
||||
openproject-translations!
|
||||
parallel_tests
|
||||
pg (~> 0.18.3)
|
||||
poltergeist
|
||||
protected_attributes
|
||||
prototype-rails!
|
||||
prototype_legacy_helper (= 0.0.0)!
|
||||
|
||||
@@ -44,17 +44,6 @@ require 'capybara/rails'
|
||||
require 'capybara-screenshot/rspec'
|
||||
require 'factory_girl_rails'
|
||||
|
||||
Capybara.register_driver :selenium do |app|
|
||||
require 'selenium/webdriver'
|
||||
Selenium::WebDriver::Firefox::Binary.path = ENV['FIREFOX_BINARY_PATH'] ||
|
||||
Selenium::WebDriver::Firefox::Binary.path
|
||||
|
||||
profile = Selenium::WebDriver::Firefox::Profile.new
|
||||
profile['intl.accept_languages'] = 'en'
|
||||
|
||||
Capybara::Selenium::Driver.new(app, browser: :firefox, profile: profile)
|
||||
end
|
||||
|
||||
# Requires supporting ruby files with custom matchers and macros, etc,
|
||||
# in spec/support/ and its subdirectories.
|
||||
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
require 'capybara/poltergeist'
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
|
||||
Capybara.register_driver :poltergeist do |app|
|
||||
Capybara::Poltergeist::Driver.new(app, { js_errors: false })
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
Capybara.register_driver :selenium do |app|
|
||||
require 'selenium/webdriver'
|
||||
|
||||
Selenium::WebDriver::Firefox::Binary.path = ENV['FIREFOX_BINARY_PATH'] ||
|
||||
Selenium::WebDriver::Firefox::Binary.path
|
||||
|
||||
Capybara::Selenium::Driver.new(app, browser: :firefox)
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.around(:each, selenium: true) do |example|
|
||||
Capybara.javascript_driver = :selenium
|
||||
Capybara.default_wait_time = 5
|
||||
|
||||
example.run
|
||||
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
Capybara.default_wait_time = 2
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user