Class ChromeDriverFactory

  • All Implemented Interfaces:
    org.jboss.arquillian.drone.spi.Configurator<org.openqa.selenium.chrome.ChromeDriver,​WebDriverConfiguration>, org.jboss.arquillian.drone.spi.Destructor<org.openqa.selenium.chrome.ChromeDriver>, org.jboss.arquillian.drone.spi.Instantiator<org.openqa.selenium.chrome.ChromeDriver,​WebDriverConfiguration>, org.jboss.arquillian.drone.spi.Sortable

    public class ChromeDriverFactory
    extends Object
    implements org.jboss.arquillian.drone.spi.Configurator<org.openqa.selenium.chrome.ChromeDriver,​WebDriverConfiguration>, org.jboss.arquillian.drone.spi.Instantiator<org.openqa.selenium.chrome.ChromeDriver,​WebDriverConfiguration>, org.jboss.arquillian.drone.spi.Destructor<org.openqa.selenium.chrome.ChromeDriver>
    Factory which combines Configurator, Instantiator and Destructor for ChromeDriver.
    • Field Detail

      • BROWSER_CAPABILITIES

        public static final String BROWSER_CAPABILITIES
      • HEADLESS_BROWSER_CAPABILITIES

        public static final String HEADLESS_BROWSER_CAPABILITIES
      • registryInstance

        @Inject
        protected org.jboss.arquillian.core.api.Instance<org.jboss.arquillian.drone.webdriver.spi.BrowserCapabilitiesRegistry> registryInstance
    • Constructor Detail

      • ChromeDriverFactory

        public ChromeDriverFactory()
    • Method Detail

      • getPrecedence

        public int getPrecedence()
        Specified by:
        getPrecedence in interface org.jboss.arquillian.drone.spi.Sortable
      • destroyInstance

        public void destroyInstance​(org.openqa.selenium.chrome.ChromeDriver instance)
        Specified by:
        destroyInstance in interface org.jboss.arquillian.drone.spi.Destructor<org.openqa.selenium.chrome.ChromeDriver>
      • createInstance

        public org.openqa.selenium.chrome.ChromeDriver createInstance​(WebDriverConfiguration configuration)
        Specified by:
        createInstance in interface org.jboss.arquillian.drone.spi.Instantiator<org.openqa.selenium.chrome.ChromeDriver,​WebDriverConfiguration>
      • getChromeOptions

        public org.openqa.selenium.chrome.ChromeOptions getChromeOptions​(WebDriverConfiguration configuration,
                                                                         boolean performValidations)
        Returns a ChromeOptions instance with set all necessary properties. It also validates if the defined chrome.binary and chromeDriverBinary are executable binaries. This validation can be set off/on by using variable performValidations; if set to true the IllegalArgumentException can be thrown in case when requirements are not met
        Parameters:
        configuration - A configuration object for Drone extension
        performValidations - Whether a potential validation should be performed; if set to true an IllegalArgumentException (or other exception) can be thrown in case requirements are not met
        Returns:
        A Capabilities instance with set all necessary properties.
      • getChromeOptions

        public org.openqa.selenium.chrome.ChromeOptions getChromeOptions​(WebDriverConfiguration configuration)
      • setChromeOptions

        public void setChromeOptions​(WebDriverConfiguration configuration,
                                     org.openqa.selenium.chrome.ChromeOptions chromeOptions)
      • manageChromeHeadless

        public void manageChromeHeadless​(WebDriverConfiguration configuration,
                                         org.openqa.selenium.chrome.ChromeOptions chromeOptions)
      • getDriverReadableName

        protected String getDriverReadableName()
      • createConfiguration

        public WebDriverConfiguration createConfiguration​(org.jboss.arquillian.config.descriptor.api.ArquillianDescriptor descriptor,
                                                          org.jboss.arquillian.drone.spi.DronePoint<org.openqa.selenium.chrome.ChromeDriver> dronePoint)
        Specified by:
        createConfiguration in interface org.jboss.arquillian.drone.spi.Configurator<org.openqa.selenium.chrome.ChromeDriver,​WebDriverConfiguration>