Cucumber options

When executing the cucumber scenarios, we can pass various options as mentioned below.
  • features – path of the features files
  • glue – path of the step definition classes
  • dry run – used to check that all step definitions are desinged
  • monochrome – true/false It controls the readability of the output
  • strict – false means that undefined steps are skipped. Test does not fail
  • name – used to filter the features and scenarios
  • plugin – json, html, junit, pretty
  • snippets – Snippet style can be Camel case or Underscore
Here is the sample test class showing all these options.
 
package org.softpost;
import cucumber.api.CucumberOptions;
import cucumber.api.SnippetType;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "classpath:abc.feature",
        glue = "classpath:org.softpost",
        tags = "~@blocked",
        plugin = "html:target/selenium-reports",
        dryRun = false,
        monochrome = true,
        strict = true,
        snippets = SnippetType.CAMELCASE
)

public class MyTests {
}                    

Web development and Automation testing

solutions delivered!!