Adding Poltergeist to a Capybara suite
In this recipe we introduce Poltergeist, the PhantomJS driver for Capybara tests. We will illustrate a simple end-to-end test using Capybara and explain how to run such tests in PhantomJS using Poltergeist.
Getting ready
To run this recipe, we will need a recent version of Ruby installed and on our PATH
.
Note
Ruby is a dynamic programming language that is both popular and expressive. We use it here for these reasons. Capybara requires version 1.9.3 or greater, but version 2.1.0 or greater is advised. See the Ruby website for information about how to obtain and install the runtime at https://www.ruby-lang.org/.
We will need the RubyGems package management framework for Ruby installed and on our PATH
.
Note
We can find information about downloading and installing RubyGems at http://rubygems.org/pages/download.
We will need Capybara installed.
Tip
Capybara is a Ruby library for simulating user interactions and automating browsers. It is too large a topic to go into...