https://kotlinlang.org logo
#compose
Title
# compose
a

andylamax

03/01/2024, 1:00 AM
The release notes did say that
runComposeUiTest
can be written in commonMain, but when I ran those tests in android (
./gradlew :testDebugUnitTest
or
./gradlew testReleaseUnitTest
), I am getting
Copy code
Unresolved reference 'runComposeUiTest'
The same tests run fine on jvm target with (
./gradlew :jvmTest
) I did setup my dependencies in
commonTest
as show below,
Copy code
val commonTest by getting {
    dependencies {
        implementation(compose.uiTest)
    }
}
What am I doing wrong? using compose version 1.6.0
i

Ivan Matkov

03/01/2024, 12:36 PM
сс @Alexander Maryanovsky
a

Alexander Maryanovsky

03/01/2024, 12:37 PM
Are you trying to run them on Android?
a

andylamax

03/01/2024, 1:40 PM
No, I thought
./gradlew testDebugUnitTest
only run on the machine (not the android phone or emulator), and I think it does, just can't seem to find those dependencies
a

Alexander Maryanovsky

03/01/2024, 1:41 PM
You can only run desktop tests locally.
well, and wasm tests
For android it needs the Android emulator, for iOS it needs the iOS simulator
a

andylamax

03/01/2024, 1:42 PM
wait, even the unit tests have to be ran on the device???
a

Alexander Maryanovsky

03/01/2024, 1:43 PM
The compose UI tests can’t run as unit tests, they can only run as instrumented tests.
They can’t (currently) run with robolectric.
a

andylamax

03/01/2024, 1:44 PM
Thank you for that clarification then, I was pulling out my hair on this one
a

Alexander Maryanovsky

03/01/2024, 1:44 PM
np
22 Views