thoughtbot/capybara-webkit

Is the Configuration Section in the README up-to-date?

jtrupiano opened this issue · 9 comments

Immediately after requiring capybara/webkit I have a block of code exactly as in the README.
I get the following NoMethoderror. Is the README correct?

require 'capybara/webkit'

Capybara::Webkit.configure do |config|
  config.block_unknown_urls
  config.timeout = 10
  config.ignore_ssl_errors
  config.skip_image_loading
  config.raise_javascript_errors = false
end
>> undefined method `configure' for Capybara::Webkit:Module (NoMethodError)

I'm on Ruby 2.4.1, capybara 2.15.4, capybara-webkit 1.1.0.

Thanks.

It’s correct for v1.14.0 - unfortunately 1.14 isn’t marked as compatible with the latest capybara so you’re getting a really old capybara-WebKit. Tell your gemfile to use the latest capybara-webkit (and a slightly old capybara)

That is helpful, @twalpole, thanks. We seem to be in a bit of purgatory with this versioning....is there a writeup I can review to better understand where we currently are and what the roadmap looks like?

@jtrupiano Not that I know of -- it appears capybara-webkit isn't really being worked on currently - There are a few open PRs that would bring it full compatibility with Capybara 2.14.x but they haven't been looked at/merged for quite some time. At this point it would be best if the maintainers just opened up the compatibility to 2.x (imho)

Is there a different stack you'd recommend? I had been using poltergeist, but I also ran into a variety of upgrade issues there. That's what led me to poke around again here with capybara-webkit.

@jtrupiano You'll get the most up to date compatibility with web technologies using Chrome with selenium, which can be run in headless mode. It will be slower though.

I appreciate the advice, thanks. Is that a stack I can run on both Ubuntu and OSX?

@jtrupiano Yes -- you'll need the selenium-webdriver gem in your project and chromedriver in your PATH. Then you can specify Capybara.javascript_driver = :selenium_chrome when using the latest Capybara (or :selenium_chrome_headless if that's what you want), or register your own driver configuration. Note you won't have the poltergeist/capybara-webkit extensions (blacklist/whitelist, etc)

@twalpole, thanks a lot. Where's a good place to get q's about the selenium-webdriver setup in ruby answered? These projects used to have google groups and forums and such, I'm not sure what the kids are using these days. Maybe an IRC channel?

@jtrupiano Recently, with the changes that have been going on in selenium, I’ve found it easiest to just read the selenium source.