Class ComposedConfiguration
- All Implemented Interfaces:
Configuration
,ConfigurationMutator
,ConfigurationProperties
When writing a value, it will go in the writable configuration (ConfigurationMutator
).
When reading a value, it will get the first value found in the composition of read
configurations
(ConfigurationProperties
).
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.fluentlenium.configuration.ConfigurationProperties
ConfigurationProperties.DriverLifecycle, ConfigurationProperties.TriggerMode
-
Constructor Summary
ConstructorDescriptionComposedConfiguration
(ConfigurationMutator writableConfiguration, ConfigurationProperties... configurations) Creates a new composed configuration -
Method Summary
Modifier and TypeMethodDescriptionawaitAtMostawaitPollingEverybaseUrlbrowserTimeoutbrowserTimeoutRetriesorg.openqa.selenium.Capabilities
capabilitiesClass<? extends ConfigurationProperties>
configurationDefaultsClass<? extends ConfigurationFactory>
configurationFactorygetCustomProperty
(String propertyName) Get custom property value.deleteCookiesdriverLifecycleeventsEnabledhtmlDumpModehtmlDumpPathimplicitlyWaitpageLoadTimeoutremoteUrlscreenshotModescreenshotPathscriptTimeoutwebDrivervoid
setAwaitAtMost
(Long awaitAtMost) Sets the value ofvoid
setAwaitPollingEvery
(Long awaitPollingEvery) Sets the value ofvoid
setBaseUrl
(String baseUrl) Sets the value ofvoid
setBrowserTimeout
(Long timeout) Sets the value ofvoid
setBrowserTimeoutRetries
(Integer retriesNumber) Sets the value ofvoid
setCapabilities
(org.openqa.selenium.Capabilities capabilities) Sets the value ofvoid
setConfigurationFactory
(Class<? extends ConfigurationFactory> configurationFactory) Sets the value ofvoid
setCustomProperty
(String key, String value) Sets custom value for a custom property keyvoid
setDeleteCookies
(Boolean deleteCookies) Sets the value ofvoid
setDriverLifecycle
(ConfigurationProperties.DriverLifecycle driverLifecycle) Sets the value ofvoid
setEventsEnabled
(Boolean eventsEnabled) Sets the value ofvoid
setHtmlDumpMode
(ConfigurationProperties.TriggerMode htmlDumpMode) Sets the value ofvoid
setHtmlDumpPath
(String htmlDumpPath) Sets the value ofvoid
setImplicitlyWait
(Long implicitlyWait) Sets the value ofvoid
setPageLoadTimeout
(Long pageLoadTimeout) Sets the value ofvoid
setRemoteUrl
(String remoteUrl) Sets the value ofvoid
setScreenshotMode
(ConfigurationProperties.TriggerMode screenshotMode) Sets the value ofvoid
setScreenshotPath
(String screenshotPath) Sets the value ofvoid
setScriptTimeout
(Long scriptTimeout) Sets the value ofvoid
setWebDriver
(String webDriver) Sets the value of
-
Constructor Details
-
ComposedConfiguration
public ComposedConfiguration(ConfigurationMutator writableConfiguration, ConfigurationProperties... configurations) Creates a new composed configuration- Parameters:
writableConfiguration
- writable configurationconfigurations
- readable configurations
-
-
Method Details
-
getConfigurationFactory
Description copied from interface:ConfigurationProperties
configurationFactory
property. Set this to a class implementingConfigurationFactory
to customize the ways properties are read. This allow to configure properties from sources that are not supported by default FluentLenium. Default value isDefaultConfigurationFactory
class.- Specified by:
getConfigurationFactory
in interfaceConfigurationProperties
- Returns:
- Custom
ConfigurationFactory
class.
-
getConfigurationDefaults
Description copied from interface:ConfigurationProperties
configurationDefaults
property. Set this to a class implementingConfigurationProperties
to provide the default values of the configuration properties. Default value isConfigurationDefaults
- Specified by:
getConfigurationDefaults
in interfaceConfigurationProperties
- Returns:
- Custom
ConfigurationProperties
instance with default values.
-
getWebDriver
Description copied from interface:ConfigurationProperties
webDriver
property.Sets the WebDriver type to use.
When FluentLenium needs to create a new
WebDriver
instance, it callsIFluentAdapter.newWebDriver()
which delegates toWebDriversRegistryImpl.newWebDriver(String, Capabilities, ConfigurationProperties)
registry using the value stored in webDriver and capabilities property.Possible values are "firefox", "chrome", "ie", "edge", "htmlunit", "safari", "opera", "remote" or any class name implementing
WebDriver
or any name that is defined in the `@FactoryName` annotation of a `WebDriverFactory` implementation.Default value is "firefox".
- Specified by:
getWebDriver
in interfaceConfigurationProperties
- Returns:
- webDriver property value
- See Also:
-
getRemoteUrl
Description copied from interface:ConfigurationProperties
remoteUrl
property. Sets the remoteUrl for "remote" webDriver.- Specified by:
getRemoteUrl
in interfaceConfigurationProperties
- Returns:
- remoteUrl property value
- See Also:
-
RemoteWebDriver
-
getCapabilities
public org.openqa.selenium.Capabilities getCapabilities()Description copied from interface:ConfigurationProperties
capabilities
property. Sets the Capabilities to use, as a JSON Object or a URL pointing to a JSON Object. Default value is "null".- Specified by:
getCapabilities
in interfaceConfigurationProperties
- Returns:
- Capabilities property value
- See Also:
-
Capabilities
- Selenium DesiredCapabilities Wiki Page
-
getDriverLifecycle
Description copied from interface:ConfigurationProperties
driverLifecycle
property. 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.- Specified by:
getDriverLifecycle
in interfaceConfigurationProperties
- Returns:
- driverLifecycle property value
-
getBrowserTimeout
Description copied from interface:ConfigurationProperties
browserTimeout
property. Sets the maximum amount of time when the browser should start responding to the WebDriver. Default value is 60 seconds.- Specified by:
getBrowserTimeout
in interfaceConfigurationProperties
- Returns:
- long
-
getBrowserTimeoutRetries
Description copied from interface:ConfigurationProperties
browserTimeoutRetries
property. Sets the maximum number of retries for failed WebDriver because of browserTimeout issues. Default value is 2 times.- Specified by:
getBrowserTimeoutRetries
in interfaceConfigurationProperties
- Returns:
- Integer
-
getDeleteCookies
Description copied from interface:ConfigurationProperties
deleteCookies
property. When using CLASS or JVMdriverLifecycle
configuration property, allow to delete cookies between each test. Default value is false.- Specified by:
getDeleteCookies
in interfaceConfigurationProperties
- Returns:
- deleteCookies property value.
-
getBaseUrl
Description copied from interface:ConfigurationProperties
baseUrl
property. Sets the base URL used to build absolute URL when relative URL is given toFluentControl.goTo(String)
. Default value is null.- Specified by:
getBaseUrl
in interfaceConfigurationProperties
- Returns:
- baseUrl property value
-
getPageLoadTimeout
Description copied from interface:ConfigurationProperties
pageLoadTimeout
property. 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.- Specified by:
getPageLoadTimeout
in interfaceConfigurationProperties
- Returns:
- pageLoadTimeout property value
- See Also:
-
WebDriver.Timeouts.pageLoadTimeout(long, java.util.concurrent.TimeUnit)
-
getImplicitlyWait
Description copied from interface:ConfigurationProperties
implicitlyWait
property. 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.- Specified by:
getImplicitlyWait
in interfaceConfigurationProperties
- Returns:
- implicitlyWait property value
- See Also:
-
WebDriver.Timeouts.implicitlyWait(long, java.util.concurrent.TimeUnit)
-
getScriptTimeout
Description copied from interface:ConfigurationProperties
scriptTimeout
property. 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.- Specified by:
getScriptTimeout
in interfaceConfigurationProperties
- Returns:
- scriptTimeout property value
- See Also:
-
WebDriver.Timeouts.setScriptTimeout(long, java.util.concurrent.TimeUnit)
-
getAwaitAtMost
Description copied from interface:ConfigurationProperties
awaitAtMost
property. Sets the default timeout in millisecond when usingFluentControl.await()
orWait
hook.- Specified by:
getAwaitAtMost
in interfaceConfigurationProperties
- Returns:
- awaitTimeout property value
- See Also:
-
getAwaitPollingEvery
Description copied from interface:ConfigurationProperties
awaitPollingEvery
property. Sets the default polling frequency in millisecond when usingFluentControl.await()
orWait
hook.- Specified by:
getAwaitPollingEvery
in interfaceConfigurationProperties
- Returns:
- awaitPollingEvery property value
- See Also:
-
getEventsEnabled
Description copied from interface:ConfigurationProperties
eventsEnabled
property. EnablesFluentControl.events()
by wrapping theWebDriver
inEventFiringWebDriver
. Default value is true.- Specified by:
getEventsEnabled
in interfaceConfigurationProperties
- Returns:
- eventsEnabled property value.
-
getScreenshotPath
Description copied from interface:ConfigurationProperties
screenshotPath
property. Sets the filesystem path where screenshot will be saved when callingFluentControl.takeScreenshot()
orFluentControl.takeScreenshot(String)
. Default value is null.- Specified by:
getScreenshotPath
in interfaceConfigurationProperties
- Returns:
- screenshotPath property value
-
getHtmlDumpPath
Description copied from interface:ConfigurationProperties
htmlDumpPath
property. Sets the filesystem path where screenshot will be saved when callingFluentControl.takeHtmlDump()
orFluentControl.takeHtmlDump(String)
. Default value is null.- Specified by:
getHtmlDumpPath
in interfaceConfigurationProperties
- Returns:
- htmlDumpPath property value
-
getScreenshotMode
Description copied from interface:ConfigurationProperties
screenshotMode
property. Sets the trigger mode of screenshots. Can be {AUTOMATIC_ON_FAIL} to take screenshot when the test fail or {MANUAL}. Default value is null.- Specified by:
getScreenshotMode
in interfaceConfigurationProperties
- Returns:
- screenshotMode property value.
- See Also:
-
getHtmlDumpMode
Description copied from interface:ConfigurationProperties
htmlDumpMode
property. 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.- Specified by:
getHtmlDumpMode
in interfaceConfigurationProperties
- Returns:
- htmlDumpMode property value.
- See Also:
-
getCustomProperty
Description copied from interface:ConfigurationProperties
Get custom property value.- Specified by:
getCustomProperty
in interfaceConfigurationProperties
- Parameters:
propertyName
- name of the property- Returns:
- property value
-
setConfigurationFactory
Description copied from interface:ConfigurationMutator
Sets the value ofconfigurationFactory
property.- Specified by:
setConfigurationFactory
in interfaceConfigurationMutator
- Parameters:
configurationFactory
- property value- See Also:
-
setDeleteCookies
Description copied from interface:ConfigurationMutator
Sets the value ofdeleteCookies
property.- Specified by:
setDeleteCookies
in interfaceConfigurationMutator
- Parameters:
deleteCookies
- property value- See Also:
-
setCustomProperty
Description copied from interface:ConfigurationMutator
Sets custom value for a custom property key- Specified by:
setCustomProperty
in interfaceConfigurationMutator
- Parameters:
key
- custom property keyvalue
- custom property value
-
setBaseUrl
Description copied from interface:ConfigurationMutator
Sets the value ofbaseUrl
property.- Specified by:
setBaseUrl
in interfaceConfigurationMutator
- Parameters:
baseUrl
- property value- See Also:
-
setWebDriver
Description copied from interface:ConfigurationMutator
Sets the value ofwebDriver
property.- Specified by:
setWebDriver
in interfaceConfigurationMutator
- Parameters:
webDriver
- property value- See Also:
-
setPageLoadTimeout
Description copied from interface:ConfigurationMutator
Sets the value ofpageLoadTimeout
property.- Specified by:
setPageLoadTimeout
in interfaceConfigurationMutator
- Parameters:
pageLoadTimeout
- property value- See Also:
-
setHtmlDumpMode
Description copied from interface:ConfigurationMutator
Sets the value ofhtmlDumpMode
property.- Specified by:
setHtmlDumpMode
in interfaceConfigurationMutator
- Parameters:
htmlDumpMode
- property value- See Also:
-
setScreenshotPath
Description copied from interface:ConfigurationMutator
Sets the value ofscreenshotPath
property.- Specified by:
setScreenshotPath
in interfaceConfigurationMutator
- Parameters:
screenshotPath
- property value- See Also:
-
setBrowserTimeoutRetries
Description copied from interface:ConfigurationMutator
Sets the value ofbrowserTimeoutRetries
property.- Specified by:
setBrowserTimeoutRetries
in interfaceConfigurationMutator
- Parameters:
retriesNumber
- property value- See Also:
-
setRemoteUrl
Description copied from interface:ConfigurationMutator
Sets the value ofremoteUrl
property.- Specified by:
setRemoteUrl
in interfaceConfigurationMutator
- Parameters:
remoteUrl
- property value- See Also:
-
setImplicitlyWait
Description copied from interface:ConfigurationMutator
Sets the value ofimplicitlyWait
property.- Specified by:
setImplicitlyWait
in interfaceConfigurationMutator
- Parameters:
implicitlyWait
- property value- See Also:
-
setDriverLifecycle
Description copied from interface:ConfigurationMutator
Sets the value ofdriverLifecycle
property.- Specified by:
setDriverLifecycle
in interfaceConfigurationMutator
- Parameters:
driverLifecycle
- property value- See Also:
-
setAwaitPollingEvery
Description copied from interface:ConfigurationMutator
Sets the value ofawaitPollingEvery
property- Specified by:
setAwaitPollingEvery
in interfaceConfigurationMutator
- Parameters:
awaitPollingEvery
- property value- See Also:
-
setCapabilities
public void setCapabilities(org.openqa.selenium.Capabilities capabilities) Description copied from interface:ConfigurationMutator
Sets the value ofcapabilities
property.- Specified by:
setCapabilities
in interfaceConfigurationMutator
- Parameters:
capabilities
- property value- See Also:
-
setScreenshotMode
Description copied from interface:ConfigurationMutator
Sets the value ofscreenshotMode
property.- Specified by:
setScreenshotMode
in interfaceConfigurationMutator
- Parameters:
screenshotMode
- property value- See Also:
-
setHtmlDumpPath
Description copied from interface:ConfigurationMutator
Sets the value ofhtmlDumpPath
property.- Specified by:
setHtmlDumpPath
in interfaceConfigurationMutator
- Parameters:
htmlDumpPath
- property value- See Also:
-
setAwaitAtMost
Description copied from interface:ConfigurationMutator
Sets the value ofawaitAtMost
property- Specified by:
setAwaitAtMost
in interfaceConfigurationMutator
- Parameters:
awaitAtMost
- property value- See Also:
-
setBrowserTimeout
Description copied from interface:ConfigurationMutator
Sets the value ofbrowserTimeout
property.- Specified by:
setBrowserTimeout
in interfaceConfigurationMutator
- Parameters:
timeout
- property value- See Also:
-
setScriptTimeout
Description copied from interface:ConfigurationMutator
Sets the value ofscriptTimeout
property.- Specified by:
setScriptTimeout
in interfaceConfigurationMutator
- Parameters:
scriptTimeout
- property value- See Also:
-
setEventsEnabled
Description copied from interface:ConfigurationMutator
Sets the value ofeventsEnabled
property.- Specified by:
setEventsEnabled
in interfaceConfigurationMutator
- Parameters:
eventsEnabled
- property value
-