Forum: RSpec automating and end to end functional test.

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.
6c002b9523cb01719d9c699cfbbe13b0?d=identicon&s=25 jmac (Guest)
on 2009-04-25 15:01
(Received via mailing list)
Hi,
I am new to ruby and rspec. I would like to use ruby/rspec/cucumber to
automate acceptance tests for a number of integrated systems at my
work. I get the basics of cucumber features, but how do I chain these
tests so that I can test a process from start to finish. Essentially,
I want to use the features as components that I can plug together to
create the different tests. Can cucumber/rspec be used this way.
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-04-25 15:13
(Received via mailing list)
On Sat, Apr 25, 2009 at 5:43 AM, jmac <j.mcguinness@bigpond.com> wrote:
> Hi,
> I am new to ruby and rspec. I would like to use ruby/rspec/cucumber to
> automate acceptance tests for a number of integrated systems at my
> work. I get the basics of cucumber features, but how do I chain these
> tests so that I can test a process from start to finish. Essentially,
> I want to use the features as components that I can plug together to
> create the different tests. Can cucumber/rspec be used this way.

Can you give an example. Something simple, but just complex enough to
get your goal across. I have an idea of what you're after, but don't
want to waste my time writing or anybody else's time reading if I'm
wrong :)
6c002b9523cb01719d9c699cfbbe13b0?d=identicon&s=25 jmac (Guest)
on 2009-04-27 08:39
(Received via mailing list)
Hi David,

So I have a number of Java based web systems. The systems allow users
to lodge applications for various products/services that my
organisation provides. The applications usually have at least 4 or 5
pages, but may be longer depending on the info that is entered. There
is alot of common page fragments between the two systems (eg most
systems have a page with bio info: names, Birth dates, gender etc) but
each system with have different fields in addition the common fields
on each page fragment. So, what I wanted to do is create features for
logon, features to deal with the common page fragments, like the bio
stuff, features to deal with the unique parts, and chain these all
together so that I can build up a test to test the end to end
application process. I will be using either watir or selenium with
rspec/cucumber. The organization currently uses commercial test
automation tools, so I am looking at ditching these and going with a
Ruby based solution.

The cucumber examples I have seen usually are short:
Given..something
Wen .. I do something
Then .. I expect this to happen

Can they be longer like this:

Given..
And..
And..
Then..
And..
And..
And..
And..
Then...
Given..
And..
And..
Then..

etc.
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-04-27 09:20
(Received via mailing list)
> logon, features to deal with the common page fragments, like the bio
> Then .. I expect this to happen
> And..
> Then...
> Given..
> And..
> And..
> Then..
>

Yes. The sky is the limit ;-)

Aslak
Cdf378de2284d8acf137122e541caa28?d=identicon&s=25 Matt Wynne (mattwynne)
on 2009-04-27 10:38
(Received via mailing list)
On 27 Apr 2009, at 06:29, jmac wrote:

> logon, features to deal with the common page fragments, like the bio
> Then .. I expect this to happen
> And..
> Then...
> Given..
> And..
> And..
> Then..

This is possible, but not really advisable in such raw form - you'll
end up with tests that, while they might make sense at the time you
write them, are quite hard to read and therefore maintain. I'd always
try to stick to a single Given / When / Then loop for a single scenario.

Have a read of these:
http://www.benmabey.com/2008/05/19/imperative-vs-d...
http://blog.mattwynne.net/2008/11/14/dry-up-your-c...

Also these two Cucumber features can help:
http://wiki.github.com/aslakhellesoy/cucumber/background
http://wiki.github.com/aslakhellesoy/cucumber/scen...

>>> work. I get the basics of cucumber features, but how do I chain
>> _______________________________________________
>> rspec-users mailing list
>> rspec-us...@rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com
This topic is locked and can not be replied to.