Hehe.

It's funny I was after something just like this about a week ago...

Basically it'd be cool if there was an option to get cucumber to explicitly say (on running) exactly which steps it was doing, regardless of whether they were in a .feature file, or a _steps.rb file.

Julian.
----------------------------------------------
Blog: http://random8.zenunit.com/
Learn: http://sensei.zenunit.com/
Twitter: http://twitter.com/random8r

On 07/05/2009, at 4:13 AM, John Goodsen wrote:

I have the following step that I want to re-use in several scenarios. It looks like this:

 When I submit the form
   |form_field_id               |value|
   |billingAddress.email        |mickey_mo...@test.com|
   |billingAddress.firstName    |Mickey|
   |billingAddress.lastName     |Mouse|
   |billingAddress.street1      |249 Cross Road|
   |billingAddress.city         |Sanford|
   |billingAddress.subCountry   |ME|
   |billingAddress.zipPostalCode|04073|
   |billingAddress.country      |US|

This step fills out a form using Selenium behind the scenes. It's been copied into several scenarios and I want to DRY it up. I DRY'd this up by moving this table data into a fixture file (mickey_mouse.yml), but then the test becomes less descriptive - the original scenario step above turned into a one-liner:

 When I submit the form for "mickey_mouse"

I think ideally, I would like some kind of "include_step" feature in cucumber - where we can write partial snippets and include them wherever I want. When cucumber runs, it can replace the included step. So I could keep my tests DRY with something like:

    When I submit the form
      Include 'submit_form_for_mickey_mouse'

but when I run the test, cucumber would spit out the partial contents in place of the Include to make the test more descriptive.

Is there anything in cucumber that would help me out right now? What I'm currently looking into is hooking into the formatting and overriding some rendering - but it feels like a bad hack.

--

John Goodsen                 RADSoft / Better Software Faster
jgood...@radsoft.com Lean/Agile/XP/Scrum Coaching and Training
http://www.radsoft.com          Ruby on Rails and Java Solutions
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

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

Reply via email to