public class Cucumber extends ParentRunner<cucumber.runtime.junit.FeatureRunner>
Classes annotated with @RunWith(Cucumber.class) will run a Cucumber Feature.
In general, the runner class should be empty without any fields or methods.
For example:
@RunWith(Cucumber.class)
@CucumberOptions(plugin = "pretty")
public class RunCukesTest {
}
Cucumber will look for a .feature file on the classpath, using the same resource
path as the annotated class (.class substituted by .feature).
Additional hints can be given to Cucumber by annotating the class with CucumberOptions.
Cucumber also supports JUnits ClassRule, BeforeClass and AfterClass annotations.
These will be invoked around the suite of features" and moved to the end of the java doc.
CucumberOptions| Constructor and Description |
|---|
Cucumber(Class clazz)
Constructor called by JUnit.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.junit.runners.model.Statement |
childrenInvoker(RunNotifier notifier) |
protected cucumber.runtime.Runtime |
createRuntime(cucumber.runtime.io.ResourceLoader resourceLoader,
ClassLoader classLoader,
cucumber.runtime.RuntimeOptions runtimeOptions)
Deprecated.
Neither the runtime nor the backend or any of the classes involved in their construction are part of
the public API. As such they should not be exposed. The recommended way to observe the cucumber process is to
listen to events by using a plugin. For example the JSONFormatter.
|
protected Description |
describeChild(cucumber.runtime.junit.FeatureRunner child) |
List<cucumber.runtime.junit.FeatureRunner> |
getChildren() |
protected void |
runChild(cucumber.runtime.junit.FeatureRunner child,
RunNotifier notifier) |
classBlock, classRules, collectInitializationErrors, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, isIgnored, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClassespublic Cucumber(Class clazz) throws org.junit.runners.model.InitializationError, IOException
clazz - the class with the @RunWith annotation.IOException - if there is a problemorg.junit.runners.model.InitializationError - if there is another problem@Deprecated protected cucumber.runtime.Runtime createRuntime(cucumber.runtime.io.ResourceLoader resourceLoader, ClassLoader classLoader, cucumber.runtime.RuntimeOptions runtimeOptions) throws org.junit.runners.model.InitializationError, IOException
resourceLoader - used to load resourcesclassLoader - used to load classesruntimeOptions - configurationorg.junit.runners.model.InitializationError - if a JUnit error occurredIOException - if a class or resource could not be loadedpublic List<cucumber.runtime.junit.FeatureRunner> getChildren()
getChildren in class ParentRunner<cucumber.runtime.junit.FeatureRunner>protected Description describeChild(cucumber.runtime.junit.FeatureRunner child)
describeChild in class ParentRunner<cucumber.runtime.junit.FeatureRunner>protected void runChild(cucumber.runtime.junit.FeatureRunner child,
RunNotifier notifier)
runChild in class ParentRunner<cucumber.runtime.junit.FeatureRunner>protected org.junit.runners.model.Statement childrenInvoker(RunNotifier notifier)
childrenInvoker in class ParentRunner<cucumber.runtime.junit.FeatureRunner>Copyright © 2017. All rights reserved.