How to run your feature specs using Capybara and Headless Chrome
- Make sure you have one of the following Chrome versions:
- 57+ on Linux
- 59+ on macOS
- 60+ on Windows
Add (or update) the gem <code>selenium-webdriver</code>;
Make sure you're using ChromeDriver version 2.30 or higher.
You can install it by running:
brew install chromedriveron macOS;
apt-get install chromium-chromedriveron Debian/Ubuntu Linux.
- Add the following
Or, if you need to use some custom options:
Done, enjoy headless Chrome! ᕕ( ᐛ )ᕗ
You might get a warning like the following:
WARN Selenium [DEPRECATION] :args or :switches is deprecated. Use Selenium::WebDriver::Chrome::Options#add_argument instead.
Make sure you don't have another registered driver, I made this mistake myself and had an
iphone driver, which was passing
args in the old way and turned out to be the reason why I was getting the warning.