Commit e77b5190 authored by Brice Sanchez's avatar Brice Sanchez
Browse files

Switch to selenium with chrome headless

parent e619c714
language: ruby
sudo: false
addons:
apt:
packages:
- chromium-chromedriver
cache: bundler
bundler_args: --without development
before_script:
- "sh -e /etc/init.d/xvfb start"
- "bundle exec rake refinery:testing:dummy_app"
- export RETRY_COUNT=3
- export PATH=$PATH:/usr/lib/chromium-browser/
- bin/rake refinery:testing:dummy_app
script:
- "DISPLAY=:99.0 bundle exec rspec spec"
env:
......@@ -11,14 +17,8 @@ env:
- DB=mysql
notifications:
email: true
irc:
use_notice: true
skip_join: true
channels:
- "irc.freenode.org#refinerycms"
webhooks:
- https://webhooks.gitter.im/e/b5d48907cdc89864b874
rvm:
- 2.5
- 2.4
sudo: false
- 2.4
\ No newline at end of file
......@@ -2,7 +2,7 @@ source 'https://rubygems.org'
gemspec
git 'https://github.com/refinery/refinerycms', :branch => 'master' do
git 'https://github.com/refinery/refinerycms', branch: 'master' do
gem 'refinerycms'
group :development, :test do
......@@ -20,28 +20,26 @@ end
if !ENV['TRAVIS'] || ENV['DB'] == 'mysql'
group :mysql do
gem 'activerecord-jdbcmysql-adapter', '>= 1.3.0.rc1', :platform => :jruby
gem 'mysql2', :platform => :ruby
gem 'activerecord-jdbcmysql-adapter', '>= 1.3.0.rc1', platform: :jruby
gem 'mysql2', platform: :ruby
end
end
if !ENV['TRAVIS'] || ENV['DB'] == 'postgresql'
group :postgres, :postgresql do
gem 'activerecord-jdbcpostgresql-adapter', '>= 1.3.0.rc1', :platform => :jruby
gem 'pg', :platform => :ruby
gem 'activerecord-jdbcpostgresql-adapter', '>= 1.3.0.rc1', platform: :jruby
gem 'pg', platform: :ruby
end
end
group :test do
gem 'launchy'
gem 'pry'
gem 'poltergeist'
gem 'selenium-webdriver', require: false
end
# Refinery/rails should pull in the proper versions of these
group :assets do
gem 'sass-rails'
gem 'uglifier'
end
gem 'jquery-rails'
end
\ No newline at end of file
......@@ -16,9 +16,18 @@ RSpec.configure do |config|
config.run_all_when_everything_filtered = true
end
# set javascript driver for capybara
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
require "selenium/webdriver"
Capybara.register_driver :selenium_chrome_headless do |app|
browser_options = ::Selenium::WebDriver::Chrome::Options.new
browser_options.args << '--headless'
browser_options.args << '--no-sandbox'
browser_options.args << '--disable-gpu'
browser_options.args << '--window-size=1440,1080'
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
end
Capybara.javascript_driver = (ENV['CAPYBARA_DRIVER'] || :selenium_chrome_headless).to_sym
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories including factories.
......
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