public interface ConfigurationProperties
It's possible to define those properties using:
getWebDriver())
ConfigurationMutator.setWebDriver(String))
-Dfluentlenium.webDriver=chrome)
FluentConfiguration annotation on test class to configure.
{@literal @FluentConfiguration(webDriver="chrome")} public class SomeFluentTest extends FluentTest {
....
}
/fluentlenium.propertiesin the classpath
webDriver=chrome
...
ConfigurationProperties custom implementation specified by configurationDefaultsproperty.
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 the
configurationFactoryproperty.
ConfigurationFactory,
DefaultConfigurationFactory| Modifier and Type | Interface and Description |
|---|---|
static class |
ConfigurationProperties.DriverLifecycle
Driver lifecycle.
|
static class |
ConfigurationProperties.TriggerMode
Trigger mode for Screenshots and HtmlDump features
|
String getWebDriver()
webDriverproperty. 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".FluentAdapter.newWebDriver()String getRemoteUrl()
remoteUrlproperty. Sets the remoteUrl for "remote" webDriver.
RemoteWebDriverorg.openqa.selenium.Capabilities getCapabilities()
capabilitiesproperty. Sets the Capabilities to use, as a JSON Object or a URL pointing to a JSON Object. Default value is "null".
Capabilities,
Selenium DesiredCapabilities Wiki PageString getBaseUrl()
baseUrlproperty. Sets the base URL used to build absolute URL when relative URL is given to
NavigationControl.goTo(String).
Default value is null.ConfigurationProperties.DriverLifecycle getDriverLifecycle()
driverLifecycleproperty. 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.
Boolean getDeleteCookies()
deleteCookiesproperty. When using CLASS or JVM
driverLifecycleconfiguration property, allow to delete cookies between each test. Default value is false.
Long getPageLoadTimeout()
pageLoadTimeoutproperty. 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.
WebDriver.Timeouts.pageLoadTimeout(long, java.util.concurrent.TimeUnit)Long getImplicitlyWait()
implicitlyWaitproperty. 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.
WebDriver.Timeouts.implicitlyWait(long, java.util.concurrent.TimeUnit)Long getScriptTimeout()
scriptTimeoutproperty. 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.
WebDriver.Timeouts.setScriptTimeout(long, java.util.concurrent.TimeUnit)Long getAwaitAtMost()
awaitAtMostproperty. Sets the default timeout in millisecond when using
AwaitControl.await() or
Wait hook.FluentWait.atMost(long, java.util.concurrent.TimeUnit),
FluentWait.atMost(long)Long getAwaitPollingEvery()
awaitPollingEveryproperty. Sets the default polling frequency in millisecond when using
AwaitControl.await() or
Wait hook.FluentWait.pollingEvery(long, java.util.concurrent.TimeUnit),
FluentWait.pollingEvery(long)Boolean getEventsEnabled()
eventsEnabledproperty. Enables
EventsControl.events() by wrapping the WebDriver in
EventFiringWebDriver.
Default value is true.String getScreenshotPath()
screenshotPathproperty. Sets the filesystem path where screenshot will be saved when calling
SnapshotControl.takeScreenShot() or
SnapshotControl.takeScreenShot(String).
Default value is null.ConfigurationProperties.TriggerMode getScreenshotMode()
screenshotModeproperty. Sets the trigger mode of screenshots. Can be {AUTOMATIC_ON_FAIL} to take screenshot when the test fail or {MANUAL}. Default value is null.
ConfigurationProperties.TriggerModeString getHtmlDumpPath()
htmlDumpPathproperty. Sets the filesystem path where screenshot will be saved when calling
SnapshotControl.takeHtmlDump() or
SnapshotControl.takeHtmlDump(String).
Default value is null.ConfigurationProperties.TriggerMode getHtmlDumpMode()
htmlDumpModeproperty. 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.
ConfigurationProperties.TriggerModeClass<? extends ConfigurationProperties> getConfigurationDefaults()
configurationDefaultsproperty. Set this to a class implementing
ConfigurationProperties to provide the default values
of the configuration properties.
Default value is ConfigurationDefaultsConfigurationProperties instance with default values.Class<? extends ConfigurationFactory> getConfigurationFactory()
configurationFactoryproperty. 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.ConfigurationFactory class.Copyright © 2016 FluentLenium. All Rights Reserved.