VCR and the webdrivers gem

Posted . Visible to the public.

If you're using the webdrivers Show archive.org snapshot gem and VCR together, depending on your configuration, VCR will yell at you regulary.
The webdrivers gem tries to update your webdrivers on your local machine. To do so, it checks the internet for newer versions, firing an HTTP-request to e.g. https://chromedriver.storage.googleapis.com

You can "fix" this in multiple ways:

  1. Update your drivers on your machine with
    RAILS_ENV=test rake webdrivers:chromedriver:update

  2. Ignore the driver update-URL in your VCR configuration

# e.g. for the chromedriver
VCR.configure do |config|
  config.ignore_hosts 'chromedriver.storage.googleapis.com'
end
  1. Pin the version Show archive.org snapshot of your driver

To check if your suite is "affected" by this, you can reduce the webdriver update interval and see if VCR complains:

WD_CACHE_TIME=1 bundle exec cucumber

Note:
Newer Rails versions come with the webdrivers gem automatically.

Niklas Hä.
Last edit
Niklas Hä.
License
Source code in this card is licensed under the MIT License.
Posted by Niklas Hä. to makandra dev (2020-09-23 16:43)