0

I am trying to generate the step definitions from my feature file and as well as I have also designed test runner class but upon execution both give output on console as :-

0 scenarios 0 steps 0m0s.000s

Even though my feature file contains scenarios and steps.

keshav dwivedi
  • 117
  • 4
  • 14

3 Answers3

1

Remove the colon (:) after the keywords (Given, When, etc) in your feature file.

Forough Omidvar
  • 111
  • 1
  • 5
0

Since you haven't shared any code or much details as to what you've done the only assumption that I can make is you have done something wrong in your testrunner class.

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "Feature"
        ,glue={"stepDefinition"}
        )

public class TestRunner {

}

in the features make sure the path to your feature files is correct. i.e. if they are stored at some other directory, provide the path for the same

Ex: features = {"src/test/java/features"}

Also, please share your project structure, your feature file and your testrunner class code if possible in case this doesn't work for you.

Ashish Deshmukh
  • 448
  • 4
  • 17
-1

Actually my runner class file looks like this:-

package runner;

import org.testng.annotations.Test;

import cucumber.api.CucumberOptions;
import cucumber.api.testng.AbstractTestNGCucumberTests;

@CucumberOptions(features={"src//test//resources//featurefiles"},glue= {"im801clsteps"},plugin={"html:target/cucumber-html-report",
        "json:target/cucumber.json", "pretty:target/cucumber-pretty.txt"})

@Test
public class MainRunner extends AbstractTestNGCucumberTests {

}

And I am using testng not junit to run my tests,please let me know why I am wrong?

keshav dwivedi
  • 117
  • 4
  • 14