
com.automationrockstars.bmo.WebdriverJunitGroovyRunner Maven / Gradle / Ivy
The newest version!
/*
*
*/
package com.automationrockstars.bmo;
import com.automationrockstars.design.gir.webdriver.DriverFactory;
import com.google.common.base.Preconditions;
import org.openqa.selenium.WebDriver;
public class WebdriverJunitGroovyRunner extends JunitGroovyRunner {
public static final String URL_PROP = "url";
private static WebDriver driver;
protected synchronized void prepBinding() {
driver = DriverFactory.getDriver();
driver.manage().window().maximize();
binding.setVariable("driver", driver);
}
public void executeScript() throws Exception {
String url = System.getProperty(URL_PROP);
Preconditions.checkNotNull(url, "System property %s is not set. Please use -D%s=http://link to execute tests", URL_PROP);
try {
prepBinding();
driver.get(url);
super.executeScript();
} finally {
driver.close();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy