1
votes

Hi i have create d a feature file and for that also created a step definition class file but when i am trying to run feature from Cucumber runner class each time it tells:

You can implement missing steps with the snippets below:

I am using Junit for running that file .

My Cucumber Runner class as below:

    @RunWith(Cucumber.class)
    @CucumberOptions(
    features={"Features"},
    glue={"src.stepdefinition"},
    monochrome=false
            )
1
why not put the path to you feature file there in stead of putting just"Feature". - BIUbiubiu

1 Answers

0
votes

once you run your @RunWith(Cucumber.class) annotated class you have to complete the scenario test classes by using the code snippet provided by cucumber.

For example if you have a scenario named Eat Cucumber like the following:

Scenario: Eat cucumber
  Given I have a cucumber

after the run of your cucumber test class you should be able to create the following class with the snippet provided by its output:

public class EatCucumberSteps {
    @Given("^I have a cucumber$")
    public void I_have_a_cucumber() throws Throwable {
        // your implementation code here...
        throw new PendingException();
    }
    // add all your other missing steps
}