本文整理汇总了Java中cucumber.runtime.model.CucumberScenario类的典型用法代码示例。如果您正苦于以下问题:Java CucumberScenario类的具体用法?Java CucumberScenario怎么用?Java CucumberScenario使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CucumberScenario类属于cucumber.runtime.model包,在下文中一共展示了CucumberScenario类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setFeatures
import cucumber.runtime.model.CucumberScenario; //导入依赖的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.CucumberScenario; //导入依赖的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: addFeatureElements
import cucumber.runtime.model.CucumberScenario; //导入依赖的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
示例4: addScenario
import cucumber.runtime.model.CucumberScenario; //导入依赖的package包/类
private void addScenario(CucumberScenario cucumberScenario) {
Scenario scenario = (Scenario) cucumberScenario.getGherkinModel();
formatter.startOfScenarioLifeCycle(scenario);
formatter.scenario(scenario);
reporter.result(new Result(Result.FAILED, 0L, ""));
formatter.endOfScenarioLifeCycle(scenario);
}
开发者ID:djb61,项目名称:parallel-cucumber-jvm,代码行数:8,代码来源:RerunFileBuilder.java
示例5: buildRunners
import cucumber.runtime.model.CucumberScenario; //导入依赖的package包/类
private static List<Runner> buildRunners(RestRuntime runtime,
CucumberExamples cucumberExamples, RestJUnitReporter jUnitReporter,
CucumberFeature cucumberFeature) {
List<Runner> runners = new ArrayList<Runner>();
List<CucumberScenario> exampleScenarios = cucumberExamples.createExampleScenarios();
for (CucumberScenario scenario : exampleScenarios) {
try {
ExecutionUnitRunner exampleScenarioRunner =
new RestExecutionUnitRunner(runtime, scenario, jUnitReporter,
cucumberFeature);
runners.add(exampleScenarioRunner);
} catch (InitializationError e) {
throw new CucumberInitException(e);
}
}
return runners;
}
开发者ID:LiamHayes1,项目名称:rest-cucumber,代码行数:18,代码来源:RestExampleRunner.java
示例6: RestExecutionUnitRunner
import cucumber.runtime.model.CucumberScenario; //导入依赖的package包/类
public RestExecutionUnitRunner(RestRuntime runtime,
CucumberTagStatement cucumberScenario, RestJUnitReporter jUnitReporter,
CucumberFeature cucumberFeature) throws InitializationError {
super(runtime.getRuntime(), (CucumberScenario) cucumberScenario, jUnitReporter);
this.runtime = Validate.notNull(runtime);
this.cucumberFeature = Validate.notNull(cucumberFeature);
}
开发者ID:LiamHayes1,项目名称:rest-cucumber,代码行数:8,代码来源:RestExecutionUnitRunner.java
示例7: aroundAddIgnoreTagPointcut
import cucumber.runtime.model.CucumberScenario; //导入依赖的package包/类
/**
* @param pjp ProceedingJoinPoint
* @param formatter formatter
* @param reporter reporter
* @param runtime runtime
* @throws Throwable exception
*/
@Around(value = "addIgnoreTagPointcutScenario(formatter, reporter, runtime)")
public void aroundAddIgnoreTagPointcut(ProceedingJoinPoint pjp, Formatter formatter, Reporter reporter,
Runtime runtime) throws Throwable {
CucumberScenario scen = (CucumberScenario) pjp.getThis();
Scenario scenario = (Scenario) scen.getGherkinModel();
Class<?> sc = scen.getClass();
Method tt = sc.getSuperclass().getDeclaredMethod("tagsAndInheritedTags");
tt.setAccessible(true);
Set<Tag> tags = (Set<Tag>) tt.invoke(scen);
List<String> tagList = new ArrayList<>();
String scenarioName = scenario.getName();
tagList = tags.stream().map(Tag::getName).collect(Collectors.toList());
ignoreReasons exitReason = manageTags(tagList, scenarioName);
if (exitReason.equals(NOREASON)) {
logger.error("Scenario '" + scenario.getName() + "' failed due to wrong use of the @ignore tag. ");
}
if ((!(exitReason.equals(NOTIGNORED))) && (!(exitReason.equals(NOREASON)))) {
runtime.buildBackendWorlds(reporter, tags, scenario.getName());
formatter.startOfScenarioLifeCycle(scenario);
formatter.endOfScenarioLifeCycle(scenario);
runtime.disposeBackendWorlds();
} else {
pjp.proceed();
}
}
开发者ID:Stratio,项目名称:bdt,代码行数:38,代码来源:IgnoreTagAspect.java
示例8: convert
import cucumber.runtime.model.CucumberScenario; //导入依赖的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
示例9: testLoadDataWithDataTable
import cucumber.runtime.model.CucumberScenario; //导入依赖的package包/类
@Test
public void testLoadDataWithDataTable() throws IOException {
List<CucumberFeature> features = new ArrayList<CucumberFeature>();
try (MiniumFeatureBuilder builder = new MiniumFeatureBuilder(features)) {
Resource resource = createResourceMock("example-with-data-table.feature");
builder.parse(resource, NO_FILTERS);
}
CucumberScenario cucumberScenario = (CucumberScenario) features.get(0).getFeatureElements().get(0);
assertEquals(4, cucumberScenario.getSteps().get(1).getRows().size());
}
开发者ID:viltgroup,项目名称:minium,代码行数:12,代码来源:FeatureDecoratorTest.java
示例10: testNormalFeatureWithoutLoadData
import cucumber.runtime.model.CucumberScenario; //导入依赖的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
示例11: getScenario
import cucumber.runtime.model.CucumberScenario; //导入依赖的package包/类
public CucumberScenario getScenario() {
return scenario;
}
开发者ID:intuit,项目名称:karate,代码行数:4,代码来源:ScenarioWrapper.java
示例12: addScenarioOutline
import cucumber.runtime.model.CucumberScenario; //导入依赖的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
示例13: ScenarioTestUnit
import cucumber.runtime.model.CucumberScenario; //导入依赖的package包/类
public ScenarioTestUnit(Class<?> junitTestClass, CucumberScenario scenario) {
this.junitTestClass = junitTestClass;
this.scenario = scenario;
}
开发者ID:alexvictoor,项目名称:pitest-cucumber-plugin,代码行数:5,代码来源:ScenarioTestUnit.java
注:本文中的cucumber.runtime.model.CucumberScenario类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论