watir-scroll
Scrolling API for Watir.
Installation
Add this line to your application's Gemfile:
gem 'watir-scroll'
And then execute:
$ bundle
Or install it yourself as:
$ gem install watir-scroll
Usage
Scrolling on Browser Window Level
browser.scroll.to :top
browser.scroll.to :center
browser.scroll.to :bottom
browser.scroll.to [10, 10]
browser.scroll.by 10, 10
browser.scroll.by -10, -10
You can also chain the calls:
browser.scroll.to(:top).by(0, 100)
Scrolling To Elements
button = browser.button(text: 'Click')
button.scroll.to
button.scroll.to :center
button.scroll.to :bottom
button.scroll.by 10, 10
button.scroll.by -10, -10
You can also chain the calls:
button.scroll.to.by(0, 100)
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request