fun drive(driverFactory: () -> WebDriver = desiredConfiguration.driverFactory, autoQuit: Boolean = desiredConfiguration.autoQuit, block: Browser.() -> Unit): Unit
This method represents the entry point for the Domain-Specific Language which Balin is built around.
drive
is the main abstraction layer for Selenium-WebDriver. Inside
the block it receives as parameter, you can interact with the
driver and use all the features Balin has to offer.
// Given the Kotlin's website index page URL
val indexPageUrl = "https://kotlinlang.org/"
Browser.drive(driverFactory) {
// When I visit such URL
// Then I should change the browser's URL to the given one
assertEquals(to(indexPageUrl), indexPageUrl)
// And I should get the title of the Kotlin's website index page
assertEquals(title, "Kotlin Programming Language")
}
driverFactory
- provides the driver on which the navigation and interactions will be performed.
autoQuit
- indicates if the driver should quit at the end of the block.
block
- here you interact with the driver alongside of Balin's assistance.
fun drive(configuration: Configuration, block: Browser.() -> Unit): Unit
This method represents the entry point for the Domain-Specific Language which Balin is built around.
drive
is the main abstraction layer for Selenium-WebDriver. Inside
the block it receives as parameter, you can interact with the
driver and use all the features Balin has to offer.
// Given the Kotlin's website index page URL
val indexPageUrl = "https://kotlinlang.org/"
Browser.drive(driverFactory) {
// When I visit such URL
// Then I should change the browser's URL to the given one
assertEquals(to(indexPageUrl), indexPageUrl)
// And I should get the title of the Kotlin's website index page
assertEquals(title, "Kotlin Programming Language")
}
configuration
- defines Balin's local behavior for block only.
block
- here you interact with the driver alongside of Balin's assistance.