All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cucumber.runtime.ScenarioResult Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
package cucumber.runtime;

import java.io.InputStream;

/**
 * After Hooks that declare a parameter of this type will receive an instance of this class.
 * This allows an After hook to inspect whether or not a Scenario failed.
 */
public interface ScenarioResult {
    /**
     * @return the most severe status of the Scenario's Steps. One of "passed", "undefined", "pending", "skipped", "failed"
     */
    String getStatus();

    /**
     * @return true if and only if {@link #getStatus()} returns "failed"
     */
    boolean isFailed();

    /**
     * Embeds data into the report(s). Some reporters (such as the progress one) don't embed data, but others do (html and json).
     *
     * @param data     what to embed, for example an image.
     * @param mimeType what is the data?
     * @see cucumber.formatter.ProgressFormatter
     * @see cucumber.formatter.HTMLFormatter
     * @see gherkin.formatter.JSONFormatter
     */
    void embed(InputStream data, String mimeType);

    /**
     * Outputs some text into the report.
     *
     * @param text what to put in the report.
     */
    void write(String text);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy