use of cucumber.runtime.formatter.Plugins in project seleniumRobot by bhecquet.
the class CustomTestNGCucumberRunner method initCucumberOptions.
private void initCucumberOptions() throws URISyntaxException {
String cucumberPkg = SeleniumTestsContextManager.getGlobalContext().getCucmberPkg();
if (cucumberPkg == null) {
throw new CustomSeleniumTestsException("'cucumberPackage' parameter is not set in test NG XML file (inside <suite> tag), " + "set it to the root package where cucumber implementation resides");
}
RuntimeOptionsBuilder builder = new RuntimeOptionsBuilder();
// add cucumber implementation classes
builder.addGlue(new URI("classpath:" + cucumberPkg.replace(".", "/")));
if (!cucumberPkg.startsWith("com.seleniumtests")) {
builder.addGlue(new URI("classpath:com/seleniumtests/core/runner/cucumber"));
}
// correct issue #243: as we write to log files, colors cannot be rendered in text files
builder.setMonochrome().addFeature(FeatureWithLines.parse(SeleniumTestsContextManager.getFeaturePath())).addTagFilter(SeleniumTestsContextManager.getThreadContext().getCucumberTags().replace(" AND ", // for compatibility with old format
" and "));
for (String cucumberTest : SeleniumTestsContextManager.getThreadContext().getCucumberTests()) {
builder.addNameFilter(Pattern.compile(cucumberTest.replace("??", // Handle special regex character '?' as we
"\\?\\?")));
}
runtimeOptions = builder.build();
runtimeOptions.addUndefinedStepsPrinterIfSummaryNotDefined();
ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
BackendModuleBackendSupplier backendSupplier = new BackendModuleBackendSupplier(resourceLoader, classFinder, runtimeOptions);
bus = new TimeServiceEventBus(TimeService.SYSTEM);
plugins = new Plugins(classLoader, new PluginFactory(), runtimeOptions);
FeatureLoader featureLoader = new FeatureLoader(resourceLoader);
filters = new Filters(runtimeOptions);
this.runnerSupplier = new ThreadLocalRunnerSupplier(runtimeOptions, bus, backendSupplier);
featureSupplier = new FeaturePathFeatureSupplier(featureLoader, runtimeOptions);
}
Aggregations