Watir::Rails
This gem adds the Watir usage support when writing integration tests in Rails.
Installation
Add this code to your Gemfile:
group :test do
gem 'watir-rails'
end
Usage
Just use Watir like you've always done in your requests/integration tests:
browser = Watir::Browser.new
browser.goto home_path
browser.text_field(name: "first").set "Jarmo"
browser.text_field(name: "last").set "Pertman"
browser.(name: "sign_in").click
Limitations
Watir-Rails works currently only with the Watir-WebDriver and not with the Watir-Classic due to the problems of running a server in the separate thread when WIN32OLE is used. The problem is probably caused by the fact that WIN32OLE overwrites Thread#initialize.
When using Rails path/url helpers in your tests then always use path instead of url methods, because latter won't work!
License
See LICENSE.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request