Add support for Watir (http://github.com/watir/watir) in Rails.
Ruby Logos
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gemfiles Fix syntax errors. Really. Nov 2, 2013
lib/watir
spec
.gitignore Initial commit Aug 25, 2012
.travis.yml Update Ruby versions in Travis. Sep 24, 2016
.yardopts
CHANGES.md
Gemfile Add Coveralls. Sep 21, 2013
LICENSE Add yard documentation. Browser#goto accepts now https and about:blan… Jan 3, 2013
README.md Update README.md Aug 18, 2016
Rakefile Run specs before release. Sep 24, 2016
watir-rails.gemspec Add support for Watir 6.0 and prepare for a new release. Sep 24, 2016

README.md

Watir::Rails

Gem Version Build Status Coverage

This gem makes Watir work with 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.button(name: "sign_in").click

Ignore Rails Exceptions

By default, exceptions raised by Rails application will be re-raised in your tests making them to fail.

This feature is only enabled when config.action_dispatch.show_exceptions is set to false in your Rails configuration.

You can disable it in watir-rails by ignoring exceptions:

Watir::Rails.ignore_exceptions = true

Limitations

  • When using Rails path/url helpers in your tests then always use path instead of url methods, because latter won't work!

Contributors

License

See LICENSE.