Class WebDriverConfig

java.lang.Object
uk.co.evoco.webdriver.configuration.WebDriverConfig

public class WebDriverConfig
extends java.lang.Object
A simple representation object for the "./src/test/resources/config.json" file
  • Constructor Details

  • Method Details

    • getBrowserType

      public BrowserType getBrowserType()
      Returns:
      BrowserType for the run from the configuration file
    • setBrowserType

      public void setBrowserType​(java.lang.String browserType)
      Parameters:
      browserType - the browser for the run
    • setBrowserType

      public void setBrowserType​(BrowserType browserType)
      Parameters:
      browserType - the browser for the run
    • getBaseUrl

      public java.lang.String getBaseUrl()
      Returns:
      the base URL for the application under test
    • setBaseUrl

      public void setBaseUrl​(java.lang.String baseUrl) throws java.net.MalformedURLException
      Aims to pull the baseUrl from the configuration file. If, however, a system property has been set via the command line, then this will be overridden and we will use the baseUrl that comes from the CLI. This is important to ensure there is support for non-configuration dynamic configuration for CI systems like Jenkins etc.
      Parameters:
      baseUrl - the base URL for the application under test
      Throws:
      java.net.MalformedURLException - if the base URL is not a valid URL
    • getWebDriverWaitTimeout

      public long getWebDriverWaitTimeout()
      Returns:
      the timeout used in the framework for WebDriverWaits
    • setWebDriverWaitTimeout

      public void setWebDriverWaitTimeout​(java.lang.String webDriverWaitTimeout)
      Parameters:
      webDriverWaitTimeout - the timeout used in the framework for WebDriverWaits
    • getTestConfigItem

      public java.lang.String getTestConfigItem​(java.lang.String item)
      Parameters:
      item - the name of the key for which the value you want to retrieve
      Returns:
      String returns the target item that exists in the list of open options that can be passed in the config file
    • setTestConfig

      public void setTestConfig​(com.fasterxml.jackson.databind.JsonNode testConfig)
      Parameters:
      testConfig - the list of key/value pairs for the non-specific configuration items in the config file
    • isHeadless

      public boolean isHeadless()
      Returns:
      boolean configuring headless running
    • setHeadless

      public void setHeadless​(boolean headless)
      Parameters:
      headless - boolean configuring headless running
    • getGridConfig

      public GridConfig getGridConfig()
      Returns:
      the GridConfig configuration
    • setGridConfig

      public void setGridConfig​(GridConfig gridConfig)
      Parameters:
      gridConfig - the GridConfig configuration
    • getBrowserPreferences

      public com.fasterxml.jackson.databind.node.ObjectNode getBrowserPreferences​(BrowserType browserType)
      Returns:
      the BrowserPreferences configuration
    • setBrowserPreferences

      public void setBrowserPreferences​(java.util.Map<java.lang.String,​com.fasterxml.jackson.databind.node.ObjectNode> browserPreferences)
      Parameters:
      browserPreferences - the configuration properties for the various browsers supported by the webdriver
    • getRunType

      public RunType getRunType()
      Returns:
      the run type
    • setRunType

      public void setRunType​(java.lang.String runType)
      Parameters:
      runType - the run type
    • getTolerantActionExceptions

      public TolerantActionExceptions getTolerantActionExceptions()
      Returns:
      the tolerant action exceptions config
    • setTolerantActionExceptions

      public void setTolerantActionExceptions​(TolerantActionExceptions tolerantActionExceptions)
      Parameters:
      tolerantActionExceptions - set the tolerant action exceptions and tolerant action wait time in Seconds
    • getTolerantActionWaitTimeoutInSeconds

      public int getTolerantActionWaitTimeoutInSeconds()
      Returns:
      tolerant action wait time in seconds if user specify the time in config file other wise return default webdriver time out
    • setMetricsConfig

      public void setMetricsConfig​(MetricsConfig metricsConfig)
    • getMetricsConfig

      public MetricsConfig getMetricsConfig()