• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CucumberScenarioOutline类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中cucumber.runtime.model.CucumberScenarioOutline的典型用法代码示例。如果您正苦于以下问题:Java CucumberScenarioOutline类的具体用法?Java CucumberScenarioOutline怎么用?Java CucumberScenarioOutline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CucumberScenarioOutline类属于cucumber.runtime.model包,在下文中一共展示了CucumberScenarioOutline类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setFeatures

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
public static void setFeatures(List<CucumberFeature> cucumberFeatures) {
    int numberOfScenarios = 0;
    for (CucumberFeature feature : cucumberFeatures) {
        for (CucumberTagStatement scenario : feature.getFeatureElements()) {
            if (scenario instanceof CucumberScenario) {
                numberOfScenarios++;
            } else if (scenario instanceof CucumberScenarioOutline) {
                for (CucumberExamples examples : ((CucumberScenarioOutline) scenario).getCucumberExamplesList()) {
                    numberOfScenarios += examples.getExamples().getRows().size() - 1;
                }
            }
        }
    }
    ExecutionProgress currentContextProgress = getCurrent().getProgress();
    currentContextProgress.setNumberOfFeatures(cucumberFeatures.size());
    currentContextProgress.setNumberOfScenarios(numberOfScenarios);
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:18,代码来源:CucumberContext.java


示例2: ScenarioOutlineWrapper

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
public ScenarioOutlineWrapper(FeatureWrapper feature, CucumberScenarioOutline scenarioOutline) {
    this.feature = feature;
    this.scenarioOutline = scenarioOutline;
    this.scenarios = new ArrayList<>();
    for (CucumberExamples examples : scenarioOutline.getCucumberExamplesList()) { // TODO can this be more than 1
        List<CucumberScenario> exampleScenarios = examples.createExampleScenarios();
        int count = exampleScenarios.size();
        for (int i = 0; i < count; i++) {
            CucumberScenario scenario = exampleScenarios.get(i);
            ScenarioWrapper sw = new ScenarioWrapper(feature, i, scenario, this);
            scenarios.add(sw);
        }
    }         
}
 
开发者ID:intuit,项目名称:karate,代码行数:15,代码来源:ScenarioOutlineWrapper.java


示例3: cucumberScenarios

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
private Map<CucumberFeature, Integer> cucumberScenarios(List<CucumberFeature> cucumberFeatures, RuntimeOptions runtimeOptions) {
    final Map<CucumberFeature, Integer> scenarios = new HashMap<>();

    if (cucumberFeatures != null) {
        cucumberFeatures.forEach(cucumberFeature -> cucumberFeature.getFeatureElements().forEach(featureElement -> {

            final List<Integer> lineIds = new ArrayList<>();

            if (featureElement instanceof CucumberScenarioOutline) {
                ((CucumberScenarioOutline) featureElement).getCucumberExamplesList()
                        .forEach(c -> c.getExamples().getRows().stream().skip(1).forEach(row -> {
                            lineIds.add(row.getLine());
                        }));
            } else {
                lineIds.add(featureElement.getGherkinModel().getLine());
            }

            lineIds.forEach(lineId -> {
                final AtomicBoolean alreadyAdded = new AtomicBoolean(Boolean.FALSE);

                runtimeOptions.getFeaturePaths().forEach(resourcePath -> {
                    if (!alreadyAdded.get()) {
                        final List<String> scenarioPath = new ArrayList<>();
                        addScenario(scenarioPath, cucumberFeature, resourcePath, lineId);

                        try {
                            scenarios.put(
                                    CucumberFeature.load(resourceLoader, scenarioPath, new ArrayList<>()).stream().findFirst().orElse(null),
                                    lineId);
                            alreadyAdded.set(Boolean.TRUE);
                        } catch (IllegalArgumentException e) {
                            alreadyAdded.set(Boolean.FALSE);
                        }
                    }
                });
            });
        }));
    }
    return scenarios;
}
 
开发者ID:prashant-ramcharan,项目名称:courgette-jvm,代码行数:41,代码来源:CourgetteFeatureLoader.java


示例4: addFeatureElements

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
private void addFeatureElements(CucumberFeature feature) {
	for (CucumberTagStatement tagStatement : feature.getFeatureElements()) {
		if (tagStatement instanceof CucumberScenarioOutline)
			addScenarioOutline((CucumberScenarioOutline) tagStatement);
		else if (tagStatement instanceof CucumberScenario)
			addScenario((CucumberScenario) tagStatement);
	}
}
 
开发者ID:djb61,项目名称:parallel-cucumber-jvm,代码行数:9,代码来源:RerunFileBuilder.java


示例5: RestScenarioOutlineRunner

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
public RestScenarioOutlineRunner(RestRuntime runtime,
   CucumberScenarioOutline cucumberScenarioOutline, RestJUnitReporter jUnitReporter,
   CucumberFeature cucumberFeature) throws InitializationError {
   super(null, buildRunners(runtime, cucumberScenarioOutline, jUnitReporter,
      cucumberFeature));
   this.cucumberScenarioOutline = cucumberScenarioOutline;
   this.jUnitReporter = jUnitReporter;
   this.runtime = runtime;
   this.cucumberFeature = cucumberFeature;
}
 
开发者ID:LiamHayes1,项目名称:rest-cucumber,代码行数:11,代码来源:RestScenarioOutlineRunner.java


示例6: buildRunners

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
private static List<Runner> buildRunners(RestRuntime runtime,
   CucumberScenarioOutline cucumberScenarioOutline, RestJUnitReporter jUnitReporter,
   CucumberFeature cucumberFeature) throws InitializationError {
   List<Runner> runners = new ArrayList<Runner>();
   for (CucumberExamples cucumberExamples : cucumberScenarioOutline
      .getCucumberExamplesList()) {
      runners.add(new RestExampleRunner(runtime, cucumberExamples, jUnitReporter,
         cucumberFeature));
   }
   return runners;
}
 
开发者ID:LiamHayes1,项目名称:rest-cucumber,代码行数:12,代码来源:RestScenarioOutlineRunner.java


示例7: convert

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
public Feature convert(CucumberFeature cucumberFeature) {
    Feature feature = new Feature(cucumberFeature.getUri());
    for (CucumberTagStatement featureElement : cucumberFeature.getFeatureElements()) {
        if (featureElement instanceof CucumberScenario) {
            feature.add(convert((CucumberScenario) featureElement));
        } else if (featureElement instanceof CucumberScenarioOutline) {
            feature.add(convert((CucumberScenarioOutline) featureElement));
        }
    }
    return feature;
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:12,代码来源:CucumberConverter.java


示例8: testLoadExternalWithExamples

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
@Test
public void testLoadExternalWithExamples() throws IOException {
    List<CucumberFeature> features = new ArrayList<CucumberFeature>();
    try (MiniumFeatureBuilder builder = new MiniumFeatureBuilder(features)) {
        Resource resource = createResourceMock("example-with-comments.feature");
        builder.parse(resource, NO_FILTERS);
    }

    CucumberScenarioOutline cucumberScenarioOutline = (CucumberScenarioOutline) features.get(0).getFeatureElements().get(0);
    assertEquals(8, cucumberScenarioOutline.getCucumberExamplesList().get(0).getExamples().getRows().size());
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:12,代码来源:FeatureDecoratorTest.java


示例9: testNormalFeatureWithoutLoadData

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
@Test
public void testNormalFeatureWithoutLoadData() throws IOException {
    List<CucumberFeature> features = new ArrayList<CucumberFeature>();
    try (MiniumFeatureBuilder builder = new MiniumFeatureBuilder(features)) {
        Resource resource = createResourceMock("example-without-comments.feature");
        builder.parse(resource, NO_FILTERS);
    }
    CucumberScenarioOutline cucumberScenarioOutline = (CucumberScenarioOutline) features.get(0).getFeatureElements().get(0);
    assertEquals(4, cucumberScenarioOutline.getCucumberExamplesList().get(0).getExamples().getRows().size());

    CucumberScenario cucumberScenario = (CucumberScenario) features.get(0).getFeatureElements().get(1);
    assertEquals(3, cucumberScenario.getSteps().get(1).getRows().size());
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:14,代码来源:FeatureDecoratorTest.java


示例10: getScenarioOutline

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
public CucumberScenarioOutline getScenarioOutline() {
    return scenarioOutline;
}
 
开发者ID:intuit,项目名称:karate,代码行数:4,代码来源:ScenarioOutlineWrapper.java


示例11: addScenarioOutline

import cucumber.runtime.model.CucumberScenarioOutline; //导入依赖的package包/类
private void addScenarioOutline(CucumberScenarioOutline cucumberScenarioOutline) {
	for (CucumberExamples cucumberExamples : cucumberScenarioOutline.getCucumberExamplesList())
		for (CucumberScenario cucumberScenario : cucumberExamples.createExampleScenarios())
			addScenario(cucumberScenario);
}
 
开发者ID:djb61,项目名称:parallel-cucumber-jvm,代码行数:6,代码来源:RerunFileBuilder.java



注:本文中的cucumber.runtime.model.CucumberScenarioOutline类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BeanSerializerFactory类代码示例发布时间:2022-05-23
下一篇:
Java ConfigurationProperty类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap