Package io.karatelabs.core
Class StepResult
java.lang.Object
io.karatelabs.core.StepResult
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA named report embed, generalised to one-or-moreStepResult.Parts plus optionalmeta(see EXT.md ยง Embeds).static classOne asset within anStepResult.Embed: either inlinedata(core writes the file and setsfileName) or a report-relativeurl(the ext wrote the asset itself, e.g. underext/image/assets/).static enum -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEmbed(StepResult.Embed embed) voidstatic StepResultstatic StepResultfakeFailure(String message, long startTime, Throwable error) Create a fake failure step result (for @fail tag handling).static StepResultfakeSuccess(String message, long startTime) Create a fake success step result (for @fail tag handling).doublelonggetError()getLog()longgetStep()booleanstatic StepResulthook(String hookName, StepResult.Status status, long startTime, long durationNanos, Throwable error) Create a synthetic step result representing a beforeScenario / afterScenario hook.booleanisFailed()booleanisHook()booleanisPassed()booleanstatic StepResultvoidsetCallResults(List<FeatureResult> callResults) voidstatic StepResulttoJson()Convert to JSON format (V1 nested structure).
-
Method Details
-
passed
-
failed
-
skipped
-
fakeSuccess
Create a fake success step result (for @fail tag handling). -
fakeFailure
Create a fake failure step result (for @fail tag handling). -
hook
public static StepResult hook(String hookName, StepResult.Status status, long startTime, long durationNanos, Throwable error) Create a synthetic step result representing a beforeScenario / afterScenario hook. The hook name becomes the step text; nested karate.call() results and logs are set by the caller via the existing setters. -
getStep
-
getStatus
-
getStartTime
public long getStartTime() -
getDurationNanos
public long getDurationNanos() -
getDurationMillis
public double getDurationMillis() -
getError
-
getLog
-
setLog
-
appendLog
-
getEmbeds
-
addEmbed
-
getCallResults
-
setCallResults
-
hasCallResults
public boolean hasCallResults() -
getHookName
-
isHook
public boolean isHook() -
isPassed
public boolean isPassed() -
isFailed
public boolean isFailed() -
isSkipped
public boolean isSkipped() -
getErrorMessage
-
toJson
Convert to JSON format (V1 nested structure). Uses nested `step` and `result` objects for V1 compatibility.
-