gherkin.ast.Feature.getDescription()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(111)

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

Feature.getDescription介绍

暂无

代码示例

代码示例来源:origin: cucumber/cucumber-jvm

private Map<String, Object> createFeature(TestCase testCase) {
  Map<String, Object> featureMap = new HashMap<String, Object>();
  Feature feature = testSources.getFeature(testCase.getUri());
  if (feature != null) {
    featureMap.put("keyword", feature.getKeyword());
    featureMap.put("name", feature.getName());
    featureMap.put("description", feature.getDescription() != null ? feature.getDescription() : "");
    if (!feature.getTags().isEmpty()) {
      featureMap.put("tags", createTagList(feature.getTags()));
    }
  }
  return featureMap;
}

代码示例来源:origin: cucumber/cucumber-jvm

private Map<String, Object> createFeatureMap(TestCase testCase) {
  Map<String, Object> featureMap = new HashMap<String, Object>();
  featureMap.put("uri", testCase.getUri());
  featureMap.put("elements", new ArrayList<Map<String, Object>>());
  Feature feature = testSources.getFeature(testCase.getUri());
  if (feature != null) {
    featureMap.put("keyword", feature.getKeyword());
    featureMap.put("name", feature.getName());
    featureMap.put("description", feature.getDescription() != null ? feature.getDescription() : "");
    featureMap.put("line", feature.getLocation().getLine());
    featureMap.put("id", TestSourcesModel.convertToId(feature.getName()));
    featureMap.put("tags", feature.getTags());
  }
  return featureMap;
}

代码示例来源:origin: cucumber/cucumber-jvm

private void printFeature(String path) {
  Feature feature = testSources.getFeature(path);
  printTags(feature.getTags());
  out.println(feature.getKeyword() + ": " + feature.getName());
  printDescription(feature.getDescription());
}

代码示例来源:origin: net.serenity-bdd/serenity-model

private String descriptionWithScenarioReferencesFrom(Feature feature) {
  if (feature.getDescription() == null) { return ""; }
  return stream(feature.getDescription().split("\\r?\\n"))
      .map(line -> DescriptionWithScenarioReferences.from(feature).forText(line))
      .collect(Collectors.joining(lineSeparator()));
}

代码示例来源:origin: net.serenity-bdd/serenity-cucumber

private Story userStoryFrom(Feature feature, String featureFileUri) {
  Story userStory = Story.withIdAndPath(TestSourcesModel.convertToId(feature.getName()), feature.getName(), featureFileUri).asFeature();
  if (!isEmpty(feature.getDescription())) {
    userStory = userStory.withNarrative(feature.getDescription());
  }
  return userStory;
}

代码示例来源:origin: serenity-bdd/serenity-cucumber

private Story userStoryFrom(Feature feature, String featureFileUri) {
  Story userStory = Story.withIdAndPath(TestSourcesModel.convertToId(feature.getName()), feature.getName(), featureFileUri).asFeature();
  if (!isEmpty(feature.getDescription())) {
    userStory = userStory.withNarrative(feature.getDescription());
  }
  return userStory;
}

代码示例来源:origin: serenity-bdd/serenity-cucumber

private Feature featureWithDefaultName(Feature feature, String defaultName) {
  return new Feature(feature.getTags(),
      feature.getLocation(),
      feature.getLanguage(),
      feature.getKeyword(),
      defaultName,
      feature.getDescription(),
      feature.getChildren());
}

代码示例来源:origin: net.serenity-bdd/serenity-cucumber

private Feature featureWithDefaultName(Feature feature, String defaultName) {
  return new Feature(feature.getTags(),
      feature.getLocation(),
      feature.getLanguage(),
      feature.getKeyword(),
      defaultName,
      feature.getDescription(),
      feature.getChildren());
}

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

private void handleTestCaseStarted(final TestCaseStarted event) {
  currentFeatureFile = event.testCase.getUri();
  currentFeature = cucumberSourceUtils.getFeature(currentFeatureFile);
  currentTestCase = event.testCase;
  final Deque<PickleTag> tags = new LinkedList<>(event.testCase.getTags());
  final LabelBuilder labelBuilder = new LabelBuilder(currentFeature, event.testCase, tags);
  final String name = event.testCase.getName();
  final String featureName = currentFeature.getName();
  final TestResult result = new TestResult()
      .setUuid(getTestCaseUuid(event.testCase))
      .setHistoryId(getHistoryId(event.testCase))
      .setFullName(String.format("%s: %s", featureName, name))
      .setName(name)
      .setLabels(labelBuilder.getScenarioLabels())
      .setLinks(labelBuilder.getScenarioLinks());
  final ScenarioDefinition scenarioDefinition =
      cucumberSourceUtils.getScenarioDefinition(currentFeatureFile, currentTestCase.getLine());
  if (scenarioDefinition instanceof ScenarioOutline) {
    result.setParameters(
        getExamplesAsParameters((ScenarioOutline) scenarioDefinition)
    );
  }
  if (currentFeature.getDescription() != null && !currentFeature.getDescription().isEmpty()) {
    result.setDescription(currentFeature.getDescription());
  }
  lifecycle.scheduleTestCase(result);
  lifecycle.startTestCase(getTestCaseUuid(event.testCase));
}

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

private void handleTestCaseStarted(final TestCaseStarted event) {
  currentFeatureFile = event.testCase.getUri();
  currentFeature = cucumberSourceUtils.getFeature(currentFeatureFile);
  currentTestCase = event.testCase;
  final Deque<PickleTag> tags = new LinkedList<>(event.testCase.getTags());
  final LabelBuilder labelBuilder = new LabelBuilder(currentFeature, event.testCase, tags);
  final String name = event.testCase.getName();
  final String featureName = currentFeature.getName();
  final TestResult result = new TestResult()
      .setUuid(getTestCaseUuid(event.testCase))
      .setHistoryId(getHistoryId(event.testCase))
      .setFullName(String.format("%s: %s", featureName, name))
      .setName(name)
      .setLabels(labelBuilder.getScenarioLabels())
      .setLinks(labelBuilder.getScenarioLinks());
  final ScenarioDefinition scenarioDefinition =
      cucumberSourceUtils.getScenarioDefinition(currentFeatureFile, currentTestCase.getLine());
  if (scenarioDefinition instanceof ScenarioOutline) {
    result.setParameters(
        getExamplesAsParameters((ScenarioOutline) scenarioDefinition)
    );
  }
  if (currentFeature.getDescription() != null && !currentFeature.getDescription().isEmpty()) {
    result.setDescription(currentFeature.getDescription());
  }
  lifecycle.scheduleTestCase(result);
  lifecycle.startTestCase(getTestCaseUuid(event.testCase));
}

代码示例来源:origin: trivago/cucable-plugin

String featureName = feature.getKeyword() + ": " + feature.getName();
String featureLanguage = feature.getLanguage();
String featureDescription = feature.getDescription();
List<String> featureTags =
    gherkinToCucableConverter.convertGherkinTagsToCucableTags(feature.getTags());

相关文章