-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ambigous step definition error with new version of cucumber #682
Comments
Please be specific about what versions you are talking about. It has never been possible to have ambiguous step definitions, so I don't understand how this can ever have worked. In any case - this is by design. Feel free to hop on the cukes google group to discuss further. |
I added following list of jars where this was working fine with 1.1.2 version |
And what versions were you using when you didn't get the error? |
I didnt get error in following versions |
I find it very hard to believe that 1.1.2 would have allowed ambiguous step definitions. In any case - how do you expect Cucumber to choose among the two stepdefs that match your step? |
Since these are two different steps , thus it should consider these as two different step |
Can you please share a drive or location where i can share the project where it works with older version of cucumber |
Just create a github repo and push your code there. Then past a link to the repo here. |
The change in #485 explains why the AmbiguousStepDefinitionsException appear in v1.1.5 but not in v1.1.2. Since Cucumber-JVM now support partial matching (for the rationale see tip 8), the solution is to anchor at least the shorter step definition regex:
then it will not match the longer step: |
Thanks Björn! It's hard to keep track of everything. I should have read the changelog more carefully. |
Thank you. I was just wondering why would user have a same step definition for different steps. In the Issue #466 user could have created a step defnition with regular expresion and use the same step across the features. I can have two different steps with two different step defnitions I navigate to (.*) page I navigate to (.*) page via parent page It would be great if changes of issue #466 reverted. |
Hello All, Any views on this issue, can issue 466 be reverted? |
@madhurissanap no we are not going to revert that. Did you try anchoring your regular expressions like @brasmusson suggested? Regarding your question about why you would use the same step definition in different steps, please read https://github.com/cucumber/cucumber/wiki/Feature-Coupled-Step-Definitions-(Antipattern) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello All
I am getting following error , where as this was working fine with previous release of cucumber jvm version.
Given I logged in with UN and PW on RedBus on page # CommonSteps.logingInRedBusServices()
[java] cucumber.runtime.AmbiguousStepDefinitionsException: ?.Given I logged in with UN and PW on RedBus on page(Authenticate/AuthenticateRedBusUser.feature:8) matches more than one step definition:
[java] I logged in with UN and PW on RedBus in CommonSteps.logingInRedBusServices()
[java] I logged in with UN and PW on RedBus on page in ToKnowSeatsAvailability.logingInRedBusServices()
in Fixture i have following step definitions in two seperate files
@given("I logged in with UN and PW on RedBus")
public void logingInRedBusServices() throws Exception {
//Code
}
The text was updated successfully, but these errors were encountered: