
net.masterthought.cucumber.json.Result Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cucumber-reporting Show documentation
Show all versions of cucumber-reporting Show documentation
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.
package net.masterthought.cucumber.json;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang.StringEscapeUtils;
import net.masterthought.cucumber.json.support.Status;
import net.masterthought.cucumber.util.Util;
public class Result {
// Start: attributes from JSON file report
private final Status status = null;
@JsonProperty("error_message")
private final String errorMessage = null;
private final Long duration = 0L;
// End: attributes from JSON file report
public Status getStatus() {
return status;
}
public long getDuration() {
return duration;
}
public String getFormatedDuration() {
return Util.formatDuration(duration);
}
/** Returns error message escaped so it is properly displayed as HTML. */
public String getErrorMessage() {
return StringEscapeUtils.escapeHtml(errorMessage);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy