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.
David Chelimsky
2009-Apr-25 13:11 UTC
[rspec-users] automating and end to end functional test.
On Sat, Apr 25, 2009 at 5:43 AM, jmac <j.mcguinness at 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 :)
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. On Apr 25, 11:11?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Sat, Apr 25, 2009 at 5:43 AM, jmac <j.mcguinn... at 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 :) > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
Aslak Hellesøy
2009-Apr-27 06:30 UTC
[rspec-users] automating and end to end functional test.
> 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.. >Yes. The sky is the limit ;-) Aslak> etc. > On Apr 25, 11:11 pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Sat, Apr 25, 2009 at 5:43 AM, jmac <j.mcguinn... at 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 :) >> _______________________________________________ >> rspec-users mailing list >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/ >> rspec-users > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On 27 Apr 2009, at 06:29, jmac wrote:> 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..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> > > etc. > On Apr 25, 11:11 pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Sat, Apr 25, 2009 at 5:43 AM, jmac <j.mcguinn... at 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 :) >> _______________________________________________ >> rspec-users mailing list >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersMatt Wynne http://blog.mattwynne.net http://www.songkick.com