public Builder withArg(final String arg) { this.runtimeOptions = new RuntimeOptions(arg); return this; }
public Builder withArgs(final List<String> args) { this.runtimeOptions = new RuntimeOptions(args); return this; }
public RuntimeOptions create() { List<String> args = buildArgsFromOptions(); return new RuntimeOptions(args); }
public RuntimeOptions create(CucumberOptions options) { List<String> args = buildArgsFromOptions(options); return new RuntimeOptions(args); }
private RuntimeOptions createRuntimeOptions() { final CourgetteRuntimeOptions courgetteRuntimeOptions = new CourgetteRuntimeOptions(courgetteProperties); final List<String> argv = Arrays.asList(courgetteRuntimeOptions.getRuntimeOptions()); return new RuntimeOptions(argv); }
private static RuntimeOptions loadRuntimeOptions(final Class<?> javaTestClass, final Properties cukespaceConfigurationProperties) { final RuntimeOptions runtimeOptions; if (javaTestClass.getAnnotation(CucumberOptions.class) != null) { // by class setting final RuntimeOptionsFactory runtimeOptionsFactory = new RuntimeOptionsFactory(javaTestClass); runtimeOptions = runtimeOptionsFactory.create(); cleanClasspathList(runtimeOptions.getGlue()); cleanClasspathList(runtimeOptions.getFeaturePaths()); } else if (cukespaceConfigurationProperties.containsKey(CucumberConfiguration.OPTIONS)) { // arquillian setting runtimeOptions = new RuntimeOptions(new Env("cucumber-jvm"), asList((cukespaceConfigurationProperties.getProperty(CucumberConfiguration.OPTIONS, "--strict") + " --strict").split(" "))); } else { // default runtimeOptions = new RuntimeOptions(new Env("cucumber-jvm"), asList("--strict", "--plugin", "pretty", areColorsNotAvailable(cukespaceConfigurationProperties))); } return runtimeOptions; }
public Runtime build() { if (classLoader == null) classLoader = testClass == null ? Thread.currentThread().getContextClassLoader() : testClass.getClassLoader(); if (resourceLoader == null) resourceLoader = new MultiLoader(classLoader); if (pluginFactory == null) pluginFactory = new PluginFactory(); if (runtimeOptions == null) { Preconditions.checkArgument(!args.isEmpty() || testClass != null, "RuntimeOptions not provided, need args or testClass"); runtimeOptions = args.isEmpty() ? new RuntimeOptionsFactory(testClass).create() : new RuntimeOptions(pluginFactory, args); } runtimeOptions.getFeaturePaths().addAll(featurePaths); for (Object plugin : plugins) { runtimeOptions.addPlugin(plugin); } String progressOutputFilePath = System.getProperty("minium.cucumber.progressOutputFile", null); if (progressOutputFilePath != null) { File progressOutputFile = new File(progressOutputFilePath); runtimeOptions.addPlugin(new ProgressFormatter(progressOutputFile)); } runtime = new Runtime(resourceLoader, classLoader, backends, runtimeOptions); return runtime; }
/** * Launches the Cucumber-JVM command line * @param argv runtime options. See details in the {@code cucumber.api.cli.Usage.txt} resource * @param classLoader classloader used to load the runtime * @return 0 if execution was successful, 1 if not (there were test failures) * @throws IOException if resources couldn't be loaded during execution */ public static byte run(String[] argv, ClassLoader classLoader) throws IOException { RuntimeOptions runtimeOptions = new RuntimeOptions(asList(argv)); ResourceLoader resourceLoader = new MultiLoader(classLoader); Configuration systemConfiguration = Injectors.getInjector().getInstance(Configuration.class); Runtime seleniumRuntime = CucumberWithSerenity.createSerenityEnabledRuntime(resourceLoader, classLoader, runtimeOptions, systemConfiguration); seleniumRuntime.run(); return seleniumRuntime.exitStatus(); } }
/** * Launches the Cucumber-JVM command line * @param argv runtime options. See details in the {@code cucumber.api.cli.Usage.txt} resource * @param classLoader classloader used to load the runtime * @return 0 if execution was successful, 1 if not (there were test failures) * @throws IOException if resources couldn't be loaded during execution */ public static byte run(String[] argv, ClassLoader classLoader) throws IOException { RuntimeOptions runtimeOptions = new RuntimeOptions(asList(argv)); ResourceLoader resourceLoader = new MultiLoader(classLoader); Configuration systemConfiguration = Injectors.getInjector().getInstance(Configuration.class); Runtime seleniumRuntime = CucumberWithSerenity.createSerenityEnabledRuntime(resourceLoader, classLoader, runtimeOptions, systemConfiguration); seleniumRuntime.run(); return seleniumRuntime.exitStatus(); } }
public static byte run(String[] argv, ClassLoader classLoader) throws IOException { RuntimeOptions runtimeOptions = new RuntimeOptions(Arrays.asList(argv)); ResourceLoader resourceLoader = new MultiLoader(classLoader); ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader); CucumberWithSerenity.setRuntimeOptions(runtimeOptions); Runtime runtime = CucumberWithSerenityRuntime.using(resourceLoader, classLoader, classFinder, runtimeOptions); runtime.run(); return runtime.exitStatus(); } }
public static byte run(String[] argv, ClassLoader classLoader) throws IOException { RuntimeOptions runtimeOptions = new RuntimeOptions(Arrays.asList(argv)); ResourceLoader resourceLoader = new MultiLoader(classLoader); ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader); CucumberWithSerenity.setRuntimeOptions(runtimeOptions); Runtime runtime = CucumberWithSerenityRuntime.using(resourceLoader, classLoader, classFinder, runtimeOptions); runtime.run(); return runtime.exitStatus(); } }
/** * Launches the Cucumber-JVM command line. * * @param argv runtime options. See details in the {@code cucumber.api.cli.Usage.txt} resource. * @param classLoader classloader used to load the runtime * @return 0 if execution was successful, 1 if it was not (test failures) * @throws IOException if resources couldn't be loaded during the run. */ public static byte run(String[] argv, ClassLoader classLoader) throws IOException { byte exitstatus = 0; for (Object[] parameters : Configuration.current().createWrappersParameters()) { if (exitstatus != 0) { break; } RuntimeOptions runtimeOptions = new RuntimeOptions(new ArrayList<>(asList(argv))); ResourceLoader resourceLoader = new MultiLoader(classLoader); ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader); Runtime runtime = new ParameterizableRuntime(resourceLoader, classFinder, classLoader, runtimeOptions, parameters[0].toString(), parameters); runtime.run(); exitstatus = runtime.exitStatus(); } return exitstatus; } }
runtimeOptions = new RuntimeOptions(cucumberOptions); ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader); runtime = new Runtime(resourceLoader, classFinder, classLoader, runtimeOptions);
Assertions.assertNoCucumberAnnotatedMethods(clazz); RuntimeOptions runtimeOptions = new RuntimeOptions(cucumberOptions); ResourceLoader resourceLoader = new MultiLoader(classLoader); FeatureLoader featureLoader = new FeatureLoader(resourceLoader);