Skip to content

Commit 56bc91d

Browse files
committed
Install chrome driver for current chrome version
1 parent e86b3a4 commit 56bc91d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ language: ruby
33
sudo: required
44
addons:
55
chrome: stable
6-
apt:
7-
packages:
8-
- dpkg
9-
- chromium-chromedriver
106

117
# We deviate from the rspec-dev cache setting here.
128
#
@@ -29,14 +25,14 @@ cache: bundler
2925
bundler_args: "--binstubs --path ../bundle --retry=3 --jobs=3"
3026

3127
before_install:
28+
- script/install_chrome_driver
3229
- script/update_rubygems_and_install_bundler
3330
- script/clone_all_rspec_repos
3431

3532
before_script:
3633
# Rails 4+ complains with a bundler rails binstub in PROJECT_ROOT/bin/
3734
- rm -f bin/rails
3835
- bundle exec rails --version
39-
- ln -s /usr/lib/chromium-browser/chromedriver ~/bin/chromedriver
4036

4137
script: "script/run_build 2>&1"
4238

script/install_chrome_driver

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
CHROME_VERSION=$(google-chrome --version | grep -iE "[0-9.]{10,20}" | sed -E "s/.* ([0-9]+)\.[0-9]+\.[0-9]+\..*/\1/")
4+
echo $CHROME_VERSION
5+
6+
LATEST=$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION)
7+
echo $LATEST
8+
9+
curl "https://chromedriver.storage.googleapis.com/$LATEST/chromedriver_linux64.zip" > chromedriver_linux64.zip
10+
11+
unzip chromedriver_linux64.zip
12+
mv chromedriver ~/bin/chromedriver

0 commit comments

Comments
 (0)