Annotation Interface CucumberOptions


@Deprecated(forRemoval=true) @API(status=DEPRECATED) @Retention(RUNTIME) @Target(TYPE) public @interface CucumberOptions
Deprecated, for removal: This API element is subject to removal in a future version.
Since v3.6.0 Maven Surefire uses the JUnit Platform to run TestNG. Cucumber support the JUnit Platform directly. Since v9.4.0 Gradle supports resource based test on the JUnit Platform. This leaves little reason to support a dedicated TestNG runner.

Please switch to cucumber-junit-platform-engine. If there are missing features that prevent you from upgrading please create an issue.

Configure Cucumbers options.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return true if glue code execution should be skipped.
    Deprecated, for removal: This API element is subject to removal in a future version.
    The pattern for excluded glue classes.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Package to load additional glue code (step definitions, hooks and plugins) from.
    Class<?>[]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Additional classes with glue code.
    Deprecated, for removal: This API element is subject to removal in a future version.
    A list of features paths.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Package to load glue code (step definitions, hooks and plugins) from.
    Class<?>[]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Classes with glue code.
    Deprecated, for removal: This API element is subject to removal in a future version.
    The pattern for included glue classes.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if terminal output should be without colours.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Only run scenarios whose names match one of the provided regular expressions.
    Class<? extends ObjectFactory>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specify a custom ObjectFactory.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Register plugins.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Publish report to reports.cucumber.io.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the format of the generated snippets.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Only run scenarios tagged with tags matching Tag Expression.
    Class<? extends UuidGenerator>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Specify a custom ObjectFactory.
  • Element Details

    • dryRun

      boolean dryRun
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return true if glue code execution should be skipped.
      Returns:
      true if glue code execution should be skipped.
      Default:
      false
    • features

      String[] features
      Deprecated, for removal: This API element is subject to removal in a future version.
      A list of features paths.

      A feature path is constructed as [ PATH[.feature[:LINE]*] | URI[.feature[:LINE]*] | @PATH ]

      Examples:

      • src/test/resources/features -- All features in the src/test/resources/features directory
      • classpath:com/example/application -- All features in the com.example.application package
      • in-memory:/features -- All features in the /features directory on an in memory file system supported by FileSystems
      • src/test/resources/features/example.feature:42 -- The scenario or example at line 42 in the example feature file
      • @target/rerun -- All the scenarios in the files in the rerun directory
      • @target/rerun/RunCucumber.txt -- All the scenarios in RunCucumber.txt file

      When no feature path is provided, Cucumber will use the package of the annotated class. For example, if the annotated class is com.example.RunCucumber then features are assumed to be located in classpath:com/example.

      Returns:
      list of files or directories
      See Also:
      Default:
      {}
    • glue

      String[] glue
      Deprecated, for removal: This API element is subject to removal in a future version.
      Package to load glue code (step definitions, hooks and plugins) from. E.g: com.example.app

      When no glue is provided, Cucumber will use the package of the annotated class. For example, if the annotated class is com.example.RunCucumber then glue is assumed to be located in com.example.

      Returns:
      list of package names
      See Also:
      Default:
      {}
    • glueClasses

      Class<?>[] glueClasses
      Deprecated, for removal: This API element is subject to removal in a future version.
      Classes with glue code.

      When no glue is provided, Cucumber will use the package of the annotated class. For example, if the annotated class is com.example.RunCucumber then glue is assumed to be located in com.example.

      Returns:
      list of class names
      Default:
      {}
    • extraGlue

      String[] extraGlue
      Deprecated, for removal: This API element is subject to removal in a future version.
      Package to load additional glue code (step definitions, hooks and plugins) from. E.g: com.example.app

      These packages are used in addition to the default described in glue().

      Returns:
      list of package names
      Default:
      {}
    • extraGlueClasses

      Class<?>[] extraGlueClasses
      Deprecated, for removal: This API element is subject to removal in a future version.
      Additional classes with glue code.

      These classes are used in addition to the default described in #glue.

      Classes that explicitly listed as glue are not filtered by either includedGlueClassNamePatterns() or excludedGlueClassNamePatterns().

      Returns:
      list of class names
      Default:
      {}
    • includedGlueClassNamePatterns

      String[] includedGlueClassNamePatterns
      Deprecated, for removal: This API element is subject to removal in a future version.
      The pattern for included glue classes.

      A glue class is included in classpath scanning if the include pattern matches it and the exclude pattern doesn't.

      Example: .*StepDefinitions?|.*Hooks?

      Returns:
      list of patterns
      Default:
      {}
    • excludedGlueClassNamePatterns

      String[] excludedGlueClassNamePatterns
      Deprecated, for removal: This API element is subject to removal in a future version.
      The pattern for excluded glue classes.

      A glue class is included in classpath scanning if the include pattern matches it and the exclude pattern doesn't.

      Example: .*UnwantedStepDefinitions?|.*UnwantedHooks?

      Returns:
      list of patterns
      Default:
      {}
    • tags

      String tags
      Deprecated, for removal: This API element is subject to removal in a future version.
      Only run scenarios tagged with tags matching Tag Expression.

      For example "@smoke and not @fast".

      Returns:
      a tag expression
      Default:
      ""
    • plugin

      String[] plugin
      Deprecated, for removal: This API element is subject to removal in a future version.
      Register plugins. Built-in plugin types: junit, html, pretty, progress, json, usage, unused, rerun, testng.

      Can also be a fully qualified class name, allowing registration of 3rd party plugins.

      Plugins can be provided with an argument. For example json:target/cucumber-report.json

      Returns:
      list of plugins
      See Also:
      Default:
      {}
    • publish

      boolean publish
      Deprecated, for removal: This API element is subject to removal in a future version.
      Publish report to reports.cucumber.io.
      Returns:
      true if reports should be published on the web.
      Default:
      false
    • monochrome

      boolean monochrome
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if terminal output should be without colours.
      Returns:
      true if terminal output should be without colours.
      Default:
      false
    • name

      String[] name
      Deprecated, for removal: This API element is subject to removal in a future version.
      Only run scenarios whose names match one of the provided regular expressions.
      Returns:
      a list of regular expressions
      Default:
      {}
    • snippets

      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the format of the generated snippets.
      Returns:
      the format of the generated snippets.
      Default:
      UNDERSCORE
    • objectFactory

      Class<? extends ObjectFactory> objectFactory
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specify a custom ObjectFactory.

      In case a custom ObjectFactory is needed, the class can be specified here. A custom ObjectFactory might be needed when more granular control is needed over the dependency injection mechanism.

      Returns:
      an ObjectFactory implementation
      Default:
      io.cucumber.testng.NoObjectFactory.class
    • uuidGenerator

      Class<? extends UuidGenerator> uuidGenerator
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specify a custom ObjectFactory.

      In case a custom ObjectFactory is needed, the class can be specified here. A custom ObjectFactory might be needed when more granular control is needed over the dependency injection mechanism.

      Returns:
      an ObjectFactory implementation
      Default:
      io.cucumber.testng.NoUuidGenerator.class