CapybaraClickAt - click_at(point) capybara helper
Why do you need it?
- If you want to click at certain point on a map
- If you want to click at certain point on a canvas, colour select etc.
Tested versions and drivers
- Capybara: v2.18, v3.0, v3.5
- Drivers: Selenium, Webkit, Poltergeist
Installation
Add this line to your application's Gemfile:
group :test do
gem 'capybara-click_at'
end
And then execute:
$ bundle
Or install it yourself as:
$ gem install capybara-click_at
Rspec
In your spec_helper.rb
RSpec.configure do |config|
config.include CapybaraClickAt
end
Cucumber
In your env.rb
World CapybaraClickAt
Usage
Click at certain point on the page
click_at(5, 5)
Click at certain point inside a container specified by CSS or XPath selector
click_at(5, 5, css: '#map')
click_at(5, 5, xpath: '//div[@id="select-colour"]')
Contributing
- Add a test case which covers the bug
- Add code which makes the test green
- Open pull request
License
The gem is available as open source under the terms of the MIT License.