
com.rationaleemotions.cucumber.PluginAwareCucumberOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autospawn Show documentation
Show all versions of autospawn Show documentation
A simple TestNG listener for browser lifecycle management
package com.rationaleemotions.cucumber;
import cucumber.api.CucumberOptions;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class PluginAwareCucumberOptions extends AbstractCucumberOptions {
private List plugins;
private PluginAwareCucumberOptions(CucumberOptions options, String[] plugins) {
super(options);
this.plugins = new ArrayList<>(Arrays.asList(options.plugin()));
this.plugins.addAll(Arrays.asList(plugins));
}
static PluginAwareCucumberOptions newInstance(CucumberOptions options) {
return new PluginAwareCucumberOptions(
options, new String[] {BrowserSpawningFormatter.class.getName()});
}
@Override
public String[] plugin() {
List pluginsToReturn = new ArrayList<>(this.plugins);
pluginsToReturn.addAll(Arrays.asList(super.plugin()));
return pluginsToReturn.toArray(new String[0]);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy