class Configuration extends Object
Represents a particular configuration of Geb.
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 |
Object |
driverConf |
InnerNavigatorFactory |
innerNavigatorFactory |
NavigatorEventListener |
navigatorEventListener |
PageEventListener |
pageEventListener |
Properties |
properties |
boolean |
quitDriverOnBrowserReset |
groovy.util.ConfigObject |
rawConfig |
boolean |
reportOnTestFailureOnly |
Reporter |
reporter |
ReportingListener |
reportingListener |
File |
reportsDir |
Collection<Class<? extends Page>> |
unexpectedPages |
String |
waitPreset |
Constructor and description |
---|
Configuration
(Map rawConfig) |
Configuration
(groovy.util.ConfigObject rawConfig, Properties properties, BuildAdapter buildAdapter, ClassLoader classLoader) |
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() |
|
Object |
getDriverConf() Returns the configuration value for the driver. |
|
protected DriverFactory |
getDriverFactory(Object 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(Object 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 |
isQuitDriverOnBrowserReset() |
|
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 Object |
readValue(String name, Object defaultValue) |
|
protected Object |
readValue(groovy.util.ConfigObject config, String name, Object 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(Object 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(Object 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. |
|
void |
setQuitDriverOnBrowserReset(boolean flag) |
|
Object |
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(Object toWait) Updates the templateOptions.toWait config entry. |
|
void |
setTemplateWaitConditionOption(Closure<?> waitCondition) Updates the templateOptions.waitCondition config entry. |
|
void |
setTemplateWaitOption(Object 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(Object 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) |
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
browser
- The browser to use as the basis of the navigatory factory. Returns the config value baseUrl
, or BuildAdapter.getBaseUrl.
The default retryInterval
value to use for waiting (i.e. if unspecified).
Either the value at config path waiting.retryInterval
or 0.1.
The default timeout
value to use for waiting (i.e. if unspecified).
Either the value at config path waiting.timeout
or 5.
Returns the default configuration closure to be applied before the user- supplied config closure when using the download support.
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.
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.
Returns the inner navigatory factory, that turns WebElements into Navigators. Returns DefaultInnerNavigatorFactory instances by default.
To override, set 'innerNavigatorFactory' to:
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.
Returns the config value reportsDir
, or BuildAdapter.getReportsDir.
Whether or not to throw an exception when implicit "at checks" are being performed and the checked page does not define an "at check".
requirePageAtCheckers
, defaulting to false
if not set.Returns default values used for some of the content DSL template options.
Whether or not to automatically clear the browser's cookies.
Different integrations inspect this property at different times.
autoClearCookies
, defaulting to true
if not set.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.
autoClearWebStorage
, defaulting to false
if not set.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
.
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
.
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
.
Sets the auto clear cookies flag explicitly, overwriting any value from the config script.
Sets the auto clear web storage flag explicitly, overwriting any value from the config script.
Updates the cacheDriver
config entry.
Updates the cacheDriverPerThread
config entry.
Updates the waiting.retryInterval
config entry.
Updates the waiting.timeout
config entry.
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.
Updates the waiting.includeCauseInMessage
config entry.
Sets the inner navigator factory. Only effectual before the browser calls createNavigatorFactory(Browser) initially.
Sets whether or not the cached driver should be quit when the JVM shuts down.
Updates the reporter
config entry.
Sets the requirePageAtCheckers
flag explicitly, overwriting any value from the config script.
Updates the templateOptions.cache
config entry.
Updates the templateOptions.max
config entry.
Updates the templateOptions.min
config entry.
Updates the templateOptions.required
config entry.
Updates the templateOptions.toWait
config entry.
Updates the templateOptions.waitCondition
config entry.
Updates the templateOptions.wait
config entry.
Updates a waiting.preset
config entry for a given preset name.
Updates the withNewWindow.close
config entry.
Updates the withWindow.wait
config entry.
Updates the withWindow.close
config entry.
Groovy API Documentation for Geb 5.0 - Licensed under the Apache License, Version 2.0 - http://www.gebish.org