Question

Does Webrat require that the web application be written in Ruby/Rails?

I'd like to try it for writing tests against an ASP.NET web application.

Was it helpful?

Solution

You can use webrat for any application, not just Rails. What you do is to use Cucumber + Webrat + Mechanize adapter. This combination makes ordinary HTTP requests against your web application.

In fact, for the moment, i'm working on a simple smoketest that tests a website portal and can verify that everything is up and running in different environments. (localhost, test env, staging, production).

Have a look in Cucumbers' source. There is an example in the folder: cucumber/examples/webrat/

What you do is to tell Webrat to use the Mechanize adapter. Now you have a headless browser that can access any application regardless of the framework it uses.

Note that if you need full javascript support, you probably want something else (Watir,Firewatir, Selenium, etc).

OTHER TIPS

It would be easier to jump to rails :P I stumbled upon this post because I was thinking that would be very handy.

Have a look at Cuke4Nuke

Also checkout the authors blog, there is a nice screencast but it uses WatiN

There is also some discussion here about eventually being able to build the equivalent of webrat for mvc

https://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/428-wire-protocol

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top