Multiple matching step definitions errors firing when steps do not match
See original GitHub issueCurrent behavior
We recently upgraded our cypress-cucumber-preprocessor and now we have quite a few tests failing that were previously working. We are getting many different versions of this error:
Some other examples of “matching” step definitions are: I enter {string} in {POMstring} I enter {string} in the {POMstring} element and click out
I see {string} selected in the {POMstring} iFrame dropdown I see {string} selected in the {POMstring} dropdown
Some additional information: we are using global step definition files located in cypress\support\step_definitions and have the nonGlobalStepDefinitions configuration set to ‘false’.
Desired behavior
The preprocessor should only throw the ‘Multiple matching step definition’ error if the step string is different.
Versions
- Cypress version: 10.4.0
- Preprocessor version: 11.4.0
- Node version: 17.3.0
Checklist
- I’ve read the FAQ.
- I’ve read Instructions for logging issues.
- I’m not using
cypress-cucumber-preprocessor@4.3.1
(package name has changed and it is no longer the most recent version, see #689).
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Multiple Step Definitions match error in Cucumber
The Ambiguous error happens when 2 steps share the same regex/string in their step definition, as the runner has to decide which one...
Read more >Reports Multiple step definitions match error for steps that start ...
Upgrading from 0.9.5 to 1.2.1 I've started seeing this error when different steps start with the same text. Here is an example Multiple...
Read more >Multiple Step Definition match - feasibility of specifying priority
If Cucumber finds two or more matching step definitions, it will throw an error saying it's ambiguous. For this reason you should never...
Read more >Cucumber Duplicate and Ambiguous Step Definitions
When Cucumber Finds a Step matches more than one Step Definitions using regular expressions, it throws an Ambiguous Step Definitions exception.
Read more >Tentative Nonconfirmations (Mismatches) - E-Verify
Generally, if the information matches, the employee's case receives an Employment Authorized result in E-Verify. If the information does not ...
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 Free
Top 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
Is there a documentation to see how the preprocessor 11.4 identifies the matching steps (just based on partial text matching)?
This is expected behavior given how you defined
{POMString}
. It’s matching everything, including"SearchPage.SearchField" element and click out
. Try using the expression/"([^"]+)"/
instead.