gherkin.formatter.model.Feature类的使用及代码示例

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

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

Feature介绍

暂无

代码示例

代码示例来源:origin: info.cukes/gherkin

@Override
public void feature(Feature feature) {
  printComments(feature.getComments(), "");
  printTags(feature.getTags(), "");
  out.println(feature.getKeyword() + ": " + feature.getName());
  printDescription(feature.getDescription(), "  ", false);
}

代码示例来源:origin: info.cukes/gherkin

@Override
public void feature(Feature feature) {
  featureTags = feature.getTags();
  featureName = feature.getName();
  featureEvents = new ArrayList<BasicStatement>();
  featureEvents.add(feature);
}

代码示例来源:origin: com.github.becausetesting/commons

@Override
public String getName() {
  Feature feature = cucumberFeature.getGherkinFeature();
  return feature.getKeyword() + ": " + feature.getName();
}

代码示例来源:origin: org.jbehave/jbehave-gherkin

public void feature(Feature feature) {
  out.append(feature.getName()).append("\n\n");
  writeNarrative(feature.getDescription());
  writeMeta(feature.getTags());
}

代码示例来源:origin: com.foreach.cwb/cwb-core

private String getName( Feature feature ) {
    return escape( feature.getName() );
  }
}

代码示例来源:origin: ru.yandex.qatools.allure/allure-cucumber-jvm-adaptor

@Override
public void feature(Feature feature) {
  this.feature = feature;
  uid = UUID.randomUUID().toString();
  TestSuiteStartedEvent event = new TestSuiteStartedEvent(uid, feature.getName());
  Collection<Annotation> annotations = new ArrayList<>();
  annotations.add(getDescriptionAnnotation(feature.getDescription()));
  annotations.add(getFeaturesAnnotation(feature.getName()));
  AnnotationManager am = new AnnotationManager(annotations);
  am.update(event);
  ALLURE_LIFECYCLE.fire(event);
}

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

protected boolean getStatusDetailByTag(final String tagName) {
  return scenario.getTags().stream()
      .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName))
      || feature.getTags().stream()
      .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName));
}

代码示例来源:origin: org.jenkins-ci.plugins/cucumber-testresult-plugin

@Override
public synchronized String getSafeName() {
  if (safeName != null) {
    return safeName;
  }
  safeName = uniquifyName(parent.getChildren(), safe(feature.getId()));
  return safeName;
}

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

public Optional<Narrative> loadFeatureNarrative(File narrativeFile)  {
  CucumberFeatureListener gherkinStructure =new CucumberFeatureListener();
  Parser parser = new Parser(gherkinStructure, true, "root", false, locale);
  try {
    String gherkinScenarios = filterOutCommentsFrom(FileUtils.readFileToString(narrativeFile));
    parser.parse(gherkinScenarios, narrativeFile.getName(),0);
    String cardNumber = findCardNumberInTags(gherkinStructure.getFeature().getTags());
    List<String> versionNumbers = findVersionNumberInTags(gherkinStructure.getFeature().getTags());
    String title = gherkinStructure.getFeature().getName();
    String text = gherkinStructure.getFeature().getDescription();
    return Optional.of(new Narrative(Optional.fromNullable(title),
        Optional.fromNullable(cardNumber),
        versionNumbers,
        "feature",
        text));
  } catch (IOException ex) {
    ex.printStackTrace();
  }
  return Optional.absent();
}

代码示例来源:origin: com.foreach.cwb/cwb-core

private void writeElement( Document doc, Element tc ) {
  tc.setAttribute( "classname", feature.getName() );
  tc.setAttribute( "name", calculateElementName( scenario ) );
}

代码示例来源:origin: org.technbolts.tzatziki/tzatziki-core

public Feature convert(CucumberFeature cucumberFeature) {
  Feature feature = new Feature(cucumberFeature.getPath(), cucumberFeature.getGherkinFeature().getName());
  feature.addTags(convertTags(cucumberFeature.getGherkinFeature().getTags()));
  for (CucumberTagStatement featureElement : cucumberFeature.getFeatureElements()) {
    if (featureElement instanceof CucumberScenario) {
      CucumberScenario scenario = (CucumberScenario) featureElement;
      feature.add(convertScenario(scenario));
      // Workaround... no way to retrieve the background
      CucumberBackground cucumberBackground = scenario.getCucumberBackground();
      if (cucumberBackground != null)
        feature.background(convertBackground(cucumberBackground));
    } else if (featureElement instanceof CucumberScenarioOutline) {
      CucumberScenarioOutline scenarioOutline = (CucumberScenarioOutline) featureElement;
      feature.add(convertOutline(scenarioOutline));
    }
  }
  return feature;
}

