本文整理匯總了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);
}