Simulating precise mouse clicks with Poltergeist
This recipe shows how to simulate precise mouse clicks from within a Capybara-backed test using Poltergeist.
Getting ready
To run this recipe, we will need the following items installed and available on the system:
Ruby 1.9.3 or greater, and the RubyGems package management framework
Capybara
Poltergeist
A suite of functional tests or browser automation scripts set to run in Capybara
Note
Details on how to locate and install the above software are discussed in the Adding Poltergeist to a Capybara suite recipe earlier in this chapter.
The script we will use in this chapter is available in the downloadable code repository as recipe05.rb
under chapter05
. If we run the provided example, we must change to the root directory for the book's sample code.
Lastly, the functional test in this recipe runs against the demo site that is included with the cookbook's sample code repository. To run that demo site, we must have Node.js installed. In a separate terminal...