All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.siwenyan.superglue.WebDriverFactory Maven / Gradle / Ivy

There is a newer version: 1.25.a
Show newest version
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