mannodermaus / android-junit5

Testing with JUnit 5 for Android.
Apache License 2.0
859 stars 52 forks source link

Incompatible waitUntil method signature for compose ui test 1.7.0 (since alpha02) #353

Closed F43nd1r closed 1 week ago

F43nd1r commented 1 week ago

Trying to use waitUntil with any version newer than 1.7.0-alpha01 of androidx.compose.ui:ui-test leads to a missing method error due to a signature change. (It now also has a description string)

Please update the signature of waitUntil to match the androidx library.

Side note: Due to the ComposeContext wrapper extension functions like waitUntilNodeCount are not available. Maybe you could provide versions of these as well?

mannodermaus commented 1 week ago

I was about to comment that I'd like to wait until 1.7 is stable, but lo and behold, it was released today. 👀 Should be a fairly straightforward update. Since the instrumentation library is built with the Compose BOM, I'd still like to wait until a future release of that BOM ships with 1.7, but after that it's no problem to include the new APIs.

Regarding ComposeContext, I don't like the fact that it has to redeclare all the methods either, but unfortunately the baseline interface from compose-test is a sealed interface that we cannot inherit from. :/

mannodermaus commented 1 week ago

The Compose BOM for September is out and links against Compose 1.7.0. I'll get to work. 😎

mannodermaus commented 1 week ago

This is available in the latest snapshots now. You can either update your android-junit5 plugin to 1.11.0.1-SNAPSHOT, or stick to the stable plugin and manually change the instrumentation library version that it links to:

junitPlatform {
  instrumentationTests.version.set("1.6.0-SNAPSHOT")
}