Kotlin DSL for Selenium. Provide a possibility to write tests in Kotlin type-safe builders style

Overview

SeleniumBuilder

DSL for Selenium. Provide a possibility to write tests in Kotlin type-safe builders style

Sample

driver(ChromeDriver()) { 
    get("http://cool-website.com")
    
    elementByClass("login") {
        sendKeys("[email protected]")
    }

    elementByName("password") {
        sendKeys("123456")
        submit()
    }
    
    element(By.className("search")) {
        sendKeys("kotlin")
    }
    
    wait(10) {
        elementVisibilityById("result-item") {
            elementByClass("salary") {
                item.salary = text
            }
        }
    }
}

Total function list

Driver builders

driver(driver: WebDriver) {}

chromeDriver {}

chromeDriver(pathToDriver: String) {}

firefoxDriver {}

firefoxDriver(pathToDriver: String) {}

WebDriver and WebElement element builders

element(by: By) {}

elementById(id: String) {}

elementByClass(className: String) {}

elementByName(name: String) {}

elementBySelector(selector: String) {}

elementByXpath(selector: String) {}

WebDriver and WebElement element list builders

elements(by: By) {}

elementsById(id: String) {}

elementsByClass(className: String) {}

elementsByName(name: String) {}

elementsBySelector(selector: String) {}

elementsByXpath(selector: String) {}

WebDriver and WebElement element exists functions

elementExists(by: By): Boolean

elementByIdExists(id: String): Boolean

elementByClassExists(className: String): Boolean

elementByNameExists(name: String): Boolean

elementBySelectorExists(selector: String): Boolean

elementByXpathExists(selector: String): Boolean

WebDriver WebDriverWait builder

wait(timeout: Long) {}

WebDriverWait element visibility builders

elementVisibility(by: By) {}

elementVisibilityById(id: String) {}

elementVisibilityByClass(className: String) {}

elementVisibilityByName(name: String) {}

elementVisibilityBySelector(selector: String) {}

elementVisibilityByXpath(xpath: String) {}

WebDriverWait element invisibility functions

elementInvisibility(by: By): Boolean

elementInvisibilityById(id: String): Boolean

elementInvisibilityByClass(className: String): Boolean

elementInvisibilityByName(name: String): Boolean

elementInvisibilityBySelector(selector: String): Boolean

elementInvisibilityByXpath(xpath: String): Boolean

You might also like...
πŸŽ“ Learning Kotlin Coroutines for Android by example. πŸš€ Sample implementations for real-world Android use cases. πŸ›  Unit tests included!
πŸŽ“ Learning Kotlin Coroutines for Android by example. πŸš€ Sample implementations for real-world Android use cases. πŸ›  Unit tests included!

Kotlin Coroutines - Use Cases on Android πŸŽ“ Learning Kotlin Coroutines for Android by example. πŸš€ Sample implementations for real-world Android use ca

Accounting-App - An Android app built with Kotlin, Material, Jetpack Compose, Hilt, Room, Coroutines, Data-Store, MVVM-Clean Architecture and JUnit tests Add screenshots to your Android tests
Add screenshots to your Android tests

Testify β€” Android Screenshot Testing Add screenshots to your Android tests Expand your test coverage by including the View-layer. Testify allows you t

Running Axon Server in Testcontainers tests.

Axon Server TestContainer Running axon server in testcontainers tests. Idea Run an Axon Server docker container from within your (junit) tests. Usage

Gradle plugin to manage tests which should only run nightly and not every time a CI/CD pipeline builds.

NightlyTestsPlugin Gradle Plugin to configure which (j)Unit tests should only be run nightly and not everytime a CI/CD pipeline is triggered. Usage To

A simple android application for IQ tests, contains 40 questions and issues.
A simple android application for IQ tests, contains 40 questions and issues.

IQ-Android A simple android application for IQ tests, contains 40 questions and issues. Compatible with API Level 14 and higher Support only arabic la

Modular Android architecture which showcase Kotlin, MVVM, Navigation, Hilt, Coroutines, Jetpack compose, Retrofit, Unit test and Kotlin Gradle DSL.

SampleCompose Modular Android architecture which showcase Kotlin, MVVM, Navigation, Hilt, Coroutines, Jetpack compose, Retrofit, Unit test and Kotlin

Nice and simple DSL for Espresso Compose UI testing in Kotlin
Nice and simple DSL for Espresso Compose UI testing in Kotlin

Kakao Compose Nice and simple DSL for Espresso Compose in Kotlin Benefits Readability Reusability Extensible DSL How to use it Create Screen Create yo

An Android template you can use to build your project with gradle kotlin dsl

Android Gradle KTS An Android template you can use to build your project with gradle kotlin dsl Build.gradle.kts You can use your project's build.grad

Comments
Owner
Daniil Rakhmatulin
Qualified software engineer, with more then 10 years of development experience. Jedi!
Daniil Rakhmatulin
Example project for using the Selenium toolkit with Kotlin, Maven, TestNg and the config is managed via a property file.

Selenium-Java-Toolkit-TestNg-Playground This is the sample-Project and show you how to use the Selenium-Toolkit. The Selenium-Toolkit is a Java based

Selenium Consulting 0 Dec 15, 2021
Kreds - a thread-safe, idiomatic, coroutine based Redis client written in 100% Kotlin

Kreds Kreds is a thread-safe, idiomatic, coroutine based Redis client written in 100% Kotlin. Why Kreds? Kreds is designed to be EASY to use. Kreds ha

Abhijith Shivaswamy 117 Dec 23, 2022
DS-for-Kotlin - Some classic data sturctures write in kotlin for fun

DS-for-Kotlin Just write some classic data structure by kotlin during my leisure

ccyyxx 2 Jan 30, 2022
Tools for Kotlin/Kscript to easy write shell command line in kotlin code

Kscript Tools Easy way to run shell command line in kotlin and other tools Usage Used in kscript: @file:DependsOn("com.sealwu:kscript-tools:1.0.2") Us

Seal 4 Dec 12, 2022
Firestore Kotlin Client with strict (and relaxed) type-system.

Firestore Kotlin Client with strict (and relaxed) type-system.

Vihang Patil 2 Mar 4, 2022
Kotlin extension function provides a facility to "add" methods to class without inheriting a class or using any type of design pattern

What is Kotlin Extension Function ? Kotlin extension function provides a facility to "add" methods to class without inheriting a class or using any ty

mohsen 21 Dec 3, 2022
Esito ambition is to be your return type for suspending functions.

Esito ambition is to be your return type for suspending functions.

null 58 Oct 21, 2022
LambΓ« Language 7 Dec 21, 2022
Bring type-safety to your GitHub actions' API!

GitHub Actions typing Bring type-safety to your GitHub actions' API! This is a GitHub action that validates your action's type specs (action-types.y(a

Piotr KrzemiΕ„ski 23 Dec 18, 2022
The WeeBe application is a social media-type app built on Ktor framework

The WeeBe application is a social media-type app built on Ktor framework that allows users to exchange various content connected with mental health, motivation, psychology, and improving oneself. Users can share posts with texts, images, videos, and links, as well as discuss the content in the comment section

Perpetio 3 Aug 5, 2022