@Given & @When with same regexp results in error
See original GitHub issueWhen I have a @Given and a @When step definition with the same regexp I get a duplicate step definition error.
Example with 1.0.0-RC16:
Scenario: Test duplicate steps Given I do something When I do something
@Given("^I do something$")
public void givenIDoSomething() {
//Do something
}
@When("^I do something$")
public void whenIDoSomething() {
//Do something
}
Gives the result:
Exception in thread “main” cucumber.runtime.DuplicateStepDefinitionException: Duplicate step definitions in Steps.givenIDoSomething() and Steps.whenIDoSomething()
These step definitions should be treated as different due to the @Given & @When annotations, but they are not.
Issue Analytics
- State:
- Created 12 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Java regular expression: finding match errors - Stack Overflow
My regular expression is fine. It works as it should! The issue is that I want to know more informations in case of...
Read more >Regex.Matches Method (System.Text.RegularExpressions)
Searches an input string for all occurrences of a regular expression and returns all the matches.
Read more >re — Regular expression operations — Python 3.11.1 ...
A regular expression (or RE) specifies a set of strings that matches it; the functions in this module let you check if a...
Read more >Need a regex to find the word "ERROR:", but not match "ERROR
I'm not very good with regex and I can't seem to find the right combination of elements to find errors other than the...
Read more >A Guide To Java Regular Expressions API - Baeldung
In this tutorial, we'll discuss the Java Regex API, and how we can use regular expressions in the Java programming language.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s a feature, not a bug. Cucumber does not distinguish between keywords (Given, When, Then) - only regexen.
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.