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.

Webstorm doesn't recognize step definitions

See original GitHub issue

I don’t really know if I should ask this here, but Webstorm doesn’t recoginize the step definitions of this plugin because the steps are given, when, then. Webstorm does recognize the official cucumber package’s Given, When an Then (capitalized). Webstorm recognizing step definitions is extremely helpful in preventing duplicate step definitions.

// Recognized (like the official cucumber package)
Given(`I am on the webpage`, () => {
  cy.visit(url);
});

// Not recognized (like this plugin)
given('I am on the webpage', () => {
  cy.visit(url);
});

webstormnotrecognizingcypresscucumber

I did find a workaround, but I’d rather not have people forget to include this:

// Just add this above the step definitions
const Given = given;
const When = when;
const Then = then;

Is there a way this could be solved without a workaround?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
kayvanbreecommented, Jul 5, 2018

@lgandecki

I will change my PR and check if the build works when I do the const Given = given stuff.

@vadimromanyak You can also use ticks:

Given(`user navigated to the Start page`, () => {});

If you check out the test steps I created (webstormSupport.steps.js) you can see I use either the ticks or /^…?/:

When(/^I write my steps using caps$/, () => {
  counter += 1;
});

By the way, we can’t really test Webstorm support itself I guess, only that the capitalized version is working correctly within the plugin.

1reaction
san-ouadghiricommented, Jul 5, 2019

https://youtrack.jetbrains.com/issue/WEB-32819 for follow-up. You can “thumb-up” to make it gain interest, and/or watch the issues for updates.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cucumber with IntelliJ not finding step definitions
I finally found the solution to my question. The error was caused by a plugin called Substep IntelliJ Plugin. You need to search...
Read more >
Steps cannot reach the step definitions if they are out of ...
The problem is when I write some step def in that folder the feature steps are unable to navigate to step def but...
Read more >
Webstorm doesn't recognize step definitions · Issue #56 - GitHub
Webstorm recognizing step definitions is extremely helpful in preventing duplicate step definitions. ... I did find a workaround, but I'd rather ...
Read more >
cucumber fails to find the step definitions in IntelliJ IDEA
Undefined scenarios | cucumber fails to find the step definitions in IntelliJ IDEA. 27K views 2 years ago.
Read more >
FAQ - Cucumber Documentation
In this instance, you need to configure a new run configuration in IntelliJ IDEA. ... If IntelliJ IDEA doesn't recognize the package with...
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