Automating and end to end functional test


#1

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.


#2

On Sat, Apr 25, 2009 at 5:43 AM, jmac removed_email_address@domain.invalid 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 :slight_smile:


#3

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.


#4

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 :wink:

Aslak


#5

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-declarative-scenarios-in-user-stories/
http://blog.mattwynne.net/2008/11/14/dry-up-your-cucumber-steps/

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

work. I get the basics of cucumber features, but how do I chain


rspec-users mailing list
removed_email_address@domain.invalid://rubyforge.org/mailman/listinfo/rspec-users


rspec-users mailing list
removed_email_address@domain.invalid
http://rubyforge.org/mailman/listinfo/rspec-users

Matt W.
http://blog.mattwynne.net
http://www.songkick.com