[rspec-users] Selenium/Watir usage along side Webrat in story testing

Ben Mabey ben at benmabey.com
Mon Jun 9 14:11:13 EDT 2008


Joseph Wilk wrote:
> Create two classes (this is already what MHS_testing has done for
> Selenium)
>
> ----
> class RailsSeleniumStory < RailsStory
> class RailsWebratStory < RailsStory
> ----
>
> Create a common interface for all shared functionailty.
>
> (I suspect Webrat represents the smallest set of functionality -
> Selenium can do everything Webrat can do but not the other way around).
> The different UI testing frameworks implement such interface giving
> Selenium/Webrat/Other UI adapters.
>
> You choose which adapter to use by the story class.
>
> ...
>
> I'm not sure what direction MHS_testing or Rspec-ui are going, whether
> they will merge? I'm looking at this problem now and want to start
> contributing to whatever project is going to be the best fit. So I'm
> interested to hear:
>
> *Feedback/discussion about this direction
> *Any better ideas of solving the problem
> *Any other frameworks out there were people have started to look at this
> problem.
>
> --
> Joseph Wilk
> http://www.joesniff.co.uk
>   

Hey Joseph,
Have you looked at webrat in github lately?  
http://github.com/brynary/webrat/tree/master
Bryan is abstracting webrat so that different adapters can be plugged 
into it.. Meaning, the same wrappers/syntax can be used to drive rails, 
merb, mechanize, etc... I think a selenium or watir adapter for webrat 
would be awesome.  I'm not too experienced with selenium but it doesn't 
strike me as being too hard to do.  You make a good point in that webrat 
is a small subset of what the other JS aware frameworks can do but I 
think what webrat currently has would handle a lot of the use cases.  
One could then perhaps create an extension of webrat's language to form 
a uniform way of expressing JS/AJAX behaviour. 

The mechanize adapter idea is neat too, because you could then use it to 
test any website no matter what the implementation is.  I know that part 
of Bryan's motivation behind the mechanize spike is to eventually use 
the stories to do performance testing as well.

This is a problem I'm also interested in but I haven't yet needed to use 
selenium enough to make me want to do anything about it. :)  I think the 
selenuim adapter for webrat approach would be a great way to approach 
this problem though.  What do you think?

-Ben



More information about the rspec-users mailing list