/** * 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) */ public static byte run(String[] argv, ClassLoader classLoader) { final Runtime runtime = Runtime.builder() .withArgs(argv) .withClassLoader(classLoader) .build(); runtime.run(); return runtime.exitStatus(); } }
/** * Run the Cucumber features */ public void runCukes() { try { LOGGER.trace("Running cucumber tests on [{}]", TestContext.getCurrent()); runtime.run(); } catch (IOException ex) { throw new RuntimeException(ex); } if (!runtime.getErrors().isEmpty()) { throw new CucumberException(runtime.getErrors().get(0)); } else if (runtime.exitStatus() != 0x00) { throw new CucumberException("There are pending or undefined steps."); } }
/** * 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(); } }
/** * 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; } }
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(); } }