use travis container mode

This commit is contained in:
Thomas Walpole 2015-07-21 17:43:11 -07:00
parent 63e47806d7
commit dfd985fdf2
4 changed files with 16 additions and 11 deletions

View File

@ -1,11 +1,12 @@
language: ruby
sudo: false
rvm:
- 1.9.3
- 2.0.0
- 2.1
- 2.2
- jruby-19mode
- jruby-9.0.0.0
- jruby-9.0.3.0
- rbx-2
gemfile:
- Gemfile
@ -20,23 +21,25 @@ matrix:
env: CAPYBARA_CHROME=true
allow_failures:
- gemfile: gemfiles/Gemfile.beta-versions
- rvm: jruby-9.0.0.0
- rvm: jruby-9.0.3.0
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- awesome
before_install:
- if [ $CAPYBARA_CHROME ]; then
CHROMEDRIVER_VERSION=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE);
CHROMEDRIVER_URL="http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip";
FILE=`mktemp`; wget "$CHROMEDRIVER_URL" -qO $FILE && sudo unzip $FILE chromedriver -d /usr/local/bin; rm $FILE; sudo chmod 777 /usr/local/bin/chromedriver;
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -;
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list';
sudo apt-get update;
sudo apt-get install google-chrome-stable --force-yes;
FILE=`mktemp`; wget "$CHROMEDRIVER_URL" -qO $FILE && unzip $FILE chromedriver -d ~; rm $FILE; chmod 777 ~/chromedriver;
fi
- sudo chmod 1777 /dev/shm
- sudo apt-get install awesome -y
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

View File

@ -17,7 +17,7 @@ Capybara::SpecHelper.spec '#accept_confirm', :requires => [:modals] do
expect(message).to eq('Confirm opened')
end
it "should work with nested modals", focus: true do
it "should work with nested modals" do
expect {
@session.dismiss_confirm 'Are you really sure?' do
@session.accept_confirm 'Are you sure?' do

View File

@ -1,6 +1,8 @@
require 'spec_helper'
require 'selenium-webdriver'
Selenium::WebDriver::Chrome.driver_path = '/home/travis/chromedriver' if ENV['TRAVIS']
Capybara.register_driver :selenium_chrome do |app|
args = ENV['TRAVIS'] ? ['no-sandbox' ] : []
Capybara::Selenium::Driver.new(app, :browser => :chrome, :args => args)

View File

@ -33,7 +33,7 @@ RSpec.describe Capybara::Server do
ensure
Capybara.server_host = nil
end
end
end unless ENV['TRAVIS'] and (RUBY_ENGINE == 'jruby') #TODO travis with jruby in container mode has an issue with this test
it "should use specified port" do
Capybara.server_port = 22789