[rspec-users] How I make browser act-as-robot-driven ?

1 view
Skip to first unread message

Audrey A Lee

unread,
May 18, 2010, 2:08:23 PM5/18/10
to rspec...@rubyforge.org
Dear list,

Today I am working through the simple tutorial here:
http://wiki.github.com/aslakhellesoy/cucumber/ruby-on-rails

It has me install Cucumber-Rails and then create a feature.

Then I watch the feature fail when I run
rake cucumber

Then I watch the feature pass after I implement some code with the
help of:

script/generate rspec_scaffold Frooble name:string color:string
description:text

So I am happy.

I am curious though.

I'd like to have a browser appear and act-as-robot-driven.

This is convenient for my development efforts.

It allows me to rapidly create a development state inside a controller
and then halt the controller with a debugger statement.

Then I attach my mind to that state and tinker with values of
variables and snippets of code.

This is behavior I observed on a Rails project I wrote back in late
2009.

Back then I was using this combination of gems:

- cucumber 0.6.x
- rspec-rails-1.2.9
- Selenium-1.1.14

So, here is my question:

Using this combo of gems, is it possible to have a browser appear and
act-as-robot-driven:

cucumber (0.7.3)
cucumber-rails (0.3.1)
capybara (0.3.5)

???
_______________________________________________
rspec-users mailing list
rspec...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To post to this group, send email to rs...@googlegroups.com.
To unsubscribe from this group, send email to rspec+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rspec?hl=en.

Chuck van der Linden

unread,
May 20, 2010, 4:21:49 PM5/20/10
to rspec...@rubyforge.org
If you are looking for an easy way to 'drive' a browser with Ruby I'd
suggest looking at WATIR (Web Application Testing In Ruby) which is
designed for just that sort of thing.

I use it along with Cucumber to do regression test suites that test
the system 'end to end'

In my case I happen to use it within the Watircraft framework, just
because it makes things a bit easier when doing a whole suite of
tests, but for simple stuff it's probably overkill.

There's also something called 'watercuke' referenced in the ccumber
wiki (which I really don't know much about) that provides a enhanced
level of integration..

If you search the web you can perhaps also find some recordings that
people have done at various conferences or user-group meetings where
demo's were done of using Water and Cucumber together

aslak hellesoy

unread,
May 20, 2010, 4:41:50 PM5/20/10
to rspec-users
I actually recommend you look at Capybara instead of Watir. It
supports all major browsers by using the rock-solid Selenium2
(WebDriver) under the hood.

Watir works too, but if you use Capybara you can use all of the
features/step_definitions/web_steps.rb out of the box.

Just add the @javascript tag above a Feature or Scenario and it should
just work.

Aslak
Reply all
Reply to author
Forward
0 new messages