I have the following step that I want to re-use in several scenarios.
looks like this:
When I submit the form
|billingAddress.street1 |249 Cross Road|
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
moving this table data into a fixture file (mickey_mouse.yml), but then
test becomes less descriptive - the original scenario step above turned
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
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
currently looking into is hooking into the formatting and overriding
rendering - but it feels like a bad hack.
John G. RADSoft / Better Software Faster
email@example.com Lean/Agile/XP/Scrum Coaching and
http://www.radsoft.com Ruby on Rails and Java Solutions