Annotation Type CucumberOptions


@Deprecated @Retention(RUNTIME) @Target(TYPE) @API(status=STABLE) public @interface CucumberOptions
Deprecated.
JUnit 4 is in maintenance mode. Upgrade to JUnit 5 and switch to the cucumber-junit-platform-engine.
Configure Cucumbers options.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Deprecated.
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Deprecated.
     
    Deprecated.
    Package to load additional glue code (step definitions, hooks and plugins) from.
    Deprecated.
    A list of features paths.
    Deprecated.
    Package to load glue code (step definitions, hooks and plugins) from.
    boolean
    Deprecated.
     
    Deprecated.
    Only run scenarios whose names match one of the provided regular expressions.
    Class<? extends io.cucumber.core.backend.ObjectFactory>
    Deprecated.
    Specify a custom ObjectFactory.
    Deprecated.
    Register plugins.
    boolean
    Deprecated.
    Publish report to https://reports.cucumber.io.
    Deprecated.
     
    boolean
    Deprecated.
    Provide step notifications.
    Deprecated.
    Only run scenarios tagged with tags matching Tag Expression.
    boolean
    Deprecated.
    Use filename compatible names.
    Class<? extends io.cucumber.core.eventbus.UuidGenerator>
    Deprecated.
    Specify a custom ObjectFactory.
  • Element Details

    • dryRun

      boolean dryRun
      Deprecated.
      Returns:
      true if glue code execution should be skipped.
      Default:
      false
    • features

      String[] features
      Deprecated.
      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:
      • FeatureWithLines
      Default:
      {}
    • glue

      String[] glue
      Deprecated.
      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:
      • GluePath
      Default:
      {}
    • extraGlue

      String[] extraGlue
      Deprecated.
      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:
      {}
    • tags

      String tags
      Deprecated.
      Only run scenarios tagged with tags matching Tag Expression.

      For example "@smoke and not @fast".

      Returns:
      a tag expression
      Default:
      ""
    • plugin

      String[] plugin
      Deprecated.
      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:
      • Plugin
      Default:
      {}
    • publish

      boolean publish
      Deprecated.
      Publish report to https://reports.cucumber.io.

      Returns:
      true if reports should be published on the web.
      Default:
      false
    • monochrome

      boolean monochrome
      Deprecated.
      Returns:
      true if terminal output should be without colours.
      Default:
      false
    • name

      String[] name
      Deprecated.
      Only run scenarios whose names match one of the provided regular expressions.
      Returns:
      a list of regular expressions
      Default:
      {}
    • snippets

      Deprecated.
      Returns:
      the format of the generated snippets.
      Default:
      UNDERSCORE
    • useFileNameCompatibleName

      boolean useFileNameCompatibleName
      Deprecated.
      Use filename compatible names.

      Make sure that the names of the test cases only is made up of [A-Za-Z0-9_] so that the names for certain can be used as file names.

      Gradle for instance will use these names in the file names of the JUnit xml report files.

      Returns:
      true to enforce the use of well-formed file names
      Default:
      false
    • stepNotifications

      boolean stepNotifications
      Deprecated.
      Provide step notifications.

      By default steps are not included in notifications and descriptions. This aligns test case in the Cucumber-JVM domain (Scenarios) with the test case in the JUnit domain (the leafs in the description tree), and works better with the report files of the notification listeners like maven surefire or gradle.

      Returns:
      true to include steps should be included in notifications
      Default:
      false
    • objectFactory

      Class<? extends io.cucumber.core.backend.ObjectFactory> objectFactory
      Deprecated.
      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.junit.NoObjectFactory.class
    • uuidGenerator

      Class<? extends io.cucumber.core.eventbus.UuidGenerator> uuidGenerator
      Deprecated.
      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.junit.NoUuidGenerator.class