Interface ConfigurationProperties
-
- All Known Subinterfaces:
Configuration
,FluentControl
,FluentPageControl
- All Known Implementing Classes:
AnnotationConfiguration
,BaseFluentHook
,BaseHook
,ComposedConfiguration
,ConfigurationDefaults
,ContainerFluentControl
,DefaultFluentContainer
,FluentAdapter
,FluentControlImpl
,FluentDriver
,FluentPage
,FluentStandalone
,FluentStandaloneRunnable
,FluentTestRunnerAdapter
,IsolatedTest
,ProgrammaticConfiguration
,PropertiesBackendConfiguration
,WaitHook
public interface ConfigurationProperties
FluentLenium can be configured in many ways through configuration properties.It's possible to define those properties using:
- Overrides of JavaBean property getters of the test class.
(ie. override
getWebDriver()
) - JavaBean property setters of the test class.
(ie. call
ConfigurationMutator.setWebDriver(String)
) - System properties of the Java Environment, passed using -D on the command line.
Property names must be prefixed with fluentlenium..
(ie. Launch test with
-Dfluentlenium.webDriver=chrome
) - Environment Variable of the Operating System. Property names must be prefixed with fluentlenium.. (ie: EXPORT fluentlenium.webDriver=chrome)
-
FluentConfiguration
annotation on test class to configure.{@literal @FluentConfiguration(webDriver="chrome")} public class SomeFluentTest extends FluentTest { .... }
-
Java Properties file located at
/fluentlenium.properties
in the classpathwebDriver=chrome ...
-
ConfigurationProperties
custom implementation specified byconfigurationDefaults
property.public class CustomConfigurationDefaults extends ConfigurationDefaults { {@literal @Override} public String getWebDriver() { return "chrome"; } } $ cat fluentlenium.properties configurationDefaults=org.your.package.CustomConfigurationDefaults
You may implement additionnal ways to read configuration property by implementing another
ConfigurationFactory
and set your configuration factory class in theconfigurationFactory
property.- See Also:
ConfigurationFactory
,DefaultConfigurationFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ConfigurationProperties.DriverLifecycle
Driver lifecycle.static class
ConfigurationProperties.TriggerMode
Trigger mode for Screenshots and HtmlDump features
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Long
getAwaitAtMost()
awaitAtMostjava.lang.Long
getAwaitPollingEvery()
awaitPollingEveryjava.lang.String
getBaseUrl()
baseUrljava.lang.Long
getBrowserTimeout()
browserTimeoutjava.lang.Integer
getBrowserTimeoutRetries()
browserTimeoutRetriesorg.openqa.selenium.Capabilities
getCapabilities()
capabilitiesjava.lang.Class<? extends ConfigurationProperties>
getConfigurationDefaults()
configurationDefaultsjava.lang.Class<? extends ConfigurationFactory>
getConfigurationFactory()
configurationFactoryjava.lang.String
getCustomProperty(java.lang.String propertyName)
Get custom property value.java.lang.Boolean
getDeleteCookies()
deleteCookiesConfigurationProperties.DriverLifecycle
getDriverLifecycle()
driverLifecyclejava.lang.Boolean
getEventsEnabled()
eventsEnabledConfigurationProperties.TriggerMode
getHtmlDumpMode()
htmlDumpModejava.lang.String
getHtmlDumpPath()
htmlDumpPathjava.lang.Long
getImplicitlyWait()
implicitlyWaitjava.lang.Long
getPageLoadTimeout()
pageLoadTimeoutjava.lang.String
getRemoteUrl()
remoteUrlConfigurationProperties.TriggerMode
getScreenshotMode()
screenshotModejava.lang.String
getScreenshotPath()
screenshotPathjava.lang.Long
getScriptTimeout()
scriptTimeoutjava.lang.String
getWebDriver()
webDriver
-
-
-
Method Detail
-
getWebDriver
java.lang.String getWebDriver()
webDriver
property.Sets the WebDriver type to use.
When FluentLenium needs to create a new
WebDriver
instance, it callsFluentAdapter.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", "phantomjs", "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".
- Returns:
- webDriver property value
- See Also:
FluentAdapter.newWebDriver()
,DefaultWebDriverFactories
-
getRemoteUrl
java.lang.String getRemoteUrl()
remoteUrl
property. Sets the remoteUrl for "remote" webDriver.- Returns:
- remoteUrl property value
- See Also:
RemoteWebDriver
-
getCapabilities
org.openqa.selenium.Capabilities getCapabilities()
capabilities
property. Sets the Capabilities to use, as a JSON Object or a URL pointing to a JSON Object. Default value is "null".- Returns:
- Capabilities property value
- See Also:
Capabilities
, Selenium DesiredCapabilities Wiki Page
-
getBaseUrl
java.lang.String getBaseUrl()
baseUrl
property. Sets the base URL used to build absolute URL when relative URL is given toFluentControlImpl.goTo(String)
. Default value is null.- Returns:
- baseUrl property value
-
getDriverLifecycle
ConfigurationProperties.DriverLifecycle getDriverLifecycle()
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.- Returns:
- driverLifecycle property value
-
getBrowserTimeout
java.lang.Long getBrowserTimeout()
browserTimeout
property. Sets the maximum amount of time when the browser should start responding to the WebDriver. Default value is 60 seconds.- Returns:
- long
-
getBrowserTimeoutRetries
java.lang.Integer getBrowserTimeoutRetries()
browserTimeoutRetries
property. Sets the maximum number of retries for failed WebDriver because of browserTimeout issues. Default value is 2 times.- Returns:
- Integer
-
getDeleteCookies
java.lang.Boolean getDeleteCookies()
deleteCookies
property. When using CLASS or JVMdriverLifecycle
configuration property, allow to delete cookies between each test. Default value is false.- Returns:
- deleteCookies property value.
-
getPageLoadTimeout
java.lang.Long getPageLoadTimeout()
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.- Returns:
- pageLoadTimeout property value
- See Also:
WebDriver.Timeouts.pageLoadTimeout(long, java.util.concurrent.TimeUnit)
-
getImplicitlyWait
java.lang.Long getImplicitlyWait()
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.- Returns:
- implicitlyWait property value
- See Also:
WebDriver.Timeouts.implicitlyWait(long, java.util.concurrent.TimeUnit)
-
getScriptTimeout
java.lang.Long getScriptTimeout()
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.- Returns:
- scriptTimeout property value
- See Also:
WebDriver.Timeouts.setScriptTimeout(long, java.util.concurrent.TimeUnit)
-
getAwaitAtMost
java.lang.Long getAwaitAtMost()
awaitAtMost
property. Sets the default timeout in millisecond when usingAwaitControl.await()
orWait
hook.- Returns:
- awaitTimeout property value
- See Also:
FluentWaitConfiguration.atMost(long, java.util.concurrent.TimeUnit)
,FluentWaitConfiguration.atMost(long)
-
getAwaitPollingEvery
java.lang.Long getAwaitPollingEvery()
awaitPollingEvery
property. Sets the default polling frequency in millisecond when usingAwaitControl.await()
orWait
hook.- Returns:
- awaitPollingEvery property value
- See Also:
FluentWaitConfiguration.pollingEvery(long, java.util.concurrent.TimeUnit)
,FluentWaitConfiguration.pollingEvery(long)
-
getEventsEnabled
java.lang.Boolean getEventsEnabled()
eventsEnabled
property. EnablesFluentControlImpl.events()
by wrapping theWebDriver
inEventFiringWebDriver
. Default value is true.- Returns:
- eventsEnabled property value.
-
getScreenshotPath
java.lang.String getScreenshotPath()
screenshotPath
property. Sets the filesystem path where screenshot will be saved when callingFluentControlImpl.takeScreenshot()
orFluentControlImpl.takeScreenshot(String)
. Default value is null.- Returns:
- screenshotPath property value
-
getScreenshotMode
ConfigurationProperties.TriggerMode getScreenshotMode()
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.- Returns:
- screenshotMode property value.
- See Also:
ConfigurationProperties.TriggerMode
-
getHtmlDumpPath
java.lang.String getHtmlDumpPath()
htmlDumpPath
property. Sets the filesystem path where screenshot will be saved when callingFluentControlImpl.takeHtmlDump()
orFluentControlImpl.takeHtmlDump(String)
. Default value is null.- Returns:
- htmlDumpPath property value
-
getHtmlDumpMode
ConfigurationProperties.TriggerMode getHtmlDumpMode()
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.- Returns:
- htmlDumpMode property value.
- See Also:
ConfigurationProperties.TriggerMode
-
getConfigurationDefaults
java.lang.Class<? extends ConfigurationProperties> getConfigurationDefaults()
configurationDefaults
property. Set this to a class implementingConfigurationProperties
to provide the default values of the configuration properties. Default value isConfigurationDefaults
- Returns:
- Custom
ConfigurationProperties
instance with default values.
-
getConfigurationFactory
java.lang.Class<? extends ConfigurationFactory> getConfigurationFactory()
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.- Returns:
- Custom
ConfigurationFactory
class.
-
getCustomProperty
java.lang.String getCustomProperty(java.lang.String propertyName)
Get custom property value.- Parameters:
propertyName
- name of the property- Returns:
- property value
-
-