-
Notifications
You must be signed in to change notification settings - Fork 110
Heroku buildpack google chrome
Nicolas Maloeuvre edited this page Jul 29, 2019
·
16 revisions
heroku-buildpack-google-chrome
users need to use either of these options to help webdrivers
find the custom install path to Google Chrome on Heroku. This is required so the gem can download the appropriate version of chromedriver
.
Option 1: Set the WD_CHROME_PATH
environment variable to whatever $GOOGLE_CHROME_SHIM
points to.
$ echo $GOOGLE_CHROME_SHIM
=> /app/.apt/usr/bin/google-chrome-stable
$ RAILS_ENV=test bundle exec rake webdrivers:chromedriver:update WD_CHROME_PATH=/app/.apt/usr/bin/google-chrome-stable
Or if you use Heroku CI with app.json :
"environments": {
"test": {
"env": {
"WD_CHROME_PATH": "/app/.apt/usr/bin/google-chrome-stable"
}
Option 2: Set Selenium::WebDriver::Chrome.path
(in your code) to whatever $GOOGLE_CHROME_SHIM
points to.
require 'webdrivers'
Selenium::WebDriver::Chrome.path = ENV.fetch('GOOGLE_CHROME_SHIM', nil)
driver = Selenium::WebDriver.for :chrome
Source
https://github.com/titusfortner/webdrivers/issues/72
https://github.com/heroku/heroku-buildpack-google-chrome#selenium