Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I keep getting the error, "Unimplemented substep definition" in IntelliJ with Cucumber?

I have already:

  • Downloaded the Cucumber Java, Gherkin plugin
  • I already have the steps and features directories:

My directory structure looks like this:

- test     - java         - features             - featureSet1                 - oneFeature.feature                 - anotherFeature.feature             - featuresSet2                 - twoFeature.feature             - CucumberTests.java         - steps                 - step1.java                 - step2.java 

Under the features folder, I have a file called, CucumberTests.java. I'm able to run the tests via mvn test but the red error marks reallllly annoy me.

I have these tags in CucumberTest.java, which is supposed to run the tests:

@RunWith(Cucumber.class) @CucumberOptions(plugin = { "pretty", "html:target/surefire-     reports/cucumber", "json:target/surefire-     reports/cucumberOriginal.json"},              features = {"src/test/java/features/featuresSet1",                          "src/test/java/features/featuresSet2",                          },              tags = {"~@ignore"},              glue = {"steps"}) 
like image 889
junecng Avatar asked Aug 29 '17 02:08

junecng


People also ask

How do I generate step definitions in cucumber IntelliJ?

Add step definitionsPlace the caret at a step in your . feature file and press Alt+Enter . The list of suggested intention actions opens. Select Create step definition to create a definition only for one step, or select Create all step definitions to add definitions for all steps in a scenario.

How do you link a feature file with step definition?

When you run your Runner class then it will scan all the feature file mentioned within features options and load the them afterward all step definition within package started by text mentioned within glue options will get loaded. For e.g.

Can not run feature file in IntelliJ?

This might happen if you created the file without initially giving it the . feature extension. If you do that and then try to add the extension afterwards IntelliJ will probably still think it's a text file and will not treat it as a feature file. This was the fix for me.


1 Answers

The issue is from Substeps IntelliJ Plugin that IntelliJ suggests you install when it locates a .feature file inside your project.

enter image description here

Just ignore this extension when it pops up or uninstall if you already have it.

Cucumber for Java and Gherkin should be enough.

like image 82
Daniel Fintinariu Avatar answered Sep 25 '22 07:09

Daniel Fintinariu