Forum: RSpec Appropriate adapter (Rails, Cucumber)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4e13e53b030e7751b777e439357fe902?d=identicon&s=25 Julian Leviston (Guest)
on 2009-04-20 11:28
(Received via mailing list)
Hi All,
I've got a bunch of tests written in cucumber, and they're all
lovely... this is rails testing i'm doing by the way.... and now I'm
coming to testing the javascript and AJAX parts of the app... and I've
decided to plug in selenium... my issue is, I'd like to select which
adapter to use on a per-scenario basis... is there any easy way to do
this, and yet still maintain the no-implementation-details in the
cucumber side type of thing that cucumber encourages...

I mean, basically, I just want it to use the fastest method
possible.... so for non-ajax/non-js stuff, I'd like it to use the
default adapter and others I'd like it to use selenium....

Julian.
3c28deaff162aeda44f2e0bcdca1dacf?d=identicon&s=25 Joseph Wilk (josephwilk)
on 2009-04-20 11:55
(Received via mailing list)
Julian Leviston wrote:
> possible.... so for non-ajax/non-js stuff, I'd like it to use the
> default adapter and others I'd like it to use selenium....
>
> Julian.
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>

Have you looked at using Cucumber's Tagging feature?
(http://wiki.github.com/aslakhellesoy/cucumber/tags)

---
@js
Scenario: I'm javascript

Scenario: I'm not using javascript
---

---
#Run scenarios excluding any that are tagged as js
 > cucumber --tags ~@js features/

#Run just the js scenarios.
 > cucumber --tags @js features/
---

So you have two separate runs of Cucumber. Hence you could have a env.rb
for each. One that loads Selenium (or Webrat driving Selenium) and the
other Webrat.

HTH,
--
Joseph Wilk
http://blog.josephwilk.net
This topic is locked and can not be replied to.