Add Me!Close Menu Navigation

Its not a bug, its a feature

Add Me!Open Categories Menu

Enabling Poltergeist inspector while using capybara accessible + cucumber rails

I know this is a very specific toolset to be using and doesn’t affect many people, however it took me some time to get it working so it seems that it may be worth documenting. If you are working on a project that uses rails + cucumber + capybara accessible + poltergeist for automated in browser tests and want the ability to use the poltergeist remote debugging feature┬áthen you are in luck. Add the following to your features/support/env.rb

Capybara.register_driver :poltergeist_debug do |app|
  driver = Capybara::Poltergeist::Driver.new(app, inspector: true)
  adaptor = Capybara::Accessible::SeleniumDriverAdapter.new
  Capybara::Accessible.setup(driver, adaptor)
end

Next update your Capabara default_driver and javascript_driver to use your newly registered driver:

Capybara.default_driver    = :poltergeist_debug
Capybara.javascript_driver = :poltergeist_debug

Once the above code is inserted you can then follow the instructions on the poltergeist wiki on how to attach to the remote debugger.

Posted By Robert

Leave a Reply