com.github.siwenyan.superglue.WebDriverFactory Maven / Gradle / Ivy
package com.github.siwenyan.superglue;
import com.github.siwenyan.si.recorder.SiRecorderWebDriver;
import com.github.siwenyan.web.Factories;
import com.github.siwenyan.web.IWebDriverFactory;
import com.github.siwenyan.web.driver.HighlightWebDriver;
import org.openqa.selenium.WebDriver;
import java.util.Map;
public class WebDriverFactory implements IWebDriverFactory {
public static WebDriverFactory getInstance() {
return instance;
}
private static WebDriverFactory instance = new WebDriverFactory();
@Override
public WebDriver getWebDriver(Map options) {
WebDriver webDriver = Factories.webDriverFactory().getWebDriver(options);
if (HighlightWebDriver.enabled()) {
webDriver = new HighlightWebDriver(webDriver);
}
if (SiRecorderWebDriver.enabled()) {
webDriver = new SiRecorderWebDriver(webDriver);
}
return webDriver;
}
@Override
public void quitWebDriver(WebDriver webDriver) {
Factories.webDriverFactory().quitWebDriver(webDriver);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy