Class TestNGCucumberRunner

java.lang.Object
io.cucumber.testng.TestNGCucumberRunner

@API(status=STABLE) public final class TestNGCucumberRunner extends Object
Glue code for running Cucumber via TestNG.

Options can be provided in by (order of precedence):

  1. Properties from System.getProperties()
  2. Properties from in System.getenv()
  3. Properties properties from testng.xml
  4. Annotating the runner class with CucumberOptions
  5. Properties from "cucumber.properties"
For available properties see Constants.
  • Constructor Details

    • TestNGCucumberRunner

      public TestNGCucumberRunner(Class<?> clazz)
      Bootstrap the cucumber runtime
      Parameters:
      clazz - Which has the CucumberOptions and Test annotations
    • TestNGCucumberRunner

      @API(status=STABLE, since="6.11") public TestNGCucumberRunner(Class<?> clazz, CucumberPropertiesProvider properties)
      Bootstrap the cucumber runtime
      Parameters:
      clazz - Which has the CucumberOptions and Test annotations
      properties - additional properties (e.g. from testng.xml).
  • Method Details

    • runScenario

      public void runScenario(Pickle pickle)
    • finish

      public void finish()
      Finishes test execution by Cucumber.
    • provideScenarios

      public Object[][] provideScenarios()
      Returns:
      returns the cucumber scenarios as a two dimensional array of PickleWrapper scenarios combined with their FeatureWrapper feature.