Watir on Rails
Watir is a tool for user acceptance testing and in general can be used to control a browser to do automated task. Since I am using the standard Rails's testing framework, and I run my tests with rake test, I thought why not to use watir test in a similar way. There is a plugin, Watir on Rails, that integrates Ruby on Rails with Waitr. You only need to run rake test:watir to test your application with rake. The test can be written in a similar way of the other Rails' tests. For instance:
How to use the example:
- gem install watir # install watir
- script/plugin install git://github.com/chip/watir-on-rails.git
- put the file in test/watir or script/generate watir SuccessfulLogin to generate a test
- run: rake test:watir
- watch the browser doing your job ;-)
- Start learning from the cheat sheet:http://wiki.openqa.org/display/WTR/Ruby+Cheat+Sheet
Watir need your web server on, if you are testing a local application, so you should run:
mongrel_rails start -e test # if you are using mongrel
Links:
Watir on Rails - Watir on Rails web page
Watir on Rails at Github
Watir - the official web site
1 Comments:
You can use my gem.
just put
gem 'watir-webdriver-rails' in your Gemfile
Here is how you can use it:
https://github.com/tanin47/watir-webdriver-rails
Post a Comment
Subscribe to Post Comments [Atom]
<< Home