Annotation Type CucumberOptions
-
@Retention(RUNTIME) @Target(TYPE) @API(status=STABLE) public @interface CucumberOptions
Configure Cucumbers options.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
dryRun
String[]
extraGlue
Package to load additional glue code (step definitions, hooks and plugins) from.String[]
features
Either a URI or path to a directory of features or a URI or path to a single feature optionally followed by a colon and line numbers.String[]
glue
Package to load glue code (step definitions, hooks and plugins) from.boolean
monochrome
String[]
name
Only run scenarios whose names match one of the provided regular expressions.Class<? extends ObjectFactory>
objectFactory
Specify a custom ObjectFactory.String[]
plugin
Register plugins.boolean
publish
Publish report to https://reports.cucumber.io.CucumberOptions.SnippetType
snippets
boolean
stepNotifications
Provide step notifications.String
tags
Only run scenarios tagged with tags matchingTAG_EXPRESSION
.boolean
useFileNameCompatibleName
Use filename compatible names.
-
-
-
-
features
String[] features
Either a URI or path to a directory of features or a URI or path to a single feature optionally followed by a colon and line numbers.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 inclasspath:com/example
.- Returns:
- list of files or directories
- See Also:
FeatureWithLines
- Default:
- {}
-
-
-
glue
String[] glue
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 incom.example
.- Returns:
- list of package names
- See Also:
GluePath
- Default:
- {}
-
-
-
extraGlue
String[] extraGlue
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
Only run scenarios tagged with tags matchingTAG_EXPRESSION
.For example
"@smoke and not @fast"
.- Returns:
- a tag expression
- Default:
- ""
-
-
-
plugin
String[] plugin
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:
- {}
-
-
-
name
String[] name
Only run scenarios whose names match one of the provided regular expressions.- Returns:
- a list of regular expressions
- Default:
- {}
-
-
-
snippets
CucumberOptions.SnippetType snippets
- Returns:
- the format of the generated snippets.
- Default:
- io.cucumber.junit.CucumberOptions.SnippetType.UNDERSCORE
-
-
-
useFileNameCompatibleName
boolean useFileNameCompatibleName
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
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 ObjectFactory> objectFactory
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
-
-