public class ProgrammaticConfiguration extends java.lang.Object implements Configuration
Configuration based on JavaBean properties.Configuration,
ConfigurationPropertiesConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode| Constructor and Description |
|---|
ProgrammaticConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Long |
getAwaitAtMost()
awaitAtMost
|
java.lang.Long |
getAwaitPollingEvery()
awaitPollingEvery
|
java.lang.String |
getBaseUrl()
baseUrl
|
java.lang.Long |
getBrowserTimeout()
browserTimeout
|
java.lang.Integer |
getBrowserTimeoutRetries()
browserTimeoutRetries
|
org.openqa.selenium.Capabilities |
getCapabilities()
capabilities
|
java.lang.Class<? extends ConfigurationProperties> |
getConfigurationDefaults()
configurationDefaults
|
java.lang.Class<? extends ConfigurationFactory> |
getConfigurationFactory()
configurationFactory
|
java.lang.String |
getCustomProperty(java.lang.String propertyName)
Get custom property value.
|
java.lang.Boolean |
getDeleteCookies()
deleteCookies
|
ConfigurationProperties.DriverLifecycle |
getDriverLifecycle()
driverLifecycle
|
java.lang.Boolean |
getEventsEnabled()
eventsEnabled
|
ConfigurationProperties.TriggerMode |
getHtmlDumpMode()
htmlDumpMode
|
java.lang.String |
getHtmlDumpPath()
htmlDumpPath
|
java.lang.Long |
getImplicitlyWait()
implicitlyWait
|
java.lang.Long |
getPageLoadTimeout()
pageLoadTimeout
|
java.lang.String |
getRemoteUrl()
remoteUrl
|
ConfigurationProperties.TriggerMode |
getScreenshotMode()
screenshotMode
|
java.lang.String |
getScreenshotPath()
screenshotPath
|
java.lang.Long |
getScriptTimeout()
scriptTimeout
|
java.lang.String |
getWebDriver()
webDriver
|
void |
setAwaitAtMost(java.lang.Long awaitAtMost)
Sets the value of
|
void |
setAwaitPollingEvery(java.lang.Long awaitPollingEvery)
Sets the value of
|
void |
setBaseUrl(java.lang.String baseUrl)
Sets the value of
|
void |
setBrowserTimeout(java.lang.Long timeout)
Sets the value of
|
void |
setBrowserTimeoutRetries(java.lang.Integer retriesNumber)
Sets the value of
|
void |
setCapabilities(org.openqa.selenium.Capabilities capabilities)
Sets the value of
|
void |
setConfigurationDefaults(java.lang.Class<? extends ConfigurationProperties> configurationDefaults)
Set the configuration defaults.
|
void |
setConfigurationFactory(java.lang.Class<? extends ConfigurationFactory> configurationFactory)
Sets the value of
|
void |
setCustomProperty(java.lang.String key,
java.lang.String value)
Sets custom value for a custom property key
|
void |
setDeleteCookies(java.lang.Boolean deleteCookies)
Sets the value of
|
void |
setDriverLifecycle(ConfigurationProperties.DriverLifecycle driverLifecycle)
Sets the value of
|
void |
setEventsEnabled(java.lang.Boolean eventsEnabled)
Sets the value of
|
void |
setHtmlDumpMode(ConfigurationProperties.TriggerMode htmlDumpMode)
Sets the value of
|
void |
setHtmlDumpPath(java.lang.String htmlDumpPath)
Sets the value of
|
void |
setImplicitlyWait(java.lang.Long implicitlyWait)
Sets the value of
|
void |
setPageLoadTimeout(java.lang.Long pageLoadTimeout)
Sets the value of
|
void |
setRemoteUrl(java.lang.String remoteUrl)
Sets the value of
|
void |
setScreenshotMode(ConfigurationProperties.TriggerMode mode)
Sets the value of
|
void |
setScreenshotPath(java.lang.String path)
Sets the value of
|
void |
setScriptTimeout(java.lang.Long scriptTimeout)
Sets the value of
|
void |
setWebDriver(java.lang.String webDriverName)
Sets the value of
|
public void setConfigurationDefaults(java.lang.Class<? extends ConfigurationProperties> configurationDefaults)
configurationDefaults - configuration defaultspublic java.lang.String getWebDriver()
ConfigurationPropertieswebDriverproperty. Sets the WebDriver type to use. When FluentLenium needs to create a new
WebDriver instance, it calls FluentAdapter.newWebDriver()
which delegates to
WebDriversRegistryImpl.newWebDriver(String, Capabilities, ConfigurationProperties)
registry using the value stored in webDriver and capabilities property.
Possible values are "firefox", "chrome", "ie", "htmlunit", or any class name implementing WebDriver.
Default value is "firefox".getWebDriver in interface ConfigurationPropertiesFluentAdapter.newWebDriver()public void setWebDriver(java.lang.String webDriverName)
ConfigurationMutatorwebDriverproperty.
setWebDriver in interface ConfigurationMutatorwebDriverName - property valueConfigurationProperties.getWebDriver()public java.lang.String getRemoteUrl()
ConfigurationPropertiesremoteUrlproperty. Sets the remoteUrl for "remote" webDriver.
getRemoteUrl in interface ConfigurationPropertiesRemoteWebDriverpublic void setRemoteUrl(java.lang.String remoteUrl)
ConfigurationMutatorremoteUrlproperty.
setRemoteUrl in interface ConfigurationMutatorremoteUrl - property valueConfigurationProperties.getRemoteUrl()public org.openqa.selenium.Capabilities getCapabilities()
ConfigurationPropertiescapabilitiesproperty. Sets the Capabilities to use, as a JSON Object or a URL pointing to a JSON Object. Default value is "null".
getCapabilities in interface ConfigurationPropertiesCapabilities,
Selenium DesiredCapabilities Wiki Pagepublic void setCapabilities(org.openqa.selenium.Capabilities capabilities)
ConfigurationMutatorcapabilitiesproperty.
setCapabilities in interface ConfigurationMutatorcapabilities - property valueConfigurationProperties.getCapabilities()public ConfigurationProperties.DriverLifecycle getDriverLifecycle()
ConfigurationPropertiesdriverLifecycleproperty. Sets the lifecycle of the WebDriver. WebDriver is fully managed by FluentLenium, so you should never create or quit a WebDriver by yourself. Please keep in mind that this configures when drivers are created and exited at runtime, but it does not deal with concurrency of your tests. Default value is METHOD.
getDriverLifecycle in interface ConfigurationPropertiespublic java.lang.Long getBrowserTimeout()
ConfigurationPropertiesbrowserTimeoutproperty. Sets the maximum amount of time when the browser should start responding to the WebDriver. Default value is 60 seconds.
getBrowserTimeout in interface ConfigurationPropertiespublic java.lang.Integer getBrowserTimeoutRetries()
ConfigurationPropertiesbrowserTimeoutRetriesproperty. Sets the maximum number of retries for failed WebDriver because of browserTimeout issues. Default value is 2 times.
getBrowserTimeoutRetries in interface ConfigurationPropertiespublic void setBrowserTimeout(java.lang.Long timeout)
ConfigurationMutatorbrowserTimeoutproperty.
setBrowserTimeout in interface ConfigurationMutatortimeout - property valueConfigurationProperties.getBrowserTimeout()public void setBrowserTimeoutRetries(java.lang.Integer retriesNumber)
ConfigurationMutatorbrowserTimeoutRetriesproperty.
setBrowserTimeoutRetries in interface ConfigurationMutatorretriesNumber - property valueConfigurationProperties.getBrowserTimeoutRetries()public void setDriverLifecycle(ConfigurationProperties.DriverLifecycle driverLifecycle)
ConfigurationMutatordriverLifecycleproperty.
setDriverLifecycle in interface ConfigurationMutatordriverLifecycle - property valueConfigurationProperties.getDriverLifecycle()public java.lang.Boolean getDeleteCookies()
ConfigurationPropertiesdeleteCookiesproperty. When using CLASS or JVM
driverLifecycleconfiguration property, allow to delete cookies between each test. Default value is false.
getDeleteCookies in interface ConfigurationPropertiespublic void setDeleteCookies(java.lang.Boolean deleteCookies)
ConfigurationMutatordeleteCookiesproperty.
setDeleteCookies in interface ConfigurationMutatordeleteCookies - property valueConfigurationProperties.getDeleteCookies()public java.lang.Class<? extends ConfigurationFactory> getConfigurationFactory()
ConfigurationPropertiesconfigurationFactoryproperty. Set this to a class implementing
ConfigurationFactory to customize the ways properties are read.
This allow to configure properties from sources that are not supported by default FluentLenium.
Default value is DefaultConfigurationFactory class.getConfigurationFactory in interface ConfigurationPropertiesConfigurationFactory class.public void setConfigurationFactory(java.lang.Class<? extends ConfigurationFactory> configurationFactory)
ConfigurationMutatorconfigurationFactoryproperty.
setConfigurationFactory in interface ConfigurationMutatorconfigurationFactory - property valueConfigurationProperties.getConfigurationFactory()public java.lang.Class<? extends ConfigurationProperties> getConfigurationDefaults()
ConfigurationPropertiesconfigurationDefaultsproperty. Set this to a class implementing
ConfigurationProperties to provide the default values
of the configuration properties.
Default value is ConfigurationDefaultsgetConfigurationDefaults in interface ConfigurationPropertiesConfigurationProperties instance with default values.public java.lang.String getBaseUrl()
ConfigurationPropertiesbaseUrlproperty. Sets the base URL used to build absolute URL when relative URL is given to
NavigationControl.goTo(String).
Default value is null.getBaseUrl in interface ConfigurationPropertiespublic void setBaseUrl(java.lang.String baseUrl)
ConfigurationMutatorbaseUrlproperty.
setBaseUrl in interface ConfigurationMutatorbaseUrl - property value()public java.lang.Long getPageLoadTimeout()
ConfigurationPropertiespageLoadTimeoutproperty. Sets the amount of time in millisecond to wait for a page load to complete before throwing an error. If the timeout is negative, page loads can be indefinite. Default value is null.
getPageLoadTimeout in interface ConfigurationPropertiesWebDriver.Timeouts.pageLoadTimeout(long, java.util.concurrent.TimeUnit)public void setPageLoadTimeout(java.lang.Long pageLoadTimeout)
ConfigurationMutatorpageLoadTimeoutproperty.
setPageLoadTimeout in interface ConfigurationMutatorpageLoadTimeout - property valueConfigurationProperties.getPageLoadTimeout()public java.lang.Long getImplicitlyWait()
ConfigurationPropertiesimplicitlyWaitproperty. Specifies the amount of time in millisecond the driver should wait when searching for an element if it is not immediately present. Default value is null.
getImplicitlyWait in interface ConfigurationPropertiesWebDriver.Timeouts.implicitlyWait(long, java.util.concurrent.TimeUnit)public void setImplicitlyWait(java.lang.Long implicitlyWait)
ConfigurationMutatorimplicitlyWaitproperty.
setImplicitlyWait in interface ConfigurationMutatorimplicitlyWait - property valueConfigurationProperties.getImplicitlyWait()public java.lang.Long getScriptTimeout()
ConfigurationPropertiesscriptTimeoutproperty. Sets the amount of time in millisecond to wait for an asynchronous script to finish execution before throwing an error. If the timeout is negative, then the script will be allowed to run indefinitely. Default value is null.
getScriptTimeout in interface ConfigurationPropertiesWebDriver.Timeouts.setScriptTimeout(long, java.util.concurrent.TimeUnit)public void setScriptTimeout(java.lang.Long scriptTimeout)
ConfigurationMutatorscriptTimeoutproperty.
setScriptTimeout in interface ConfigurationMutatorscriptTimeout - property valueConfigurationProperties.getScriptTimeout()public java.lang.Long getAwaitAtMost()
ConfigurationPropertiesawaitAtMostproperty. Sets the default timeout in millisecond when using
AwaitControl.await() or
Wait hook.getAwaitAtMost in interface ConfigurationPropertiesFluentWait.atMost(long, java.util.concurrent.TimeUnit),
FluentWait.atMost(long)public void setAwaitAtMost(java.lang.Long awaitAtMost)
ConfigurationMutatorawaitAtMostproperty
setAwaitAtMost in interface ConfigurationMutatorawaitAtMost - property valueConfigurationProperties.getAwaitAtMost()public java.lang.Long getAwaitPollingEvery()
ConfigurationPropertiesawaitPollingEveryproperty. Sets the default polling frequency in millisecond when using
AwaitControl.await() or
Wait hook.getAwaitPollingEvery in interface ConfigurationPropertiesFluentWait.pollingEvery(long, java.util.concurrent.TimeUnit),
FluentWait.pollingEvery(long)public void setAwaitPollingEvery(java.lang.Long awaitPollingEvery)
ConfigurationMutatorawaitPollingEveryproperty
setAwaitPollingEvery in interface ConfigurationMutatorawaitPollingEvery - property valueConfigurationProperties.getAwaitPollingEvery()public java.lang.Boolean getEventsEnabled()
ConfigurationPropertieseventsEnabledproperty. Enables
EventsControl.events() by wrapping the WebDriver in
EventFiringWebDriver.
Default value is true.getEventsEnabled in interface ConfigurationPropertiespublic void setEventsEnabled(java.lang.Boolean eventsEnabled)
ConfigurationMutatoreventsEnabledproperty.
setEventsEnabled in interface ConfigurationMutatoreventsEnabled - property valuepublic void setScreenshotPath(java.lang.String path)
ConfigurationMutatorscreenshotPathproperty.
setScreenshotPath in interface ConfigurationMutatorpath - property valueConfigurationProperties.getScreenshotPath()public void setHtmlDumpPath(java.lang.String htmlDumpPath)
ConfigurationMutatorhtmlDumpPathproperty.
setHtmlDumpPath in interface ConfigurationMutatorhtmlDumpPath - property valueConfigurationProperties.getHtmlDumpPath()public void setScreenshotMode(ConfigurationProperties.TriggerMode mode)
ConfigurationMutatorscreenshotModeproperty.
setScreenshotMode in interface ConfigurationMutatormode - property valueConfigurationProperties.getScreenshotMode()public ConfigurationProperties.TriggerMode getScreenshotMode()
ConfigurationPropertiesscreenshotModeproperty. Sets the trigger mode of screenshots. Can be {AUTOMATIC_ON_FAIL} to take screenshot when the test fail or {MANUAL}. Default value is null.
getScreenshotMode in interface ConfigurationPropertiesConfigurationProperties.TriggerModepublic java.lang.String getScreenshotPath()
ConfigurationPropertiesscreenshotPathproperty. Sets the filesystem path where screenshot will be saved when calling
SnapshotControl.takeScreenshot() or
SnapshotControl.takeScreenshot(String).
Default value is null.getScreenshotPath in interface ConfigurationPropertiespublic java.lang.String getHtmlDumpPath()
ConfigurationPropertieshtmlDumpPathproperty. Sets the filesystem path where screenshot will be saved when calling
SnapshotControl.takeHtmlDump() or
SnapshotControl.takeHtmlDump(String).
Default value is null.getHtmlDumpPath in interface ConfigurationPropertiespublic void setHtmlDumpMode(ConfigurationProperties.TriggerMode htmlDumpMode)
ConfigurationMutatorhtmlDumpModeproperty.
setHtmlDumpMode in interface ConfigurationMutatorhtmlDumpMode - property valueConfigurationProperties.getHtmlDumpMode()public ConfigurationProperties.TriggerMode getHtmlDumpMode()
ConfigurationPropertieshtmlDumpModeproperty. Sets the trigger mode of htmlDump. Can be {AUTOMATIC_ON_FAIL} to take html dump when the test fail or {MANUAL}. Default value is null.
getHtmlDumpMode in interface ConfigurationPropertiesConfigurationProperties.TriggerModepublic java.lang.String getCustomProperty(java.lang.String propertyName)
ConfigurationPropertiesgetCustomProperty in interface ConfigurationPropertiespropertyName - name of the propertypublic void setCustomProperty(java.lang.String key,
java.lang.String value)
ConfigurationMutatorsetCustomProperty in interface ConfigurationMutatorkey - custom property keyvalue - custom property valueCopyright © 2018 FluentLenium. All Rights Reserved.