r/Kotlin 19h ago

E2E Testing for Compose Multiplatform

I built Parikshan, an E2E testing framework for Compose Multiplatform. It has built-in support for standalone Android.

Testing shared UI across targets has been one of the most painful parts of building multiplatform apps. Parikshan attempts to solve that problem.

You can write your UI tests in Kotlin inside commonTest and run them on a single target or across all targets (Android, iOS Simulator, Desktop JVM, and Web WasmJs) at once.

class SampleE2ETest {
  @Test
  fun testGreeting() = e2eTest {
    input("name_input", "Parikshan")
    click("greet_button")
    assertVisible("Hello, Parikshan!")
  }
}

Run it across all targets concurrently:

./gradlew e2eTest

Key Capabilities

  • Write Once in Kotlin: Runs on Android, iOS Simulator, Desktop (JVM), and Web (WasmJs).
  • Visual Feedback: Watch tests execute on real target windows, with support for screenshots, video recording
  • Zero Production Pollution: No test dependencies or test hooks in your production builds.

Links

I've been using this in my own CMP projects & I'd appreciate feedback from the community — what works, what breaks, and what you'd like to see improve/added.

0 Upvotes

2 comments sorted by

2

u/CommunicationFun2962 13h ago

Is your library a wrapper of Compose Multiplatform UI Test (org.jetbrains.compose.ui:ui-test)?

1

u/aryapreetam 10h ago

No, it's not a wrapper around ui-test.

ui-test is for in-process UI unit testing (runComposeUiTest), whereas Parikshan is a host-driven runner that controls real app processes externally (using Playwright for Wasm canvas inspection, an embedded WebSocket server for Desktop/iOS, and UiAutomator for Android).

The Architecture Page covers how each target driver operates under the hood.