Read more

VCR and the webdrivers gem

Niklas Hä.
September 23, 2020Software engineer at makandra GmbH

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

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

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.

Posted by Niklas Hä. to makandra dev (2020-09-23 18:43)