cucumber.api
Interface Scenario


public interface Scenario

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).


Method Summary
 void embed(byte[] data, String mimeType)
          Embeds data into the report(s).
 Collection<String> getSourceTagNames()
           
 String getStatus()
           
 boolean isFailed()
           
 void write(String text)
          Outputs some text into the report.
 

Method Detail

getSourceTagNames

Collection<String> getSourceTagNames()
Returns:
source_tag_names. Needed for compatibility with Capybara.

getStatus

String getStatus()
Returns:
the most severe status of the Scenario's Steps. One of "passed", "undefined", "pending", "skipped", "failed"

isFailed

boolean isFailed()
Returns:
true if and only if getStatus() returns "failed"

embed

void embed(byte[] data,
           String mimeType)
Embeds data into the report(s). Some reporters (such as the progress one) don't embed data, but others do (html and json). Example:
 // Embed a screenshot. See your UI automation tool's docs for
 // details about how to take a screenshot.
 scenario.embed(pngBytes, "image/png");
 
 

Parameters:
data - what to embed, for example an image.
mimeType - what is the data?

write

void write(String text)
Outputs some text into the report.

Parameters:
text - what to put in the report.


Copyright © 2013. All Rights Reserved.