Feature: CheckSample
@ignored
Scenario Outline: check ABC #checkout.feature:2
Given I open the applciation
When I enter username as "<username>"
And I enter password as "<password>"
Then I enter title as "<title>"
Examples:
| username | password |
| dude | daad |
consider the above as feature file "CheckSample.feature"
And below is your step file, it is just partial file:
public class Sampletest {
@Given("^I open the applciation$")
public void i_open_the_applciation() throws Throwable {
// Write code here that turns the phrase above into concrete actions
//throw new PendingException();
}
Now below will be runner file:
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {"pretty", "html:target/reports",
"json:target/reports/cucumber-report.json"},
monochrome = true,
tags = {"~@ignored"}
)
public class junittestOne {
public static void main(String[] args) {
JUnitCore junit = new JUnitCore();
Result result = junit.run(junittestOne.class);
}
}
Important to note here, the "@ignored" text in feature file is mentioned in CucumberOptions (tags) with in "junittestone" class file. Also, make sure you have all relevant jar files for both cucumber, gherkin, Junit and other jars available in your project and you have imported them in your step definitions (class).
Because of "ignored", the scenario will be skipped while executing tests.