Hi Aslak,
I have changed our stepdefs, and currently running with a single junit class. Now the duplicate stepdefs is really problem.
There are steps but different stepdefs are implemented slightly different but they exist in different packages.
Say
Given that stock order is submitted
And the order is received
When the order is processed.
Another scenario
Given that bill-only order is submitted
And the order is received
When the order is processed.
For example, the step 'the order is processed' is differently implemented by different stepdefs. But described commonly as "the order is processed". This long we had different test class for different package/stepdef, and we limited glue code search to only that package.
But now we use just single test class, and glue code path is base package path, resulting duplicate step defs.
All I say is sometimes the business people describe step in general way, but as I developer I implement differently based on the case/situations etc. But because of duplicate stepdef issue, we are forced to change the step declaration to avoid dupe stepdefs like
Given the bill-only order is submitted
And the bill-only order is received
When the bill-only order is processed
Not preferring this redundant way. The solution that we are looking is, if there more than one step-defs are matching for any given step, check is there any closest match. Say a step-def is defined in same package as feature file. If so use that step-def, otherwise use a step-def defined in any parent package or so.
Seems like jBehave also doesn't handle dupe step-def in expected, or desired way.
Appreciate your input. Thanks
Senthil