Class Allure

java.lang.Object
io.qameta.allure.Allure

public final class Allure extends Object
The class contains some useful methods to work with AllureLifecycle.
  • Method Details

    • getLifecycle

      public static AllureLifecycle getLifecycle()
      Returns AllureLifecycle for low level operations with results.
      Returns:
      the lifecycle.
    • setLifecycle

      public static void setLifecycle(AllureLifecycle lifecycle)
    • step

      public static void step(String name)
      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 for step(String, Status).
      Parameters:
      name - the name of step.
    • step

      public static void step(String name, io.qameta.allure.model.Status status)
      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

      public static void step(String name, Allure.ThrowableRunnableVoid runnable)
      Parameters:
      name - the name of step.
      runnable - the step's body.
    • step

      public static <T> T step(String name, Allure.ThrowableRunnable<T> runnable)
      Parameters:
      name - the name of step.
      runnable - the step's body.
    • step

      public static void step(Allure.ThrowableContextRunnableVoid<Allure.StepContext> runnable)
      Parameters:
      runnable - the step's body.
    • step

      public static void step(String name, Allure.ThrowableContextRunnableVoid<Allure.StepContext> runnable)
      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)
      Parameters:
      name - the name of step.
      runnable - the step's body.
    • step

      public static <T> T step(Allure.ThrowableContextRunnable<T,Allure.StepContext> runnable)
      Run provided Allure.ThrowableRunnable as step with given name. Takes no effect if no test run at the moment.
      Parameters:
      runnable - the step's body.
    • epic

      public static void epic(String value)
      Adds epic label to current test if any. Takes no effect if no test run at the moment. Shortcut for label(String, String).
      Parameters:
      value - the value of label.
    • feature

      public static void feature(String value)
      Adds feature label to current test if any. Takes no effect if no test run at the moment. Shortcut for label(String, String).
      Parameters:
      value - the value of label.
    • story

      public static void story(String value)
      Adds story label to current test if any. Takes no effect if no test run at the moment. Shortcut for label(String, String).
      Parameters:
      value - the value of label.
    • suite

      public static void suite(String value)
      Adds suite label to current test if any. Takes no effect if no test run at the moment. Shortcut for label(String, String).
      Parameters:
      value - the value of label.
    • label

      public static void label(String name, String value)
      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

      public static <T> T parameter(String name, T value)
      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

      public static <T> T parameter(String name, T value, Boolean excluded)
      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

      public static <T> T parameter(String name, T value, io.qameta.allure.model.Parameter.Mode mode)
      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

      public static void issue(String name, String url)
      Adds issue link to current test if any. Takes no effect if no test run at the moment. Shortcut for link(String, String, String).
      Parameters:
      name - the name of link.
      url - the link's url.
    • tms

      public static void tms(String name, String url)
      Adds tms link to current test if any. Takes no effect if no test run at the moment. Shortcut for link(String, String, String).
      Parameters:
      name - the name of link.
      url - the link's url.
    • link

      public static void link(String url)
      Adds link to current test if any. Takes no effect if no test run at the moment. Shortcut for link(String, String)
      Parameters:
      url - the link's url.
    • link

      public static void link(String name, String url)
      Adds link to current test if any. Takes no effect if no test run at the moment. Shortcut for link(String, String, String)
      Parameters:
      name - the name of link.
      url - the link's url.
    • link

      public static void link(String name, String type, String url)
      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

      public static void description(String 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

      public static void descriptionHtml(String 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

      public static void attachment(String name, String content)
      Adds attachment.
      Parameters:
      name - the name of attachment.
      content - the attachment content.
    • attachment

      public static void attachment(String name, InputStream content)
      Adds attachment.
      Parameters:
      name - the name of attachment.
      content - the stream that contains attachment content.
    • addLabels

      @Deprecated public static void addLabels(io.qameta.allure.model.Label... labels)
      Deprecated.
    • addLinks

      @Deprecated public static void addLinks(io.qameta.allure.model.Link... links)
      Deprecated.
    • addDescription

      @Deprecated public static void addDescription(String description)
      Deprecated.
      use description(String) instead.
    • addDescriptionHtml

      @Deprecated public static void addDescriptionHtml(String descriptionHtml)
      Deprecated.
    • addAttachment

      public static void addAttachment(String name, String content)
    • addAttachment

      public static void addAttachment(String name, String type, String content)
    • addAttachment

      public static void addAttachment(String name, String type, String content, String fileExtension)
    • addAttachment

      public static void addAttachment(String name, InputStream content)
    • 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)