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.

optional text in cucumber expression does not match

See original GitHub issue

Current behavior

Omitted optional text in cucumber expressions do not match.

Expected behavior

Omitted optional text in cucumber expressions should match.

Test code to reproduce

I assume 'this is a cucumber epression' as indicated in the preprocessor docs and defined in the cucumber docs.

Then('I am on the start page (again)', () => {}); does not match Then I am on the start page

Step implementation missing for “I am on the start page”.

(However, it does match Then I am on the start page again.)

Versions

  • Cypress: 10.3.1
  • Preprocessor: 12.0.0
  • Node: 14.17.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:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
badeballcommented, Aug 26, 2022

No, I don’t think so. It’s not possible to infer the types of the args of a step-def-body statically. I might have replaced any with unknown and require each dev to explicitly state each expected type, although it’s not going to give you any runtime guarantees.

1reaction
badeballcommented, Aug 26, 2022

Sure, like this

Given(transform("I am on the start page (again)"), function () {
  ...
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cucumber Expressions (JS): Optionals at end of line do not ...
Cucumber Expressions (JS): Optionals at end of line do not match steps when other transformations are involved in the step definition #403.
Read more >
Cucumber 4 Optional Words? - java - Stack Overflow
X to 5.X absence of optional text in gherkin step caused that method argument got null value. Now I'm getting error IllegalArgumentException: ...
Read more >
Cucumber Expressions - Cucumber Documentation
The Cucumber Expressions Docs have been moved to GitHub. You can help us improve this documentation. Edit this page. Explore SmartBear Tools.
Read more >
[Cucumber] cucumber expressions; capture optional text or ...
In trying to do so, I get some problems I have to resolve. One is that cucumber expression syntax does not mix with...
Read more >
Complete Course of Cucumber for Java: Optional ... - YouTube
... Complete Course (Tutorial) of Cucumber for #Java I introduce the concepts of Optional text, alt. ... Your browser can 't play this...
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