How to use ConfigurationTests class of com.github.epadronu.balin.config package

Best Balin code snippet using com.github.epadronu.balin.config.ConfigurationTests

Run Balin automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

ConfigurationBuilder.kt

Source: ConfigurationBuilder.kt Github

copy
1/******************************************************************************
2 * Copyright 2016 Edinson E. Padrón Urdaneta
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17/* ***************************************************************************/
18package com.github.epadronu.balin.config
19/* ***************************************************************************/
20
21/* ***************************************************************************/
22/**
23 * Defines the builder used in the configuration DSL that can be interacted
24 * with via the [com.github.epadronu.balin.core.Browser.configure] method.
25 *
26 * @see ConfigurationSetup
27 * @sample com.github.epadronu.balin.config.ConfigurationTests.call_the_configure_method_and_make_changes
28 *
29 * @property setups may contain configuration setups to be used according to the `balin.setup.name` system property.
30 * @constructor Creates a new configuration builder.
31 */
32class ConfigurationBuilder : ConfigurationSetupBuilder() {
33
34    var setups: Map<String, ConfigurationSetup> = mapOf()
35
36    /**
37     * Domain-Specific language that let's you create a configuration.
38     *
39     * @sample com.github.epadronu.balin.config.ConfigurationTests.call_the_drive_method_with_a_development_setup_configuration_and_use_it
40     *
41     * @param block here you can interact with the DSL.
42     */
43    fun setup(block: ConfigurationSetupBuilder.() -> Unit): ConfigurationSetup = ConfigurationSetupBuilder().apply {
44        block()
45    }.build()
46
47    /**
48     * Creates a new configuration.
49     *
50     * @return a new configuration setup using the options provided to the builder.
51     */
52    override fun build(): Configuration = Configuration(
53        autoQuit, driverFactory, waitForSleepTimeInMilliseconds, waitForTimeOutTimeInSeconds, setups)
54}
55/* ***************************************************************************/
56
Full Screen

ConfigurationSetupBuilder.kt

Source: ConfigurationSetupBuilder.kt Github

copy
1/******************************************************************************
2 * Copyright 2016 Edinson E. Padrón Urdaneta
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17/* ***************************************************************************/
18package com.github.epadronu.balin.config
19/* ***************************************************************************/
20
21/* ***************************************************************************/
22import org.openqa.selenium.WebDriver
23/* ***************************************************************************/
24
25/* ***************************************************************************/
26/**
27 * Defines the builder used in the configuration DSL that can be interacted
28 * with via the [com.github.epadronu.balin.core.Browser.configure] method.
29 *
30 * @see ConfigurationSetup
31 * @sample com.github.epadronu.balin.config.ConfigurationTests.call_the_configure_method_and_make_changes
32 *
33 * @property autoQuit control whether the driver quits at the end of [com.github.epadronu.balin.core.Browser.drive].
34 * @property driverFactory the factory that will create the driver to be used when invoking [com.github.epadronu.balin.core.Browser.drive].
35 * @property waitForSleepTimeInMilliseconds control the amount of time between attempts when using [com.github.epadronu.balin.core.WaitingSupport.waitFor].
36 * @property waitForTimeOutTimeInSeconds control the total amount of time to wait for a condition evaluated by [com.github.epadronu.balin.core.WaitingSupport.waitFor] to hold.
37 * @constructor Creates a new configuration setup builder.
38 */
39open class ConfigurationSetupBuilder {
40
41    var autoQuit: Boolean = ConfigurationSetup.Default.autoQuit
42
43    var driverFactory: () -> WebDriver = ConfigurationSetup.Default.driverFactory
44
45    var waitForSleepTimeInMilliseconds: Long = ConfigurationSetup.Default.waitForSleepTimeInMilliseconds
46
47    var waitForTimeOutTimeInSeconds: Long = ConfigurationSetup.Default.waitForTimeOutTimeInSeconds
48
49    /**
50     * Creates a new configuration setup.
51     *
52     * @return a new configuration setup using the options provided to the builder.
53     */
54    open fun build(): ConfigurationSetup = Configuration(
55        autoQuit, driverFactory, waitForSleepTimeInMilliseconds, waitForTimeOutTimeInSeconds)
56}
57/* ***************************************************************************/
58
Full Screen

Configuration.kt

Source: Configuration.kt Github

copy
1/******************************************************************************
2 * Copyright 2016 Edinson E. Padrón Urdaneta
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17/* ***************************************************************************/
18package com.github.epadronu.balin.config
19/* ***************************************************************************/
20
21/* ***************************************************************************/
22import org.openqa.selenium.WebDriver
23/* ***************************************************************************/
24
25/* ***************************************************************************/
26/**
27 * This class defines a special kind of configuration setup that may contain
28 * other configuration setups, to be used according to the `balin.setup.name`
29 * system property.
30 *
31 * @see ConfigurationSetup
32 * @sample com.github.epadronu.balin.config.ConfigurationTests.call_the_drive_method_with_a_development_setup_configuration_and_use_it
33 *
34 * @property autoQuit control whether the driver quits at the end of [com.github.epadronu.balin.core.Browser.drive].
35 * @property driverFactory the factory that will create the driver to be used when invoking [com.github.epadronu.balin.core.Browser.drive].
36 * @property waitForSleepTimeInMilliseconds control the amount of time between attempts when using [com.github.epadronu.balin.core.WaitingSupport.waitFor].
37 * @property waitForTimeOutTimeInSeconds control the total amount of time to wait for a condition evaluated by [com.github.epadronu.balin.core.WaitingSupport.waitFor] to hold.
38 * @property setups may contain configuration setups to be used according to the `balin.setup.name` system property.
39 * @constructor Creates a new configuration setup
40 */
41data class Configuration(
42    override val autoQuit: Boolean = ConfigurationSetup.Default.autoQuit,
43    override val driverFactory: () -> WebDriver = ConfigurationSetup.Default.driverFactory,
44    override val waitForSleepTimeInMilliseconds: Long = ConfigurationSetup.Default.waitForSleepTimeInMilliseconds,
45    override val waitForTimeOutTimeInSeconds: Long = ConfigurationSetup.Default.waitForTimeOutTimeInSeconds,
46    val setups: Map<String, ConfigurationSetup> = emptyMap()) : ConfigurationSetup
47/* ***************************************************************************/
48
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie