Class WebDriverConfiguration

  • All Implemented Interfaces:
    Map<Object,​Object>, org.apache.commons.configuration.Configuration

    public class WebDriverConfiguration
    extends dev.aherscu.qa.testing.utils.config.BaseConfiguration
    Provides WebDriver-related configuration items.
    • Field Summary

      • Fields inherited from class dev.aherscu.qa.testing.utils.config.AbstractConfiguration

        CONFIGURATION_SOURCES, wrappedConfiguration
    • Constructor Summary

      Constructors 
      Constructor Description
      WebDriverConfiguration​(org.apache.commons.configuration.Configuration... configurations)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx capabilities()  
      dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx capabilities​(dev.aherscu.qa.jgiven.webdriver.WebDriverConfiguration.DeviceType deviceType)  
      dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx capabilitiesFor​(String prefix)  
      dev.aherscu.qa.jgiven.webdriver.WebDriverConfiguration.DeviceType deviceType()  
      String provider()  
      List<dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx> requiredCapabilities()  
      List<dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx> requiredCapabilities​(dev.aherscu.qa.jgiven.webdriver.WebDriverConfiguration.DeviceType deviceType)  
      • Methods inherited from class dev.aherscu.qa.testing.utils.config.BaseConfiguration

        groupsOf, toString, toString
      • Methods inherited from class dev.aherscu.qa.testing.utils.config.AbstractConfiguration

        addProperty, clear, clearProperty, compute, computeIfAbsent, computeIfPresent, containsKey, containsKey, containsValue, defaultConfiguration, entrySet, forEach, get, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getKeys, getList, getList, getLong, getLong, getLong, getOrDefault, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, resolve, setProperty, size, stringResourceFrom, subset, values
    • Constructor Detail

      • WebDriverConfiguration

        public WebDriverConfiguration​(org.apache.commons.configuration.Configuration... configurations)
        Parameters:
        configurations - set of configurations to be aggregated; the `device.type` property has a filtering effect on results of requiredCapabilities() and of capabilities() methods, hence these methods will work correctly only if all instances are created with same `device.type`, or otherwise resetNextRequiredCapabilitiesIndex() is called in between
    • Method Detail

      • capabilities

        public dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx capabilities​(dev.aherscu.qa.jgiven.webdriver.WebDriverConfiguration.DeviceType deviceType)
        Parameters:
        deviceType - a specific device type
        Returns:
        matching capabilities for configured provider() and specified device type
      • capabilities

        public dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx capabilities()
        Returns:
        capabilities for configured provider() and deviceType();

        if deviceType() is not blank then retrieves only matching capabilities from required-capabilities.properties;

        if no matching capabilities found, then returns whatever is defined in webdriver.properties for current provider()

      • capabilitiesFor

        public dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx capabilitiesFor​(String prefix)
        Parameters:
        prefix - prefix
        Returns:
        capabilities for specified prefix; also adds <thread-name>:<current-time-millis> to retrieved capabilities
      • deviceType

        public dev.aherscu.qa.jgiven.webdriver.WebDriverConfiguration.DeviceType deviceType()
        Returns:
        the `device.type` as specified in source configuration, or Platform.ANY if none specified
      • provider

        public String provider()
        Returns:
        the `provider` as specified source configuration
      • requiredCapabilities

        public List<dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx> requiredCapabilities​(dev.aherscu.qa.jgiven.webdriver.WebDriverConfiguration.DeviceType deviceType)
        Parameters:
        deviceType - device type to filter by
        Returns:
        all matching device capabilities, if any
      • requiredCapabilities

        public List<dev.aherscu.qa.jgiven.commons.utils.DesiredCapabilitiesEx> requiredCapabilities()
        Returns:
        device capabilities per configuration