question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple matching step definitions errors firing when steps do not match

See original GitHub issue

Current 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: image

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:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nids2307commented, Aug 16, 2022

Is there a documentation to see how the preprocessor 11.4 identifies the matching steps (just based on partial text matching)?

0reactions
badeballcommented, Aug 19, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found