bddjbehavejbehave-pluginjbehave-maven-plugin

JBehave incorrectly identifying two steps that have a similar step text part


sign out as \"$signOutUser\"

sign out as \"$signOutUser\" and sign in as \"$signInUser\"

Above are the two step definitions that cause this issue. JBehave misreads the below step.

When sign out as "userA" and sign in as "userB"

Even though the corresponding step should be interpreted to the 2nd step definition, it incorrectly interprets to 1st steps as,

When sign out as 'userA" and sign in as "userB'

I'm using JBehave 4.0.5. Is this a recognized issue? Or newer version has a fix for this?


Solution

  • The steps with similar syntax must be prioritized:

    @When(value="sign out as \"$signOutUser\"")
    @When(value="sign out as \"$signOutUser\" and sign in as \"$signInUser\"", priority=1)