-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support test resources in Compose UI tests. #5122
Conversation
...ces/library/src/androidMain/kotlin/org/jetbrains/compose/resources/AndroidContextProvider.kt
Outdated
Show resolved
Hide resolved
...ces/library/src/androidMain/kotlin/org/jetbrains/compose/resources/AndroidContextProvider.kt
Outdated
Show resolved
Hide resolved
Adding a second reviewer, as we have a new API |
@eymar, could you review the new API? |
...ces/library/src/androidMain/kotlin/org/jetbrains/compose/resources/AndroidContextProvider.kt
Outdated
Show resolved
Hide resolved
...lugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt
Show resolved
Hide resolved
|
||
@Test | ||
fun checkTestFileResource() { | ||
runTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this test would run on web eventually, runTest
result should be returned from the function:
@Test
fun fooTest() = runTest { ... }
The reason is: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/run-test.html
In the future (after 1.8), this requirement might affect runComposeUiTest
too.
@igordmn I found a way how to get an instrumentation context without additional configuration. check the latest commit |
… to set an instrumented context. This context helps `ResourceReader` access test assets in instrumented environments.
… configure test context
dd83199
to
5a50c75
Compare
Fixes https://youtrack.jetbrains.com/issue/CMP-1470
Fixes https://youtrack.jetbrains.com/issue/CMP-5963
Release Notes
Features - Resources