本文整理了Java中gherkin.formatter.model.Feature.getName()
方法的一些代码示例,展示了Feature.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feature.getName()
方法的具体详情如下:
包路径:gherkin.formatter.model.Feature
类名称:Feature
方法名:getName
暂无
代码示例来源:origin: com.foreach.cwb/cwb-core
private String getName( Feature feature ) {
return escape( feature.getName() );
}
}
代码示例来源:origin: info.cukes/gherkin
@Override
public void feature(Feature feature) {
featureTags = feature.getTags();
featureName = feature.getName();
featureEvents = new ArrayList<BasicStatement>();
featureEvents.add(feature);
}
代码示例来源:origin: ctco/cukes
private String extractFeatureName() {
return cucumberFeature.getGherkinFeature().getName();
}
代码示例来源: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.jenkins-ci.plugins/cucumber-testresult-plugin
@Exported(visibility=9)
public String getName() {
return feature.getName();
}
代码示例来源:origin: lv.ctco.cukesrest/cukes-rest-loadrunner
private String extractFeatureName() {
return cucumberFeature.getGherkinFeature().getName();
}
代码示例来源:origin: org.technbolts.tzatziki/tzatziki-core
@Override
public void feature(Feature feature) {
log.debug("feature: {}", feature.getName());
currentStep = null;
currentStepContainer = null;
stepIterator = null;
flushCurrentFeature();
this.currentFeature = converter.convertFeature(currentUri, feature);
}
代码示例来源:origin: com.infotel.seleniumRobot/core
/**
*
* @param allFeatures
* @param selectedFeatures
* @param testList
* @return Cucumber feature list of selected tests
*/
private List<CucumberFeature> selectFeatures(final List<CucumberFeature> allFeatures, List<CucumberFeature> selectedFeatures,
List<String> testList){
for (CucumberFeature feature: allFeatures) {
String featureName = feature.getGherkinFeature().getName();
String featureFileName = FilenameUtils.getBaseName(feature.getPath());
for (String test: testList) {
if (featureName.matches(test) || test.equals(featureFileName)) {
selectedFeatures.add(feature);
break;
}
}
}
return selectedFeatures;
}
代码示例来源:origin: com.github.becausetesting/commons
@Override
public String getName() {
Feature feature = cucumberFeature.getGherkinFeature();
return feature.getKeyword() + ": " + feature.getName();
}
代码示例来源:origin: com.github.becauseQA/becauseQA-utils
@Override
public String getName() {
Feature feature = cucumberFeature.getGherkinFeature();
return feature.getKeyword() + ": " + feature.getName();
}
代码示例来源:origin: com.foreach.cwb/cwb-core
@Override
public void feature( Feature feature ) {
super.feature( feature );
MDC.put( "prefix", PREFIX_FEATURE );
countFeature();
LOG.info( "=========================================================" );
LOG.info( feature.getName() );
LOG.info( "=========================================================" );
MDC.remove( "prefix" );
LOG.info( "" );
}
代码示例来源: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: org.jbehave/jbehave-gherkin
public void feature(Feature feature) {
out.append(feature.getName()).append("\n\n");
writeNarrative(feature.getDescription());
writeMeta(feature.getTags());
}
代码示例来源: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: 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: ru.yandex.qatools.allure/allure-cucumber-jvm-adaptor
annotations.add(getFeaturesAnnotation(feature.getName()));
annotations.add(getStoriesAnnotation(scenario.getName()));
annotations.add(getDescriptionAnnotation(scenario.getDescription()));
代码示例来源: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: 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: 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: 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;
}
内容来源于网络,如有侵权,请联系作者删除!