Attaches some text based data to the report.
Attaches some text based data to the report.
what to attach, for example html.
what is the data?
attachment name
#attach(byte[], String, String)
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.
what to attach, for example an image.
what is the data?
attachment name
the id of the Scenario.
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.
the name of the Scenario
tags of this scenario.
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.
the current status of this test case
the uri of the Scenario.
true if and only if getStatus
returns "failed"
Outputs some text into the report.
Outputs some text into the report.
what to put in the report.
(Since version ) see corresponding Javadoc for more information.
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 seeio.cucumber.core.plugin.PrettyFormatter
.