Class Cucumber
- All Implemented Interfaces:
org.junit.runner.Describable,org.junit.runner.manipulation.Filterable,org.junit.runner.manipulation.Orderable,org.junit.runner.manipulation.Sortable
A class annotated with @RunWith(Cucumber.class) will run feature
files as junit tests. In general, the runner class should be empty without
any fields or methods. For example:
@RunWith(Cucumber.class) @CucumberOptions(plugin = "pretty") final class RunCucumberTest { }
By default Cucumber will look for .feature and glue files on the
classpath, using the same resource path as the annotated class. For example,
if the annotated class is com.example.RunCucumber then features and
glue are assumed to be located in com.example.
Options can be provided in by (order of precedence):
- Properties from
System.getProperties()()} - Properties from in
System.getenv() - Annotating the runner class with
CucumberOptions - Properties from "cucumber.properties"
Constants.
Cucumber also supports JUnits ClassRule, BeforeClass and
AfterClass annotations. These will be executed before and after all
scenarios. Using these is not recommended as it limits the portability
between different runners; they may not execute correctly when using the
commandline, IntelliJ IDEA or Cucumber-Eclipse. Instead it is recommended to
use Cucumbers `Before` and `After` hooks.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classDeprecated, for removal: This API element is subject to removal in a future version.(package private) static final classDeprecated, for removal: This API element is subject to removal in a future version. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EventBusDeprecated, for removal: This API element is subject to removal in a future version.private final List<org.junit.runners.ParentRunner<?>> Deprecated, for removal: This API element is subject to removal in a future version.private final CucumberExecutionContextDeprecated, for removal: This API element is subject to removal in a future version.private booleanDeprecated, for removal: This API element is subject to removal in a future version.private final PluginsDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.junit.runners.model.StatementchildrenInvoker(org.junit.runner.notification.RunNotifier notifier) Deprecated, for removal: This API element is subject to removal in a future version.protected org.junit.runner.DescriptiondescribeChild(org.junit.runners.ParentRunner<?> child) Deprecated, for removal: This API element is subject to removal in a future version.protected List<org.junit.runners.ParentRunner<?>> Deprecated, for removal: This API element is subject to removal in a future version.protected voidrunChild(org.junit.runners.ParentRunner<?> child, org.junit.runner.notification.RunNotifier notifier) Deprecated, for removal: This API element is subject to removal in a future version.voidsetScheduler(org.junit.runners.model.RunnerScheduler scheduler) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.junit.runners.ParentRunner
classBlock, classRules, collectInitializationErrors, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, isIgnored, order, run, runLeaf, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolationMethods inherited from class org.junit.runner.Runner
testCount
-
Field Details
-
children
Deprecated, for removal: This API element is subject to removal in a future version. -
bus
Deprecated, for removal: This API element is subject to removal in a future version. -
plugins
Deprecated, for removal: This API element is subject to removal in a future version. -
context
Deprecated, for removal: This API element is subject to removal in a future version. -
multiThreadingAssumed
private boolean multiThreadingAssumedDeprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
Cucumber
Deprecated, for removal: This API element is subject to removal in a future version.Constructor called by JUnit.- Parameters:
clazz- the class with the @RunWith annotation.- Throws:
org.junit.runners.model.InitializationError- if there is another problem
-
-
Method Details
-
getChildren
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getChildrenin classorg.junit.runners.ParentRunner<org.junit.runners.ParentRunner<?>>
-
describeChild
protected org.junit.runner.Description describeChild(org.junit.runners.ParentRunner<?> child) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
describeChildin classorg.junit.runners.ParentRunner<org.junit.runners.ParentRunner<?>>
-
runChild
protected void runChild(org.junit.runners.ParentRunner<?> child, org.junit.runner.notification.RunNotifier notifier) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
runChildin classorg.junit.runners.ParentRunner<org.junit.runners.ParentRunner<?>>
-
childrenInvoker
protected org.junit.runners.model.Statement childrenInvoker(org.junit.runner.notification.RunNotifier notifier) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
childrenInvokerin classorg.junit.runners.ParentRunner<org.junit.runners.ParentRunner<?>>
-
setScheduler
public void setScheduler(org.junit.runners.model.RunnerScheduler scheduler) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setSchedulerin classorg.junit.runners.ParentRunner<org.junit.runners.ParentRunner<?>>
-
cucumber-junit-platform-engine.