:wave: Are there any samples for writing tests for...
# compose-desktop
y
👋 Are there any samples for writing tests for compose-desktop? I only found this in AOSP.
i
There are some samples: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-master-dev:compose/foundation/foundation/src/desktopTest/kotlin/androidx/compose/foundation/ScrollbarTest.kt You have to add "ui-test-junit4" dependency in your build.gradle.kts:
Copy code
named("commonTest") {
    dependencies {
        implementation(compose("org.jetbrains.compose.ui:ui-test-junit4"))
    }
}
Also there is a documentation for Android Compose: https://developer.android.com/jetpack/compose/testing It can be useful for writing desktop tests.
y
Thanks! I’m mainly looking at running android UI tests on the host side (without emulator). Is this a goal we’re moving towards?
i
Is this a goal we’re moving towards?
It is definitely one of the benefits of Compose Multiplatform 😉 You can write common code in commonMain and write tests in desktopTest
🎉 1
y
That’s been my dream for Android UI testing for years!
🎉 3