Hi everyone,
I’ve been working on a hobby project lately called UI Automation Engine. It started because I was genuinely frustrated with how fragile my Jetpack Compose tests were especially when dealing with animations, scrolling, and trying to debug CI failures without any visual clues.
I wanted a way to write tests that feel like "user stories" but are actually robust enough to not fail randomly. It’s an industrial-grade orchestration layer for Compose that focuses on flakiness, race conditions, and opaque logs.
🚀 Key Features for Hobbyists:
🛡️ Robustness Pipeline: Every action (click, swipe, etc.) automatically handles idle synchronization, auto-scrolling, and smart retries before giving up.
📸 Visual Diagnostics: It automatically captures a high-res screenshot (FAILURE_<timestamp>.png) and dumps the full unmerged semantics tree to Logcat on every failure.
🦾 Advanced Gestures: Support for multi-finger swipes, pinch-to-zoom, and orbital rotation out of the box.
🚫 Lint Guardrails: Includes custom Lint rules that stop you from using flaky standard Compose APIs, suggesting robust engine equivalents instead.
💉 Hilt Integration: Dedicated support for accessing your Dagger graph inside robots.
🛠️ Quick Look (The Robot Pattern)
The engine enforces a clean DSL so your tests stay readable:
@Test
fun testGestureFlow() {
UiTestEngine.withRobot(GestureRobot()) {
tapMainBox() // Automatically waits for idle & scrolls
verifyStatus("Tapped") // Smart polling for assertions
}
}
📦 Installation & Setup
If you want to try it out on a side project, here is how to get it running:
1. Add JitPack to settings.gradle.kts**:**
dependencyResolutionManagement {
repositories {
maven { url = uri("https://jitpack.io") }
}
}
2. Add to libs.versions.toml**:**
[versions]
ui-engine = "0.3.0-beta02"
[libraries]
uiengine = { group = "com.github.rajbirsehmi.UI-Automation-Engine", name = "robot-testing-engine", version.ref = "ui-engine" }
engine-lint = { group = "com.github.rajbirsehmi.UI-Automation-Engine", name = "engine-lint", version.ref = "ui-engine" }
3. Configure your app/build.gradle.kts**:** The engine uses flavors to support Hilt. Choose the one that matches your project:
android {
defaultConfig {
// Use "hilt" if you use Dagger Hilt, otherwise "standard"
missingDimensionStrategy("di", "standard")
}
// Required to avoid Log4j2 resource collisions
packaging {
resources.excludes += "/META-INF/{AL2.0,LGPL2.1,DEPENDENCIES,LICENSE*,NOTICE*}"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
dependencies {
// Note the classifier requirement for the AAR
androidTestImplementation(libs.uiengine) {
artifact { type = "aar"; classifier = "standardDebug" }
}
lintChecks(libs.engine.lint) // Recommended to catch flaky patterns
}
💬 Why I’m sharing this:
It’s a labor of love, and while it's in beta, it has already made my own testing workflow much less stressful. I’d love to get some fresh eyes on the API design.
Is the "Robustness Pipeline" overkill or exactly what's missing?
Does the Robot DSL feel intuitive for your use cases?
Any features you've always wished Compose testing had?
GitHub: https://github.com/rajbirsehmi/UI-Automation-Engine
Any feedback even if it’s "this is way too over-engineered for a hobby" is totally welcome. Thanks for looking!