本文整理汇总了Java中cucumber.api.junit.Cucumber类的典型用法代码示例。如果您正苦于以下问题:Java Cucumber类的具体用法?Java Cucumber怎么用?Java Cucumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Cucumber类属于cucumber.api.junit包,在下文中一共展示了Cucumber类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CucumberExt
import cucumber.api.junit.Cucumber; //导入依赖的package包/类
/**
* Constructor called by JUnit.
*
* @param clazz the class with the @RunWith annotation.
* @throws java.io.IOException if there is a problem
* @throws org.junit.runners.model.InitializationError
* if there is another problem
*/
public CucumberExt(Class clazz) throws InitializationError, IOException {
super(clazz);
ClassLoader classLoader = clazz.getClassLoader();
Assertions.assertNoCucumberAnnotatedMethods(clazz);
@SuppressWarnings("unchecked")
RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(clazz, new Class[]{CucumberOptions.class, Cucumber.Options.class});
RuntimeOptions runtimeOptions = runtimeOptionsFactory.create();
ResourceLoader resourceLoader = createResourceLoader(clazz);
ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
runtime = new Runtime(resourceLoader, classFinder, classLoader, runtimeOptions);
jUnitReporter = new JUnitReporter(runtimeOptions.reporter(classLoader), runtimeOptions.formatter(classLoader), runtimeOptions.isStrict());
addChildren(runtimeOptions.cucumberFeatures(resourceLoader));
}
示例2: testRunCucumber
import cucumber.api.junit.Cucumber; //导入依赖的package包/类
/**
* The entry point to the Cucumber test. Sets up the test case and runs it.
*/
@Test
public void testRunCucumber() {
try {
Cucumber cucumber = new Cucumber(this.getClass());
RunNotifier notifier = new RunNotifier();
notifier.addFirstListener(new CucumberEventListener());
GenericListTestSuite.getGlobalDataStorage().put(this.getClass().toString(), this);
cucumber.run(notifier);
} catch (InitializationError | IOException e) {
naTestCase("Cucumber Run Initialization Error: " + e.getMessage());
}
}
示例3: AerialRunner
import cucumber.api.junit.Cucumber; //导入依赖的package包/类
public AerialRunner(Class<?> clazzValue) throws Exception {
clazz = clazzValue;
String[] args = AerialMain.toArgs(clazz);
AerialMain.main(args);
cucumber = new Cucumber(clazz);
}