Support v2 Compose UI Tests APIs on non-android targets#2919
Merged
Conversation
182cf63 to
e663833
Compare
dba2c31 to
41228c3
Compare
…stead of `coroutineDispatcher`.
… creation in `ComposeUiTest`
… place of `coroutineDispatcher`.
f6588df to
7f9cf2c
Compare
Alexander Maryanovsky (m-sasha)
requested changes
Mar 30, 2026
… and enforce its default usage
Alexander Maryanovsky (m-sasha)
approved these changes
Mar 30, 2026
Igor Demin (igordmn)
left a comment
Collaborator
There was a problem hiding this comment.
I reviewed the new API, and also approve it (the PR contains Deprecated/new Experimental API in the CMP source sets)
| @@ -44,14 +44,13 @@ import androidx.compose.ui.test.KeyInjectionScope | |||
| import androidx.compose.ui.test.onNodeWithTag | |||
Collaborator
There was a problem hiding this comment.
Support v2 Compose UI Tests APIs on non-android targets
Did we mention that the old API is deprecated anywhere? If not, we should mention this in this PR - this an important change affecting all multiplatform users.
The notes should look something like this:
## Features - Multiple Platforms
- Support `runComposeUiTest(effectContext=)`
## Migration Notes - Multiple Platforms
- `runComposeUiTest`, `runSkikoComposeUiTest`, `runDesktopComposeUiTest` are deprecated. Use `androidx.compose.ui.test.v2.runComposeUiTest` ... It uses `StandardTestCoroutineDispatcher` instead of `UnconfinedTestCoroutineDispatcher`
Please verify this note and fix mistakes before pasting it to the description.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standardizing the testing infrastructure around StandardTestDispatcher and introducing "v2" test APIs to improve composition and coroutine handling in tests. It also includes refactoring of the recomposerCoroutineScope and adds validation for custom effect contexts.
Fixes:
CMP-9519 Implement ComposeUiTest v2 APIs and migrate the tests
CMP-2960 Support runComposeUiTest.effectContext argument
CMP-8849 Support to run on a StandardTestDispatcher
Release Notes
Features - Multiple Platforms
StandardTestDispatcherby default instead ofUnconfinedTestDispatchereffectContextin Compose UI testsMigration Notes - Multiple Platforms
runComposeUiTest,runSkikoComposeUiTest,runDesktopComposeUiTestare deprecated in favor v2 versions