io.qameta.allure.Allure.getLifecycle()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(261)

本文整理了Java中io.qameta.allure.Allure.getLifecycle()方法的一些代码示例,展示了Allure.getLifecycle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Allure.getLifecycle()方法的具体详情如下:
包路径:io.qameta.allure.Allure
类名称:Allure
方法名:getLifecycle

Allure.getLifecycle介绍

[英]Returns AllureLifecycle for low lever operations with results.
[中]返回低杠杆操作的AllureLifecycle,并显示结果。

代码示例

代码示例来源:origin: io.qameta.allure/allure-java-commons

@Override
  protected AllureLifecycle initialValue() {
    return Allure.getLifecycle();
  }
};

代码示例来源:origin: io.qameta.allure/allure-java-commons

@Override
  protected AllureLifecycle initialValue() {
    return Allure.getLifecycle();
  }
};

代码示例来源:origin: io.qameta.allure/allure-cucumber-jvm

StepUtils(final Feature feature, final Scenario scenario) {
  this.lifecycle = Allure.getLifecycle();
  this.feature = feature;
  this.scenario = scenario;
}

代码示例来源:origin: io.qameta.allure/allure-cucumber-jvm

@SuppressWarnings("unused")
public AllureCucumberJvm() {
  this(Allure.getLifecycle());
}

代码示例来源:origin: io.qameta.allure/allure-cucumber2-jvm

@SuppressWarnings("unused")
public AllureCucumber2Jvm() {
  this(Allure.getLifecycle());
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

@SuppressWarnings("PMD.UseObjectForClearerAPI")
public static void addAttachment(final String name, final String type,
                 final String content, final String fileExtension) {
  getLifecycle().addAttachment(name, type, fileExtension, content.getBytes(StandardCharsets.UTF_8));
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

@SuppressWarnings("PMD.UseObjectForClearerAPI")
public static void addAttachment(final String name, final String type,
                 final InputStream content, final String fileExtension) {
  getLifecycle().addAttachment(name, type, fileExtension, content);
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

public static CompletableFuture<byte[]> addByteAttachmentAsync(
    final String name, final String type, final String fileExtension, final Supplier<byte[]> body) {
  final String source = getLifecycle().prepareAttachment(name, type, fileExtension);
  return supplyAsync(body).whenComplete((result, ex) ->
      getLifecycle().writeAttachment(source, new ByteArrayInputStream(result)));
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

public static void addAttachment(final String name, final String content) {
  getLifecycle().addAttachment(name, TEXT_PLAIN, TXT_EXTENSION, content.getBytes(StandardCharsets.UTF_8));
}

代码示例来源:origin: Frameworkium/frameworkium-core

public static void stepFinish() {
    getLifecycle().stopStep(STEP_UUID_STACK.get().removeFirst());
  }
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

/**
 * @deprecated use {@link #label(String, String)} instead.
 */
@Deprecated
public static void addLabels(final Label... labels) {
  getLifecycle().updateTestCase(testResult -> testResult.getLabels().addAll(asList(labels)));
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

/**
 * @deprecated use {@link #link(String, String, String)} instead.
 */
@Deprecated
public static void addLinks(final Link... links) {
  getLifecycle().updateTestCase(testResult -> testResult.getLinks().addAll(asList(links)));
}

代码示例来源:origin: Frameworkium/frameworkium-core

public static void stepStart(String stepName) {
  StepResult result = new StepResult().setName(stepName);
  String uuid = UUID.randomUUID().toString();
  getLifecycle().startStep(uuid, result);
  STEP_UUID_STACK.get().addFirst(uuid);
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

/**
 * 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.
 *
 * @param name   the name of step.
 * @param status the step status.
 */
public static void step(final String name, final Status status) {
  final String uuid = UUID.randomUUID().toString();
  getLifecycle().startStep(uuid, new StepResult().setName(name).setStatus(status));
  getLifecycle().stopStep(uuid);
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

/**
 * Adds descriptionHtml to current test or step (or fixture) if any. Takes no effect
 * if no test run at the moment. Note that description will take no effect if descriptionHtml is
 * specified.
 *
 * @param descriptionHtml the description in html format.
 * @see #description(String)
 */
public static void descriptionHtml(final String descriptionHtml) {
  getLifecycle().updateTestCase(executable -> executable.setDescriptionHtml(descriptionHtml));
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

/**
 * Adds description to current test or step (or fixture) if any. Takes no effect
 * if no test run at the moment. Expecting description provided in Markdown format.
 *
 * @param description the description in markdown format.
 * @see #descriptionHtml(String)
 */
public static void description(final String description) {
  getLifecycle().updateTestCase(executable -> executable.setDescription(description));
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

/**
 * Adds label to current test or step (or fixture) if any. Takes no effect
 * if no test run at the moment.
 *
 * @param name  the name of label.
 * @param value the value of label.
 */
public static void label(final String name, final String value) {
  final Label label = new Label().setName(name).setValue(value);
  getLifecycle().updateTestCase(testResult -> testResult.getLabels().add(label));
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

/**
 * Adds parameter to current test or step (or fixture) if any. Takes no effect
 * if no test run at the moment.
 *
 * @param name  the name of parameter.
 * @param value the value of parameter.
 */
public static <T> T parameter(final String name, final T value) {
  final Parameter parameter = new Parameter().setName(name).setValue(ObjectUtils.toString(value));
  getLifecycle().updateTestCase(testResult -> testResult.getParameters().add(parameter));
  return value;
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

/**
 * Adds link to current test or step (or fixture) if any. Takes no effect
 * if no test run at the moment.
 *
 * @param name the name of link.
 * @param type the type of link, used to display link icon in the report.
 * @param url  the link's url.
 */
public static void link(final String name, final String type, final String url) {
  final Link link = new Link().setName(name).setType(type).setUrl(url);
  getLifecycle().updateTestCase(testResult -> testResult.getLinks().add(link));
}

代码示例来源:origin: io.qameta.allure/allure-java-commons

@Override
  public <T> T parameter(final String name, final T value) {
    final Parameter param = new Parameter().setName(name).setValue(ObjectUtils.toString(value));
    getLifecycle().updateStep(uuid, stepResult -> stepResult.getParameters().add(param));
    return value;
  }
}

相关文章

Allure类方法