varun
varun

Reputation: 1

CucumberOptions is not reading in Runner Class for java8

Please any one answer to this question.

import org.junit.runner.RunWith;
//import io.cucumber.junit.CucumberOptions;
import cucumber.api.CucumberOptions;
import io.cucumber.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
    features={"./src/test/java/featureFiles/feature.feature"}
    ,glue = {"stepDefs"}
    //,monochrome = true
    //,tags={"@tag1"}
//  ,dryRun=true
    //,strict = false
    //plugin = {"pretty", "html:test-output"}
    )

public class Test{
}

Here "features" keyword is not reading the path of feature file. and "glue" keyword is not reading path of stepDefination. Because, when I am running Run As--> Junit Test. I am getting

  Apr 06, 2020 7:19:34 PM io.cucumber.junit.Cucumber <init>
WARNING: By default Cucumber is running in --non-strict mode.
This default will change to --strict and --non-strict will be removed.
You can use --strict or @CucumberOptions(strict = true) to suppress this warning
Apr 06, 2020 7:19:34 PM io.cucumber.core.runtime.FeaturePathFeatureSupplier get
WARNING: No features found at classpath:/com/packagePath

0 Scenarios 0 Steps 0m0.000s

When I am clicking on any of the feature file step, I can able to go to Step Defination implemented path, but when I am running from Runner class, I am seeing above message. Even I kept my feature file in same package of Runner class and run, I am getting add missing snippets code. When I am added missing snippets in stepDefination file and keep it in same package or other package, I am not able to see the outcome.

I tried will all the aspects which I know. But I am unable to figure out the issue.

Upvotes: 0

Views: 6166

Answers (1)

Palash Kothari
Palash Kothari

Reputation: 11

Line 3:

import cucumber.api.CucumberOptions;

Remove this and replace it with

import io.cucumber.junit.CucumberOptions;

Upvotes: 1

Related Questions