balin / com.github.epadronu.balin.config / Configuration

Configuration

data class Configuration : ConfigurationSetup

This class defines a special kind of configuration setup that may contain other configuration setups, to be used according to the balin.setup.name system property.

val developmentConfigurationSetup: ConfigurationSetup = Configuration(false, testFactory)

val desiredConfigurationSetup = ConfigurationBuilder().apply {
    driverFactory = testFactory

    setups = mapOf(
        "development" to setup {
            autoQuit = developmentConfigurationSetup.autoQuit
            driverFactory = developmentConfigurationSetup.driverFactory
        }
    )
}.build()

System.setProperty(Browser.BALIN_SETUP_NAME_PROPERTY, "development")

Browser.drive(desiredConfigurationSetup) {
    Assert.assertEquals(configurationSetup, developmentConfigurationSetup)
}

See Also

ConfigurationSetup

Constructors

<init>

Configuration(autoQuit: Boolean = ConfigurationSetup.Default.autoQuit, driverFactory: () -> WebDriver = ConfigurationSetup.Default.driverFactory, waitForSleepTimeInMilliseconds: Long = ConfigurationSetup.Default.waitForSleepTimeInMilliseconds, waitForTimeOutTimeInSeconds: Long = ConfigurationSetup.Default.waitForTimeOutTimeInSeconds, setups: Map<String, ConfigurationSetup> = emptyMap())

Creates a new configuration setup

Properties

autoQuit

val autoQuit: Boolean

control whether the driver quits at the end of com.github.epadronu.balin.core.Browser.drive.

driverFactory

val driverFactory: () -> WebDriver

the factory that will create the driver to be used when invoking com.github.epadronu.balin.core.Browser.drive.

setups

val setups: Map<String, ConfigurationSetup>

may contain configuration setups to be used according to the balin.setup.name system property.

waitForSleepTimeInMilliseconds

val waitForSleepTimeInMilliseconds: Long

control the amount of time between attempts when using com.github.epadronu.balin.core.WaitingSupport.waitFor.

waitForTimeOutTimeInSeconds

val waitForTimeOutTimeInSeconds: Long

control the total amount of time to wait for a condition evaluated by com.github.epadronu.balin.core.WaitingSupport.waitFor to hold.