Groovy Documentation

geb
[Groovy] Class Configuration

java.lang.Object
  geb.Configuration

class Configuration

Represents a particular configuration of Geb.


Property Summary
BuildAdapter buildAdapter

ClassLoader classLoader

Properties properties

groovy.util.ConfigObject rawConfig

 
Constructor Summary
Configuration(Map rawConfig)

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

 
Method Summary
protected Reporter createDefaultReporter()

protected WebDriver createDriver()

NavigatorFactory createNavigatorFactory(Browser browser)

Creates the navigator factory to be used.

Wait getAtCheckWaiting()

String getBaseUrl()

Returns the config value baseUrl, or BuildAdapter.getBaseUrl.

Wait getDefaultWait()

Double getDefaultWaitRetryInterval()

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

Double 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)

InnerNavigatorFactory getInnerNavigatorFactory()

Returns the inner navigatory factory, that turns WebElements into Navigators.

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.

Wait getWait(Double timeout)

Wait getWaitForParam(def waitingParam)

Wait getWaitPreset(String name)

boolean isAutoClearCookies()

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

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()

The driver is to be cached, this setting controls whether or not the driver is cached per thread, or per

boolean isQuitCachedDriverOnShutdown()

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

boolean isReportOnTestFailureOnly()

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 setBaseUrl(def baseUrl)

void setCacheDriver(boolean flag)

Updates the cacheDriver config entry.

void setCacheDriverPerThread(boolean flag)

Updates the cacheDriverPerThread config entry.

void setDefaultWaitRetryInterval(Double defaultWaitRetryInterval)

Updates the waiting.retryInterval config entry.

void setDefaultWaitTimeout(Double 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 setInnerNavigatorFactory(InnerNavigatorFactory innerNavigatorFactory)

Sets the inner navigator factory.

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 setWaitPreset(String name, Double presetTimeout, Double presetRetryInterval)

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

protected DriverFactory wrapDriverFactoryInCachingIfNeeded(DriverFactory factory)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Property Detail

buildAdapter

final BuildAdapter buildAdapter


classLoader

final ClassLoader classLoader


properties

final Properties properties


rawConfig

final groovy.util.ConfigObject rawConfig


 
Constructor Detail

Configuration

Configuration(Map rawConfig)


Configuration

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


 
Method Detail

createDefaultReporter

protected Reporter createDefaultReporter()


createDriver

protected WebDriver createDriver()


createNavigatorFactory

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:


getAtCheckWaiting

Wait getAtCheckWaiting()


getBaseUrl

String getBaseUrl()
Returns the config value baseUrl, or BuildAdapter.getBaseUrl.


getDefaultWait

Wait getDefaultWait()


getDefaultWaitRetryInterval

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

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


getDefaultWaitTimeout

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

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


getDownloadConfig

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


getDriver

WebDriver getDriver()


getDriverConf

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()


getDriverFactory

protected DriverFactory getDriverFactory(def driverValue)


getInnerNavigatorFactory

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

To override, set 'innerNavigatorFactory' to:

Returns:
The inner navigator factory.


getReporter

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.


getReportingListener

ReportingListener getReportingListener()


getReportsDir

File getReportsDir()
Returns the config value reportsDir, or BuildAdapter.getReportsDir.


getWait

Wait getWait(Double timeout)


getWaitForParam

Wait getWaitForParam(def waitingParam)


getWaitPreset

Wait getWaitPreset(String name)


isAutoClearCookies

boolean isAutoClearCookies()
Whether or not to automatically clear the browser's cookies automatically.

Different integrations inspect this property at different times.

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


isCacheDriver

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.


isCacheDriverPerThread

boolean isCacheDriverPerThread()
The driver is to be cached, this setting controls whether or not the driver is cached per thread, or per

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


isQuitCachedDriverOnShutdown

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.


isReportOnTestFailureOnly

boolean isReportOnTestFailureOnly()


readValue

protected def readValue(String name, def defaultValue)


readValue

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


setAtCheckWaiting

void setAtCheckWaiting(Object waitForParam)


setAutoClearCookies

void setAutoClearCookies(boolean flag)
Sets the auto clear cookies flag explicitly, overwriting any value from the config script.


setBaseUrl

void setBaseUrl(def baseUrl)


setCacheDriver

void setCacheDriver(boolean flag)
Updates the cacheDriver config entry.
See Also:
isCacheDriver()


setCacheDriverPerThread

void setCacheDriverPerThread(boolean flag)
Updates the cacheDriverPerThread config entry.
See Also:
isCacheDriverPerThread()


setDefaultWaitRetryInterval

void setDefaultWaitRetryInterval(Double defaultWaitRetryInterval)
Updates the waiting.retryInterval config entry.
See Also:
getDefaultWaitRetryInterval()


setDefaultWaitTimeout

void setDefaultWaitTimeout(Double defaultWaitTimeout)
Updates the waiting.timeout config entry.
See Also:
getDefaultWaitTimeout()


setDownloadConfig

void setDownloadConfig(Closure config)


setDriver

void setDriver(WebDriver driver)


setDriverConf

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()


setInnerNavigatorFactory

void setInnerNavigatorFactory(InnerNavigatorFactory innerNavigatorFactory)
Sets the inner navigator factory. Only effectual before the browser calls createNavigatorFactory(Browser) initially.
Parameters:
innerNavigatorFactory


setQuitCacheDriverOnShutdown

void setQuitCacheDriverOnShutdown(boolean flag)
Sets whether or not the cached driver should be quit when the JVM shuts down.


setReportOnTestFailureOnly

def setReportOnTestFailureOnly(boolean value)


setReporter

void setReporter(Reporter reporter)
Updates the reporter config entry.
See Also:
getReporter()


setReportingListener

void setReportingListener(ReportingListener reportingListener)


setReportsDir

void setReportsDir(File reportsDir)


setWaitPreset

void setWaitPreset(String name, Double presetTimeout, Double presetRetryInterval)
Updates a waiting.preset config entry for a given preset name.


wrapDriverFactoryInCachingIfNeeded

protected DriverFactory wrapDriverFactoryInCachingIfNeeded(DriverFactory factory)


 

Groovy API Documentation for Geb 0.9.1 - Licensed under the Apache License, Version 2.0 - http://www.gebish.org