List of Projects OSRA - Support system Technical discussions headless capybara drive justification

headless capybara drive justification

Updated about 5 years ago by Craig Ferry

Headless capybara driver justification


We require a headless capybara driver to test javascript (currently delete links through active admin)


Our main options are

  • capybara-webkit

  • poltergeist


Both have dependencies that need to be met, but I think the webkit dependencies are more demanding.

Website on have settled on poltergeist. I have asked the channel and they seem happy with their decision.


Caveat


I haven’t researched this exhaustively. These are my initial first impressions. If you feel there is misinformation in here or I have got things plain wrong, please let me know.


Capybara Webkit


https://github.com/thoughtbot/capybara-webkit


This requires a whole raft of qt dependencies. Pretty frustating if you have to compile on a mac or are using stock ubuntu.


Advantages

  • You can interact with the javascript popup dialog.


Disadvantages

  • Dependency hell (qt and xvfb)

  • xvfb-run -a bundle exec cucumber is needed to run the cucumber tests (or apparently the addition of a ‘headless’ gem which I haven’t researched further)


Poltergeist (Phantomjs)


https://github.com/thoughtbot/capybara-webkit


Advantages

  • only gem and phantomjs dependencies

    • phantomjs dependency can be downloaded and installed manually or through nodejs (my preference)

Disadvantages

  • You cannot interact with the javascript popup dialog

    • Default accept of js popups - can only test the happy path

Revisions

comments powered by Disqus