Package: geb

## [Groovy] Class Configuration

- geb.Configuration

- Represents a particular configuration of Geb.

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `Wait` | `atCheckWaiting`
    `boolean` | `autoClearCookies`
    `boolean` | `autoClearWebStorage`
    `Wait` | `baseNavigatorWaiting`
    `String` | `baseUrl`
    `BuildAdapter` | `buildAdapter`
    `boolean` | `cacheDriver`
    `boolean` | `cacheDriverPerThread`
    `ClassLoader` | `classLoader`
    `Number` | `defaultWaitRetryInterval`
    `Number` | `defaultWaitTimeout`
    `Closure` | `downloadConfig`
    `WebDriver` | `driver`
    `def` | `driverConf`
    `InnerNavigatorFactory` | `innerNavigatorFactory`
    `NavigatorEventListener` | `navigatorEventListener`
    `PageEventListener` | `pageEventListener`
    `Properties` | `properties`
    `groovy.util.ConfigObject` | `rawConfig`
    `boolean` | `reportOnTestFailureOnly`
    `Reporter` | `reporter`
    `ReportingListener` | `reportingListener`
    `File` | `reportsDir`
    `Collection<Class<? extends Page>>` | `unexpectedPages`
    `String` | `waitPreset`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Configuration (Map rawConfig)`
    `Configuration (groovy.util.ConfigObject rawConfig = null, Properties properties = null, BuildAdapter buildAdapter = null, ClassLoader classLoader = null)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected Reporter` | `createDefaultReporter()`
    `` | `protected WebDriver` | `createDriver()`
    `` | `NavigatorFactory` | `createNavigatorFactory(Browser browser)` Creates the navigator factory to be used.
    `` | `Wait` | `getAtCheckWaiting()`
    `` | `Wait` | `getBaseNavigatorWaiting()`
    `` | `String` | `getBaseUrl()` Returns the config value `baseUrl`, or BuildAdapter.getBaseUrl.
    `` | `Wait` | `getDefaultWait()`
    `` | `Number` | `getDefaultWaitRetryInterval()` The default `retryInterval` value to use for waiting (i.e. if unspecified).
    `` | `Number` | `getDefaultWaitTimeout()` The default `timeout` value to use for waiting (i.e. if unspecified).
    `` | `Closure` | `getDownloadConfig()` Returns the default configuration closure to be applied before the user- supplied config closure when using the download support.
    `` | `WebDriver` | `getDriver()`
    `` | `def` | `getDriverConf()` Returns the configuration value for the driver.
    `` | `protected DriverFactory` | `getDriverFactory(def driverValue)`
    `` | `boolean` | `getIncludeCauseInWaitTimeoutExceptionMessage()` Returns Either the value at config path `waiting.includeCauseInMessage` or `false` if there is none.
    `` | `InnerNavigatorFactory` | `getInnerNavigatorFactory()` Returns the inner navigatory factory, that turns WebElements into Navigators.
    `` | `NavigatorEventListener` | `getNavigatorEventListener()`
    `` | `PageEventListener` | `getPageEventListener()`
    `` | `Reporter` | `getReporter()` Returns the reporter implementation to use for taking snapshots of the browser's state.
    `` | `ReportingListener` | `getReportingListener()`
    `` | `File` | `getReportsDir()` Returns the config value `reportsDir`, or BuildAdapter.getReportsDir.
    `` | `boolean` | `getRequirePageAtCheckers()` Whether or not to throw an exception when implicit "at checks" are being performed and the checked page does not define an "at check".
    `` | `TemplateOptionsConfiguration` | `getTemplateOptions()` Returns default values used for some of the content DSL template options.
    `` | `Collection<Class<? extends Page>>` | `getUnexpectedPages()`
    `` | `Wait` | `getWait(Number timeout)`
    `` | `Wait` | `getWaitForParam(def waitingParam)`
    `` | `Wait` | `getWaitPreset(String name)`
    `` | `WithNewWindowConfiguration` | `getWithNewWindowConfig()`
    `` | `WithWindowConfiguration` | `getWithWindowConfig()`
    `` | `boolean` | `isAutoClearCookies()` Whether or not to automatically clear the browser's cookies.
    `` | `boolean` | `isAutoClearWebStorage()` Whether or not to automatically clear the browser's web storage, that is both local and session storage.
    `` | `boolean` | `isCacheDriver()` Should the created driver be cached if there is no existing cached driver, of if there is a cached driver should it be used instead of creating a new one.
    `` | `boolean` | `isCacheDriverPerThread()` If the driver is to be cached, this setting controls whether or not the driver is cached per thread or globally for all threads.
    `` | `boolean` | `isQuitCachedDriverOnShutdown()` If a cached driver is being used, should it be automatically quit when the JVM exits.
    `` | `boolean` | `isReportOnTestFailureOnly()`
    `` | `Configuration` | `merge(Configuration other)`
    `` | `protected Optional<Boolean>` | `readOptionalBooleanValue(groovy.util.ConfigObject config, String name)`
    `` | `protected Optional<Integer>` | `readOptionalNonNegativeIntegerValue(groovy.util.ConfigObject config, String name, String errorName)`
    `` | `protected def` | `readValue(String name, def defaultValue)`
    `` | `protected def` | `readValue(groovy.util.ConfigObject config, String name, def defaultValue)`
    `` | `void` | `setAtCheckWaiting(Object waitForParam)`
    `` | `void` | `setAutoClearCookies(boolean flag)` Sets the auto clear cookies flag explicitly, overwriting any value from the config script.
    `` | `void` | `setAutoClearWebStorage(boolean flag)` Sets the auto clear web storage flag explicitly, overwriting any value from the config script.
    `` | `void` | `setBaseNavigatorWaiting(Object waitForParam)`
    `` | `void` | `setBaseUrl(def baseUrl)`
    `` | `void` | `setCacheDriver(boolean flag)` Updates the `cacheDriver` config entry.
    `` | `void` | `setCacheDriverPerThread(boolean flag)` Updates the `cacheDriverPerThread` config entry.
    `` | `void` | `setDefaultWaitRetryInterval(Number defaultWaitRetryInterval)` Updates the `waiting.retryInterval` config entry.
    `` | `void` | `setDefaultWaitTimeout(Number defaultWaitTimeout)` Updates the `waiting.timeout` config entry.
    `` | `void` | `setDownloadConfig(Closure config)`
    `` | `void` | `setDriver(WebDriver driver)`
    `` | `void` | `setDriverConf(def value)` Sets the driver configuration value.
    `` | `void` | `setIncludeCauseInWaitTimeoutExceptionMessage(boolean include)` Updates the `waiting.includeCauseInMessage` config entry.
    `` | `void` | `setInnerNavigatorFactory(InnerNavigatorFactory innerNavigatorFactory)` Sets the inner navigator factory.
    `` | `void` | `setNavigatorEventListener(NavigatorEventListener navigatorEventListener)`
    `` | `void` | `setPageEventListener(PageEventListener pageEventListener)`
    `` | `void` | `setQuitCacheDriverOnShutdown(boolean flag)` Sets whether or not the cached driver should be quit when the JVM shuts down.
    `` | `def` | `setReportOnTestFailureOnly(boolean value)`
    `` | `void` | `setReporter(Reporter reporter)` Updates the `reporter` config entry.
    `` | `void` | `setReportingListener(ReportingListener reportingListener)`
    `` | `void` | `setReportsDir(File reportsDir)`
    `` | `void` | `setRequirePageAtCheckers(boolean requirePageAtCheckers)` Sets the `requirePageAtCheckers` flag explicitly, overwriting any value from the config script.
    `` | `void` | `setTemplateCacheOption(boolean cache)` Updates the `templateOptions.cache` config entry.
    `` | `void` | `setTemplateMaxOption(int max)` Updates the `templateOptions.max` config entry.
    `` | `void` | `setTemplateMinOption(int min)` Updates the `templateOptions.min` config entry.
    `` | `void` | `setTemplateRequiredOption(boolean required)` Updates the `templateOptions.required` config entry.
    `` | `void` | `setTemplateToWaitOption(def toWait)` Updates the `templateOptions.toWait` config entry.
    `` | `void` | `setTemplateWaitConditionOption(Closure<?> waitCondition)` Updates the `templateOptions.waitCondition` config entry.
    `` | `void` | `setTemplateWaitOption(def wait)` Updates the `templateOptions.wait` config entry.
    `` | `void` | `setUnexpectedPages(Collection<Class<? extends Page>> pages)`
    `` | `void` | `setWaitPreset(String name, Number presetTimeout, Number presetRetryInterval)` Updates a `waiting.preset` config entry for a given preset name.
    `` | `void` | `setWithNewWindowCloseOption(boolean close)` Updates the `withNewWindow.close` config entry.
    `` | `void` | `setWithNewWindowWaitOption(def wait)` Updates the `withWindow.wait` config entry.
    `` | `void` | `setWithWindowCloseOption(boolean close)` Updates the `withWindow.close` config entry.
    `` | `void` | `validate(TemplateOptionsConfiguration configuration)`
    `` | `protected DriverFactory` | `wrapDriverFactoryInCachingIfNeeded(DriverFactory factory)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Property Detail

    - #### Wait atCheckWaiting

    - #### boolean autoClearCookies

    - #### boolean autoClearWebStorage

    - #### Wait baseNavigatorWaiting

    - #### String baseUrl

    - #### final BuildAdapter buildAdapter

    - #### boolean cacheDriver

    - #### boolean cacheDriverPerThread

    - #### final ClassLoader classLoader

    - #### Number defaultWaitRetryInterval

    - #### Number defaultWaitTimeout

    - #### Closure downloadConfig

    - #### WebDriver driver

    - #### def driverConf

    - #### InnerNavigatorFactory innerNavigatorFactory

    - #### NavigatorEventListener navigatorEventListener

    - #### PageEventListener pageEventListener

    - #### final Properties properties

    - #### final groovy.util.ConfigObject rawConfig

    - #### boolean reportOnTestFailureOnly

    - #### Reporter reporter

    - #### ReportingListener reportingListener

    - #### File reportsDir

    - #### Collection<Class<? extends Page>> unexpectedPages

    - #### String waitPreset

  - ### Constructor Detail

    - #### Configuration(Map rawConfig)

    - #### Configuration(groovy.util.ConfigObject rawConfig = null, Properties properties = null, BuildAdapter buildAdapter = null, ClassLoader classLoader = null)

  - ### Method Detail

    - #### protected Reporter createDefaultReporter()

    - #### protected WebDriver createDriver()

    - #### NavigatorFactory createNavigatorFactory(Browser browser)

      Creates the navigator factory to be used. Returns BrowserBackedNavigatorFactory by default.

      Override by setting the 'navigatorFactory' to a closure that takes a single Browser argument and returns an instance of NavigatorFactory

      Parameters:
        `browser` - The browser to use as the basis of the navigatory factory.
      Returns:

    - #### Wait getAtCheckWaiting()

    - #### Wait getBaseNavigatorWaiting()

    - #### String getBaseUrl()

      Returns the config value `baseUrl`, or BuildAdapter.getBaseUrl.

    - #### Wait getDefaultWait()

    - #### Number getDefaultWaitRetryInterval()

      The default `retryInterval` value to use for waiting (i.e. if unspecified).

      Either the value at config path `waiting.retryInterval` or 0.1.

    - #### Number getDefaultWaitTimeout()

      The default `timeout` value to use for waiting (i.e. if unspecified).

      Either the value at config path `waiting.timeout` or 5.

    - #### @SuppressWarnings("ClosureAsLastMethodParameter") Closure getDownloadConfig()

      Returns the default configuration closure to be applied before the user- supplied config closure when using the download support.

    - #### WebDriver getDriver()

    - #### def getDriverConf()

      Returns the configuration value for the driver.

      This may be the class name of a driver implementation, a short name, or a closure that when invoked returns an actual driver.

      See Also:
        getDriver()

    - #### protected DriverFactory getDriverFactory(def driverValue)

    - #### boolean getIncludeCauseInWaitTimeoutExceptionMessage()

      Returns Either the value at config path `waiting.includeCauseInMessage` or `false` if there is none.

      Determines if the message of WaitTimeoutException should contain a string representation of its cause.

    - #### InnerNavigatorFactory getInnerNavigatorFactory()

      Returns the inner navigatory factory, that turns WebElements into Navigators. Returns DefaultInnerNavigatorFactory instances by default.

      To override, set 'innerNavigatorFactory' to:

      - An instance of InnerNavigatorFactory
      - A Closure, that has the signature (Browser, List<WebElement>)
      Returns:
        The inner navigator factory.

    - #### NavigatorEventListener getNavigatorEventListener()

    - #### PageEventListener getPageEventListener()

    - #### Reporter getReporter()

      Returns the reporter implementation to use for taking snapshots of the browser's state.

      Returns the config value `reporter`, or reporter that records page source and screen shots if not explicitly set.

    - #### ReportingListener getReportingListener()

    - #### File getReportsDir()

      Returns the config value `reportsDir`, or BuildAdapter.getReportsDir.

    - #### boolean getRequirePageAtCheckers()

      Whether or not to throw an exception when implicit "at checks" are being performed and the checked page does not define an "at check".

      Returns:
        the config value for `requirePageAtCheckers`, defaulting to `false` if not set.

    - #### TemplateOptionsConfiguration getTemplateOptions()

      Returns default values used for some of the content DSL template options.

      Returns:

    - #### Collection<Class<? extends Page>> getUnexpectedPages()

    - #### Wait getWait(Number timeout)

    - #### Wait getWaitForParam(def waitingParam)

    - #### Wait getWaitPreset(String name)

    - #### WithNewWindowConfiguration getWithNewWindowConfig()

    - #### WithWindowConfiguration getWithWindowConfig()

    - #### boolean isAutoClearCookies()

      Whether or not to automatically clear the browser's cookies.

      Different integrations inspect this property at different times.

      Returns:
        the config value for `autoClearCookies`, defaulting to `true` if not set.

    - #### boolean isAutoClearWebStorage()

      Whether or not to automatically clear the browser's web storage, that is both local and session storage.

      Different integrations inspect this property at different times.

      Returns:
        the config value for `autoClearWebStorage`, defaulting to `false` if not set.

    - #### boolean isCacheDriver()

      Should the created driver be cached if there is no existing cached driver, of if there is a cached driver should it be used instead of creating a new one.

      The value is the config entry `cacheDriver`, which defaults to `true`.

    - #### boolean isCacheDriverPerThread()

      If the driver is to be cached, this setting controls whether or not the driver is cached per thread or globally for all threads.

      The value is the config entry `cacheDriverPerThread`, which defaults to `false`.

    - #### boolean isQuitCachedDriverOnShutdown()

      If a cached driver is being used, should it be automatically quit when the JVM exits.

      The value is the config entry `quitCachedDriverOnShutdown`, which defaults to `true`.

    - #### boolean isReportOnTestFailureOnly()

    - #### Configuration merge(Configuration other)

    - #### protected Optional<Boolean> readOptionalBooleanValue(groovy.util.ConfigObject config, String name)

    - #### protected Optional<Integer> readOptionalNonNegativeIntegerValue(groovy.util.ConfigObject config, String name, String errorName)

    - #### protected def readValue(String name, def defaultValue)

    - #### protected def readValue(groovy.util.ConfigObject config, String name, def defaultValue)

    - #### void setAtCheckWaiting(Object waitForParam)

    - #### void setAutoClearCookies(boolean flag)

      Sets the auto clear cookies flag explicitly, overwriting any value from the config script.

    - #### void setAutoClearWebStorage(boolean flag)

      Sets the auto clear web storage flag explicitly, overwriting any value from the config script.

    - #### void setBaseNavigatorWaiting(Object waitForParam)

    - #### void setBaseUrl(def baseUrl)

    - #### void setCacheDriver(boolean flag)

      Updates the `cacheDriver` config entry.

      See Also:
        isCacheDriver()

    - #### void setCacheDriverPerThread(boolean flag)

      Updates the `cacheDriverPerThread` config entry.

      See Also:
        isCacheDriverPerThread()

    - #### void setDefaultWaitRetryInterval(Number defaultWaitRetryInterval)

      Updates the `waiting.retryInterval` config entry.

      See Also:
        getDefaultWaitRetryInterval()

    - #### void setDefaultWaitTimeout(Number defaultWaitTimeout)

      Updates the `waiting.timeout` config entry.

      See Also:
        getDefaultWaitTimeout()

    - #### void setDownloadConfig(Closure config)

    - #### void setDriver(WebDriver driver)

    - #### void setDriverConf(def value)

      Sets the driver configuration value.

      This may be the class name of a driver implementation, a driver short name or a closure that when invoked with no arguments returns a driver implementation.

      See Also:
        getDriver()

    - #### void setIncludeCauseInWaitTimeoutExceptionMessage(boolean include)

      Updates the `waiting.includeCauseInMessage` config entry.

      See Also:
        getIncludeCauseInWaitTimeoutExceptionMessage()

    - #### void setInnerNavigatorFactory(InnerNavigatorFactory innerNavigatorFactory)

      Sets the inner navigator factory. Only effectual before the browser calls createNavigatorFactory(Browser) initially.

      Parameters:
        innerNavigatorFactory

    - #### void setNavigatorEventListener(NavigatorEventListener navigatorEventListener)

    - #### void setPageEventListener(PageEventListener pageEventListener)

    - #### void setQuitCacheDriverOnShutdown(boolean flag)

      Sets whether or not the cached driver should be quit when the JVM shuts down.

    - #### def setReportOnTestFailureOnly(boolean value)

    - #### void setReporter(Reporter reporter)

      Updates the `reporter` config entry.

      See Also:
        getReporter()

    - #### void setReportingListener(ReportingListener reportingListener)

    - #### void setReportsDir(File reportsDir)

    - #### void setRequirePageAtCheckers(boolean requirePageAtCheckers)

      Sets the `requirePageAtCheckers` flag explicitly, overwriting any value from the config script.

    - #### void setTemplateCacheOption(boolean cache)

      Updates the `templateOptions.cache` config entry.

    - #### void setTemplateMaxOption(int max)

      Updates the `templateOptions.max` config entry.

    - #### void setTemplateMinOption(int min)

      Updates the `templateOptions.min` config entry.

    - #### void setTemplateRequiredOption(boolean required)

      Updates the `templateOptions.required` config entry.

    - #### void setTemplateToWaitOption(def toWait)

      Updates the `templateOptions.toWait` config entry.

    - #### void setTemplateWaitConditionOption(Closure<?> waitCondition)

      Updates the `templateOptions.waitCondition` config entry.

    - #### void setTemplateWaitOption(def wait)

      Updates the `templateOptions.wait` config entry.

    - #### void setUnexpectedPages(Collection<Class<? extends Page>> pages)

    - #### void setWaitPreset(String name, Number presetTimeout, Number presetRetryInterval)

      Updates a `waiting.preset` config entry for a given preset name.

    - #### void setWithNewWindowCloseOption(boolean close)

      Updates the `withNewWindow.close` config entry.

    - #### void setWithNewWindowWaitOption(def wait)

      Updates the `withWindow.wait` config entry.

    - #### void setWithWindowCloseOption(boolean close)

      Updates the `withWindow.close` config entry.

    - #### void validate(TemplateOptionsConfiguration configuration)

    - #### protected DriverFactory wrapDriverFactoryInCachingIfNeeded(DriverFactory factory)