diff options
author | Stan Hu <stanhu@gmail.com> | 2017-06-17 08:07:14 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-06-17 08:07:14 +0300 |
commit | ddbb88010e05f6295dd6e46724d585494c8cc84a (patch) | |
tree | afff3cfb97d959827246252b95e6bd1ffbd9bacb /features | |
parent | ad521bde1bb556709edd39d8a9aa67ee47605b91 (diff) |
Replace PhantomJS with headless Chrome for Rspec tests
Closes #30876
Diffstat (limited to 'features')
-rw-r--r-- | features/support/capybara.rb | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/features/support/capybara.rb b/features/support/capybara.rb index f4691647d4b..1d1626a064b 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -1,22 +1,18 @@ -require 'capybara/poltergeist' require 'capybara-screenshot/spinach' # Give CI some extra time timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 60 : 30 -Capybara.javascript_driver = :poltergeist -Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new( - app, - js_errors: true, - timeout: timeout, - window_size: [1366, 768], - url_whitelist: %w[localhost 127.0.0.1], - url_blacklist: %w[.mp4 .png .gif .avi .bmp .jpg .jpeg], - phantomjs_options: [ - '--load-images=yes' - ] +Capybara.javascript_driver = :chrome +Capybara.register_driver :chrome do |app| + capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( + 'chromeOptions' => { + 'args' => %w[headless no-sandbox disable-gpu] + } ) + + Capybara::Selenium::Driver + .new(app, browser: :chrome, desired_capabilities: capabilities) end Capybara.default_max_wait_time = timeout |