代码示例来源:origin: com.github.becauseQA/becauseQA-utils

@Override
public String getName() {
  Feature feature = cucumberFeature.getGherkinFeature();
  return feature.getKeyword() + ": " + feature.getName();
}

代码示例来源:origin: org.jenkins-ci.plugins/cucumber-testresult-plugin

featuresById.put(fr.getSafeName(), fr);
for (ScenarioResult scenarioResult : fr.getChildren()) {
  for (Tag tag : scenarioResult.getParent().getFeature().getTags()) {
    TagResult tr = tagMap.get(tag.getName());
    if (tr == null) {

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

protected String getStepUuid(final Step step) {
  return feature.getId() + scenario.getId() + step.getName() + step.getLine();
}

代码示例来源:origin: org.jenkins-ci.plugins/cucumber-testresult-plugin

public void feature(Feature feature) {
  if (LOG.isLoggable(Level.FINE)) {
    LOG.log(Level.FINE, "Feature: " + feature.getKeyword() + feature.getName());
    List<Tag> tags = feature.getTags();
    for (Tag tag : tags) {
      LOG.log(Level.FINE, "         " + tag.getName());
    }
    LOG.log(Level.FINE, "         " + feature.getDescription());
  }
  // a new feature being received signals the end of the previous feature
  currentFeatureResult = new FeatureResult(currentURI, feature);
  currentURI = null;
  testResult.addFeatureResult(currentFeatureResult);
}

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

@Override
public void startOfScenarioLifeCycle(final Scenario scenario) {
  this.currentScenario = scenario;
  final Deque<Tag> tags = new LinkedList<>(scenario.getTags());
  if (SCENARIO_OUTLINE_KEYWORDS.contains(scenario.getKeyword())) {
    synchronized (gherkinSteps) {
      gherkinSteps.clear();
    }
  } else {
    tags.addAll(currentFeature.getTags());
  }
  final LabelBuilder labelBuilder = new LabelBuilder(currentFeature, scenario, tags);
  final String uuid = UUID.randomUUID().toString();
  scenarioUuids.put(scenario, uuid);
  final TestResult result = new TestResult()
      .setUuid(uuid)
      .setHistoryId(StepUtils.getHistoryId(scenario.getId()))
      .setFullName(String.format("%s: %s", currentFeature.getName(), scenario.getName()))
      .setName(scenario.getName())
      .setLabels(labelBuilder.getScenarioLabels())
      .setLinks(labelBuilder.getScenarioLinks());
  if (!currentFeature.getDescription().isEmpty()) {
    result.setDescription(currentFeature.getDescription());
  }
  lifecycle.scheduleTestCase(result);
  lifecycle.startTestCase(uuid);
}

代码示例来源:origin: org.jenkins-ci.plugins/cucumber-testresult-plugin

@Exported(visibility=9)
public String getName() {
  return feature.getName();
}

代码示例来源:origin: com.epam.reportportal/agent-java-cucumber

/**
 * Start Cucumber feature
 *
 * @param feature Step feature
 */
protected void beforeFeature(Feature feature) {
  StartTestItemRQ rq = new StartTestItemRQ();
  Maybe<String> root = getRootItemId();
  rq.setDescription(Utils.buildStatementName(feature, null, AbstractReporter.COLON_INFIX, null));
  rq.setName(currentFeatureUri);
  rq.setTags(extractTags(feature.getTags()));
  rq.setStartTime(Calendar.getInstance().getTime());
  rq.setType(getFeatureTestItemType());
  if (null == root) {
    currentFeatureId = RP.get().startTestItem(rq);
  } else {
    currentFeatureId = RP.get().startTestItem(root, rq);
  }
}

代码示例来源:origin: org.technbolts.tzatziki/tzatziki-core

public FeatureExec convertFeature(String uri, Feature feature) {
  FeatureExec featureExec = new FeatureExec(uri, feature.getKeyword(), feature.getName());
  featureExec.declareTags(convertTags(feature.getTags()));
  featureExec.declareComments(convertComments(feature.getComments()));
  featureExec.declareDescription(feature.getDescription());
  return featureExec;
}

代码示例来源:origin: lv.ctco.cukesrest/cukes-rest-loadrunner

private String extractFeatureName() {
  return cucumberFeature.getGherkinFeature().getName();
}

相关文章