Pradeep
Pradeep

Reputation: 1

Cucumber Java - No features found at file <location>

I am getting the following error while running the maven command "mvn clean verify". I have placed the "feature" file at "C:/Users/304090/eclipse-workspace/evms-qa-testautomation/src/test/resources/". However, its unable to identify the file. Please suggest.

Apr 21, 2020 7:19:43 PM io.cucumber.core.runtime.FeaturePathFeatureSupplier get
WARNING: No features found at file:/C:/Users/304090/eclipse-workspace/evms-qa-testautomation/src/test/resources/


0 Scenarios
0 Steps
0m
0.000s

Folder structure:

enter image description here

Upvotes: 0

Views: 3563

Answers (1)

SeleniumUser
SeleniumUser

Reputation: 4177

check your test runner class where you have provided path to featch your feature files.currently its looking for C:/Users/304090/eclipse-workspace/evms-qa-testautomation/src/test/resources/ folder for a .feature files.

cucumber.api.CucumberOptions imports the @CucumberOptions annotation and it wwll tell where to look for feature files

You need to create features folder into the src/test/resources and past your .feature file in it. After that just update your runner class

import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
     features = "src/test/resources/features/featurefileanme.feature",
     glue={"path of glue package"}
 )

public class TestRunner {
 }

with serenity:

import cucumber.api.CucumberOptions;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
        features = "src/test/resources/CreatePreVioltReport.feature",
        glue = "stepsDef"
)

public class RunTests {}

Upvotes: 1

Related Questions