class Scenario extends AnyRef
Before or After Hooks that declare a parameter of this type will receive an instance of this class. It allows writing text and embedding media into reports, as well as inspecting results (in an After block).
Note: This
class is not intended to be used to create reports. To create custom reports
use the io.cucumber.plugin.Plugin
class. The plugin system provides a much
richer access to Cucumbers then hooks after could provide. For an example
see io.cucumber.core.plugin.PrettyFormatter
.
- Alphabetic
- By Inheritance
- Scenario
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Scenario(delegate: TestCaseState)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def attach(data: String, mediaType: String, name: String): Unit
Attaches some text based data to the report.
Attaches some text based data to the report.
- data
what to attach, for example html.
- mediaType
what is the data?
- name
attachment name
- See also
#attach(byte[], String, String)
- def attach(data: Array[Byte], mediaType: String, name: String): Unit
Attach data to the report(s).
Attach data to the report(s).
// Attach a screenshot. See your UI automation tool's docs for // details about how to take a screenshot. scenario.attach(pngBytes, "image/png", "Bartholomew and the Bytes of the Oobleck");
To ensure reporting tools can understand what the data is a
mediaType
must be provided. For example:text/plain
,image/png
,text/html;charset=utf-8
.Media types are defined in RFC 7231 Section 3.1.1.1.
- data
what to attach, for example an image.
- mediaType
what is the data?
- name
attachment name
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- val delegate: TestCaseState
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def getId: String
Returns the unique identifier for this scenario.
Returns the unique identifier for this scenario.
If this is a Scenario from Scenario Outlines this will return the id of the example row in the Scenario Outline.
The id is not stable across multiple executions of Cucumber but does correlate with ids used in messages output. Use the uri + line number to obtain a somewhat stable identifier of a scenario.
- returns
the id of the Scenario.
- def getLine: Integer
Returns the line in the feature file of the Scenario.
Returns the line in the feature file of the Scenario.
If this is a Scenario from Scenario Outlines this will return the line of the example row in the Scenario Outline.
- returns
the line in the feature file of the Scenario
- def getName: String
- returns
the name of the Scenario
- def getSourceTagNames: Collection[String]
- returns
tags of this scenario.
- def getStatus: Status
Returns the current status of this test case.
Returns the current status of this test case.
The test case status is calculate as the most severe status of the executed steps in the testcase so far.
- returns
the current status of this test case
- def getUri: URI
- returns
the uri of the Scenario.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def isFailed: Boolean
- returns
true if and only if
getStatus
returns "failed"
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def log(text: String): Unit
Outputs some text into the report.
Outputs some text into the report.
- text
what to put in the report.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)