https://kotlinlang.org logo
g

Garrison Henkle

07/19/2023, 3:55 PM
Is there a way to do any form of UI testing on iOS at the moment? I know the Jetpack Compose testing library hasn’t been ported yet, but even hacky, iOS-specific UI tests would be helpful in some of my test projects.
👍 2
n

Nikita Lipsky

07/20/2023, 12:36 PM
You may look at this test: https://github.com/JetBrains/compose-multiplatform-core/blob/jb-main/compose/found[…]/kotlin/androidx/compose/foundation/gestures/DragGestureTest.kt It uses ImageComposeScene that is available for iOS target - https://github.com/JetBrains/compose-multiplatform-core/blob/d9aec78d04bf59f82c5ae[…]oMain/kotlin/androidx/compose/ui/ImageComposeScene.skikoMain.kt To run Kotlin Compose tests on iOS simulator you will need to pass additional flags to linker like in this PR (https://github.com/JetBrains/compose-multiplatform/pull/3378) (will be fixed in 1.5) To add tests to iOS target you may need to configure respected source set like:
Copy code
val iosTest by getting
val iosSimulatorArm64Test by getting {
    dependsOn(iosTest)
}
Compose testing library hasn’t been ported yet
We plan to port (a subset of) it
gratitude thank you 1
8 Views