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

net.masterthought.cucumber.json.Result Maven / Gradle / Ivy

Go to download

Provides pretty html reports for Cucumber (Behaviour-Driven Development). It works by generating html from the cucumber json report formatter. So can be used anywhere a json report is generated. Current use is in the cucumber jenkins plugin and a maven mojo to generate the same report from mvn command line when running locally.

There is a newer version: 5.8.4
Show newest version
package net.masterthought.cucumber.json;

import net.masterthought.cucumber.json.support.Status;
import net.masterthought.cucumber.util.Util;

public class Result {

    // Start: attributes from JSON file report
    private final String status = null;
    private final String error_message = null;
    private final Long duration = 0L;
    // End: attributes from JSON file report

    public String getStatus() {
        return status == null ? Status.MISSING.getRawName() : status;
    }

    public long getDuration() {
        return duration;
    }

    public String getFormatedDuration() {
        return Util.formatDuration(duration);
    }

    public String getErrorMessage() {
        return error_message;
    }

    public String getFormatedErrorMessage() {
        final String contentId = "output_" + hashCode();
        return Util.formatMessage("Error message", error_message, contentId);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy