Hey folks! I am using Compose `1.11.0-beta01` and ...
# compose
d
Hey folks! I am using Compose
1.11.0-beta01
and I must admit I am a bit confused about the testing infrastructure. When I use
androidx.compose.ui.test.runComposeUiTest
, I get a deprecation notice to use the v2 APIs:
Copy code
'fun runComposeUiTest(effectContext: CoroutineContext = ..., runTestContext: CoroutineContext = ..., testTimeout: Duration = ..., block: suspend ComposeUiTest.() -> Unit): Unit' is deprecated. Use `androidx.compose.ui.test.v2.runComposeUiTest` instead. The v2 APIs use `StandardTestDispatcher` by default to better simulate production behavior where coroutines are queued rather than executed immediately.
And when I use
androidx.compose.ui.test.v2.runComposeUiTest
, I get a runtime error (at least on desktop):
Copy code
kotlin.NotImplementedError: An operation is not implemented: runComposeUiTest v2 - Not yet implemented
When you go inside the v2 function, there is a link to a non-existing issue: https://youtrack.jetbrains.com/issue/CMP-9519/Implement-ComposeUiTest-v2-APIs-and-migrate-the-tests. I tried to find the correct issue on YouTrack but without success. So my questions: • What's the status here? Should we expect it to be implemented for the final
1.11.0
release? • What's the best way to already have a behavior close to the one of the v2 API but using the v1 API? The v1 deprecation message seems to indicate that I should use the
StandardTestDispatcher
but is it for the
effectContext
or the
runTestContext
? Am I right in thinking this is for the
runTestContext
. (Sorry in advance if this is a dumb question.)
i
Hi.
a link to a non-existing issue
Made it public for visibility, it had to be public from the start, sorry.
What's the status here?
Google deprecated v1 API in common and we didn't have enough time before beta01 to implement it on our side
• Should we expect it to be implemented for the final
1.11.0
release?
Yes. Already merged, it should be included to beta02 https://github.com/jetbrains/compose-multiplatform-core/pull/2919 cc @Konstantin Tskhovrebov
🎉 1
d
That's great to here! Thanks. Looking at the GitHub release page, I infer you guys have a two weeks pre-release cycle. So
beta02
should land this week, am I right?
i
yep, if everything will be fine/according to schedule. The state is already frozen and we're doing quality checks now🤞
❤️ 1