Nice and simple Kotlin DSLs for UI testing. Write automated tests that read like a spec — and enjoy them like a cup of hot chocolate.
Raw UI-testing APIs are powerful but noisy. A simple visibility check in plain Espresso looks like this:
onView(allOf(withId(R.id.price_item), hasDescendant(withText("Standard Rate"))))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));KakaoCup libraries wrap these frameworks in a type-safe Kotlin DSL built around the Page Object pattern. You describe a screen once, then write tests against it:
onScreen<FormScreen> {
phone { hasText("971201771") }
submit { click() }
}Every library in the family shares the same ideas:
- Readability — tests describe what happens, not how to find it.
- Reusability — screens and elements are declared once and shared across tests.
- Extensibility — plug in your own matchers, actions, assertions and custom views.
- Interceptors — hook into every call for logging, retries or reporting.
| Library | What it tests | Docs |
|---|---|---|
| Kakao | Android Views with Espresso | kakaocup.github.io/Kakao |
| Compose | Jetpack Compose UI | kakaocup.github.io/Compose |
| Multiplatform | Compose Multiplatform UI (early development) | — |
| Appium | Cross-platform apps via Appium | — |
dependencies {
androidTestImplementation("io.github.kakaocup:kakao:<latest version>")
}class FormScreen : Screen<FormScreen>() {
val phone = KEditText { withId(R.id.phone) }
val submit = KButton { withId(R.id.submit) }
}
@Test
fun submitsForm() {
onScreen<FormScreen> {
phone { typeText("971201771") }
submit { click() }
}
}dependencies {
androidTestImplementation("io.github.kakaocup:compose:<latest version>")
}class MainScreen(provider: SemanticsNodeInteractionsProvider) :
ComposeScreen<MainScreen>(
semanticsProvider = provider,
viewBuilderAction = { hasTestTag("MainScreen") }
) {
val myButton: KNode = child { hasTestTag("myTestButton") }
}
@Test
fun showsButton() {
onComposeScreen<MainScreen>(composeTestRule) {
myButton {
assertIsDisplayed()
assertTextContains("Button 1")
}
}
}See each repository's README for lists, lazy lists, custom views, interceptors and more.
- 💬 Chat with us on Telegram — English · Russian
- 🐛 Found a bug or have an idea? Open an issue in the relevant repository.
- 🏢 Using Kakao in production? Add your company to ADOPTERS.md.
All KakaoCup projects are open source and driven by their users — contributions of any size are welcome, from typo fixes to new DSL elements. Start with the CONTRIBUTING.md and CODE_OF_CONDUCT.md in the repository you'd like to help with, and look for issues labelled help wanted.
All projects are licensed under the Apache License 2.0.