com.xlrit.gears.runner.RunMojo Maven / Gradle / Ivy
package com.xlrit.gears.runner;
import com.xlrit.gears.runner.driver.Config;
import com.xlrit.gears.runner.driver.Driver;
import com.xlrit.gears.runner.driver.RunConfig;
import com.xlrit.gears.runner.driver.RunDriver;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
@Mojo(name = "run", defaultPhase = LifecyclePhase.VERIFY, requiresProject = false)
public class RunMojo extends RunnerMojo {
@Parameter(property = "gears.runner.target")
private String target;
@Parameter(property = "gears.runner.timeoutMillis")
private Integer timeoutMillis;
@Parameter(property = "gears.runner.waitMillis")
private Integer waitMillis;
@Parameter(property = "gears.runner.typeMillis")
private Integer typeMillis;
@Parameter(property = "gears.runner.clickMillis")
private Integer clickMillis;
@Parameter(property = "gears.runner.failFast")
private Boolean failFast;
@Parameter(property = "gears.runner.submitScreenshots")
private Boolean submitScreenshots;
@Parameter(property = "gears.runner.headless")
private Boolean headless;
@Parameter(property = "gears.runner.expandedReport")
private Boolean expandedReport;
@Parameter(property = "gears.runner.slow")
private Boolean slow;
@Override
protected Config getConfig() {
RunConfig config = new RunConfig();
if (timeoutMillis != null) config.timeoutMillis = timeoutMillis;
if (waitMillis != null) config.waitMillis = waitMillis;
if (typeMillis != null) config.typeMillis = typeMillis;
if (clickMillis != null) config.clickMillis = clickMillis;
if (target != null) config.target = target;
if (failFast != null) config.failFast = failFast;
if (submitScreenshots != null) config.submitScreenshots = submitScreenshots;
if (headless != null) config.headless = headless;
if (expandedReport != null) config.expandedReport = expandedReport;
if (slow != null) config.slow = slow;
return config;
}
@Override @SuppressWarnings("rawtypes")
protected Driver getDriver() {
return new RunDriver();
}
}