balin / com.github.epadronu.balin.core / WaitingSupport

WaitingSupport

interface WaitingSupport

Describes the waitFor method support, which aims to ease the use of WebDriverWait.

// Given the selector of an element that should be present
val locator = By.cssSelector(".global-header-logo")

try {
    Browser.drive(driverFactory) {
        // When I navigate to the Kotlin's page URL
        to("https://kotlinlang.org/")

        // And I wait for the element located by such selector to be present
        waitFor { ExpectedConditions.presenceOfElementLocated(locator) }
    }
} catch (ignore: TimeoutException) {
    // Then I should wait until the element appears in the page
    fail("An unexpected exception was thrown")
}

Properties

configurationSetup

abstract val configurationSetup: ConfigurationSetup

The configuration setup used to customized Balin's behavior.

driver

abstract val driver: WebDriver

The driver to be used when evaluating isTrue in waitFor.

Functions

waitFor

open fun <T> waitFor(timeOutInSeconds: Long = configurationSetup.waitForTimeOutTimeInSeconds, sleepInMillis: Long = configurationSetup.waitForSleepTimeInMilliseconds, isTrue: () -> ExpectedCondition<T>): T

Repeatedly applies the underlying driver to the given function until one of the following occurs:

Inheritors

Browser

interface Browser : JavaScriptSupport, WaitingSupport, WebDriver

Balin's backbone. The Browser interface binds together the different abstractions that form part of the library.

Component

abstract class Component : ClickAndNavigateSupport, ComponentMappingSupport, JavaScriptSupport, SearchContext, WaitingSupport

A component is a reusable piece of functionality that can be shared among several pages, and which interaction can be performed independently of other pieces in the web page.

Page

abstract class Page : ClickAndNavigateSupport, ComponentMappingSupport, JavaScriptSupport, SearchContext, WaitingSupport

This class is the corner stone for Balin's implementation of the Page Object Design Pattern. All classes that model a Web page/view most extend this one.