Package io.qameta.allure
Class Allure
java.lang.Object
io.qameta.allure.Allure
The class contains some useful methods to work with
AllureLifecycle.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceStep context.static interfaceRunnable that allows to throw an exception and return any type.static interfaceCallable that allows to throw an exception and return void.static interfaceRunnable that allows to throw an exception and return any type.static interfaceRunnable that allows to throw an exception and return void. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAttachment(String name, InputStream content) static voidaddAttachment(String name, String content) static voidaddAttachment(String name, String type, InputStream content, String fileExtension) static voidaddAttachment(String name, String type, String content) static voidaddAttachment(String name, String type, String content, String fileExtension) static CompletableFuture<byte[]> addByteAttachmentAsync(String name, String type, String fileExtension, Supplier<byte[]> body) static CompletableFuture<byte[]> addByteAttachmentAsync(String name, String type, Supplier<byte[]> body) static voidaddDescription(String description) Deprecated.static voidaddDescriptionHtml(String descriptionHtml) Deprecated.usedescriptionHtml(String)instead.static voidaddLabels(io.qameta.allure.model.Label... labels) Deprecated.uselabel(String, String)instead.static voidaddLinks(io.qameta.allure.model.Link... links) Deprecated.uselink(String, String, String)instead.static CompletableFuture<InputStream> addStreamAttachmentAsync(String name, String type, String fileExtension, Supplier<InputStream> body) static CompletableFuture<InputStream> addStreamAttachmentAsync(String name, String type, Supplier<InputStream> body) static voidattachment(String name, InputStream content) Adds attachment.static voidattachment(String name, String content) Adds attachment.static voiddescription(String description) Adds description to current test if any.static voiddescriptionHtml(String descriptionHtml) Adds descriptionHtml to current test if any.static voidAdds epic label to current test if any.static voidAdds feature label to current test if any.static AllureLifecycleReturnsAllureLifecyclefor low level operations with results.static voidAdds issue link to current test if any.static voidAdds label to current test if any.static voidAdds link to current test if any.static voidAdds link to current test if any.static voidAdds link to current test if any.static <T> TAdds parameter to current test if any.static <T> TAdds parameter to current test if any.static <T> TAdds parameter to current test if any.static <T> TAdds parameter to current test if any.static voidsetLifecycle(AllureLifecycle lifecycle) SetsAllureLifecycle.static <T> Tstep(Allure.ThrowableContextRunnable<T, Allure.StepContext> runnable) Run providedAllure.ThrowableRunnableas step with given name.static voidSyntax sugar forstep(ThrowableContextRunnable).static voidAdds passed step with provided name in current test or step (or test fixture).static <T> Tstep(String name, Allure.ThrowableContextRunnable<T, Allure.StepContext> runnable) Syntax sugar forstep(ThrowableContextRunnable).static voidstep(String name, Allure.ThrowableContextRunnableVoid<Allure.StepContext> runnable) Syntax sugar forstep(ThrowableContextRunnable).static <T> Tstep(String name, Allure.ThrowableRunnable<T> runnable) Syntax sugar forstep(ThrowableContextRunnable).static voidstep(String name, Allure.ThrowableRunnableVoid runnable) Syntax sugar forstep(String, ThrowableRunnable).static voidAdds step with provided name and status in current test or step (or test fixture).static voidAdds story label to current test if any.static voidAdds suite label to current test if any.static voidAdds tms link to current test if any.
-
Method Details
-
getLifecycle
ReturnsAllureLifecyclefor low level operations with results.- Returns:
- the lifecycle.
-
setLifecycle
SetsAllureLifecycle. -
step
Adds passed step with provided name in current test or step (or test fixture). Takes no effect if no test run at the moment. Shortcut forstep(String, Status).- Parameters:
name- the name of step.
-
step
Adds step with provided name and status in current test or step (or test fixture). Takes no effect if no test run at the moment.- Parameters:
name- the name of step.status- the step status.
-
step
Syntax sugar forstep(String, ThrowableRunnable).- Parameters:
name- the name of step.runnable- the step's body.
-
step
Syntax sugar forstep(ThrowableContextRunnable).- Parameters:
name- the name of step.runnable- the step's body.
-
step
Syntax sugar forstep(ThrowableContextRunnable).- Parameters:
runnable- the step's body.
-
step
public static void step(String name, Allure.ThrowableContextRunnableVoid<Allure.StepContext> runnable) Syntax sugar forstep(ThrowableContextRunnable).- Parameters:
name- the name of step.runnable- the step's body.
-
step
public static <T> T step(String name, Allure.ThrowableContextRunnable<T, Allure.StepContext> runnable) Syntax sugar forstep(ThrowableContextRunnable).- Parameters:
name- the name of step.runnable- the step's body.
-
step
Run providedAllure.ThrowableRunnableas step with given name. Takes no effect if no test run at the moment.- Parameters:
runnable- the step's body.
-
epic
Adds epic label to current test if any. Takes no effect if no test run at the moment. Shortcut forlabel(String, String).- Parameters:
value- the value of label.
-
feature
Adds feature label to current test if any. Takes no effect if no test run at the moment. Shortcut forlabel(String, String).- Parameters:
value- the value of label.
-
story
Adds story label to current test if any. Takes no effect if no test run at the moment. Shortcut forlabel(String, String).- Parameters:
value- the value of label.
-
suite
Adds suite label to current test if any. Takes no effect if no test run at the moment. Shortcut forlabel(String, String).- Parameters:
value- the value of label.
-
label
Adds label to current test if any. Takes no effect if no test run at the moment.- Parameters:
name- the name of label.value- the value of label.
-
parameter
Adds parameter to current test if any. Takes no effect if no test run at the moment.Shortcut for
parameter(String, Object, Boolean, Parameter.Mode).- Parameters:
name- the name of parameter.value- the value of parameter.
-
parameter
Adds parameter to current test if any. Takes no effect if no test run at the moment.Shortcut for
parameter(String, Object, Boolean, Parameter.Mode).- Parameters:
name- the name of parameter.value- the value of parameter.excluded- true if parameter should be excluded from history key calculation, false otherwise.- Returns:
- the specified value.
-
parameter
Adds parameter to current test if any. Takes no effect if no test run at the moment.Shortcut for
parameter(String, Object, Boolean, Parameter.Mode).- Parameters:
name- the name of parameter.value- the value of parameter.mode- the parameter mode.- Returns:
- the specified value.
-
parameter
public static <T> T parameter(String name, T value, Boolean excluded, io.qameta.allure.model.Parameter.Mode mode) Adds parameter to current test if any. Takes no effect if no test run at the moment.- Parameters:
name- the name of parameter.value- the value of parameter.excluded- true if parameter should be excluded from history key calculation, false otherwise.mode- the parameter mode.- Returns:
- the specified value.
-
issue
Adds issue link to current test if any. Takes no effect if no test run at the moment. Shortcut forlink(String, String, String).- Parameters:
name- the name of link.url- the link's url.
-
tms
Adds tms link to current test if any. Takes no effect if no test run at the moment. Shortcut forlink(String, String, String).- Parameters:
name- the name of link.url- the link's url.
-
link
Adds link to current test if any. Takes no effect if no test run at the moment. Shortcut forlink(String, String)- Parameters:
url- the link's url.
-
link
Adds link to current test if any. Takes no effect if no test run at the moment. Shortcut forlink(String, String, String)- Parameters:
name- the name of link.url- the link's url.
-
link
Adds link to current test if any. Takes no effect if no test run at the moment.- Parameters:
name- the name of link.type- the type of link, used to display link icon in the report.url- the link's url.
-
description
Adds description to current test if any. Takes no effect if no test run at the moment. Expecting description provided in Markdown format.- Parameters:
description- the description in markdown format.- See Also:
-
descriptionHtml
Adds descriptionHtml to current test if any. Takes no effect if no test run at the moment. Note that description will take no effect if descriptionHtml is specified.- Parameters:
descriptionHtml- the description in html format.- See Also:
-
attachment
Adds attachment.- Parameters:
name- the name of attachment.content- the attachment content.
-
attachment
Adds attachment.- Parameters:
name- the name of attachment.content- the stream that contains attachment content.
-
addLabels
Deprecated.uselabel(String, String)instead. -
addLinks
Deprecated.uselink(String, String, String)instead. -
addDescription
Deprecated.usedescription(String)instead. -
addDescriptionHtml
Deprecated.usedescriptionHtml(String)instead. -
addAttachment
-
addAttachment
-
addAttachment
-
addAttachment
-
addAttachment
public static void addAttachment(String name, String type, InputStream content, String fileExtension) -
addByteAttachmentAsync
public static CompletableFuture<byte[]> addByteAttachmentAsync(String name, String type, Supplier<byte[]> body) -
addByteAttachmentAsync
public static CompletableFuture<byte[]> addByteAttachmentAsync(String name, String type, String fileExtension, Supplier<byte[]> body) -
addStreamAttachmentAsync
public static CompletableFuture<InputStream> addStreamAttachmentAsync(String name, String type, Supplier<InputStream> body) -
addStreamAttachmentAsync
public static CompletableFuture<InputStream> addStreamAttachmentAsync(String name, String type, String fileExtension, Supplier<InputStream> body)
-
description(String)instead.