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.

Add support for Cucumber Expressions

See original GitHub issue

Summary

Cucumber Expressions is a new alternative to Regular Expressions, which is easier to read and write, and less daunting.

Expected Behavior

Step Defintions that don’t start with a ^ or end with a $ should be interpreted as a Cucumber Expression:

@Given("I have {n} cukes in my belly")

Alternatively we can decide to use regular expressions if the string uses / delimiters:

@Given("/I have (\\d+) cukes in my belly/")

Whatever mechanism we choose to differentiate is likely to break existing step definitions, so we’d have to make a new major release and document how to migrate.

Snippets for undefined steps should use Cucumber Expressions, and not Regular Expressions. We want users to start migrating, and if we can avoid it we’ll not generate snippets with regular expressions. (Well, we might if enough people want it). The cucumber-expression library can already generate expressions from text.

Finally, the current Transform logic should be deprecated and the logic built into the cucumber-expression library should be used instead.

Context & Motivation

Having to use Regular Expressions is one of the most common complaints against Cucumber. Other clones of Cucumber who support something similar to Cucumber Expressions seem to have happier users!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
aslakhellesoycommented, Oct 9, 2017

Thanks for waiting!

0reactions
lock[bot]commented, Nov 17, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 Expressions for JavaScript - npm
Cucumber Expressions - a simpler alternative to Regular Expressions. Latest version: 16.1.0, last published: 5 days ago.
Read more >
Cucumber Expression support in SpecFlow — documentation
Cucumber Expressions are supported natively by SpecFlow from v4. In earlier versions you need to add a reference to an additional NuGet package, ......
Read more >
Enable Cucumber support | IntelliJ IDEA Documentation
To be able to use Cucumber in your application, make sure that the necessary plugins are enabled and add the Cucumber library to...
Read more >
@cucumber/cucumber-expressions | Yarn - Package Manager
Added · [Java] Add support for Optional (#1006 gaeljw, mpkorstanje) · [Java] Enable consumers to find our version at runtime using clazz.getPackage().
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