I have created some cucumber test steps and a small Cucumber test case, which I run with JUnit like so:
@RunWith(Cucumber.class)
public class FuelCarTest {
-
I have placed all feature files in test/resources/features
and added my feature file location with class path. Here is my cucumber run file.
@RunWith(Cucumber.class)
@CucumberOptions(
monochrome = true,
features = "classpath:features",
plugin = {"pretty", "html:target/cucumber-reports",
"json:target/cucumber.json"
}
)
public class MyTests
{
}
This will pick all feature files inside the folder features. If you want to have a subfolders you can add that too by just replacing the line as shown below.
features = "classpath:features/DEV"
If only one particular feature file, it should be like this
features = "classpath:features/DEV/SmokeTests.feature"
- 热议问题