Skip to content
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

Merged
merged 8 commits into from
Aug 29, 2024
Merged

Conversation

terrakok
Copy link
Collaborator

@terrakok terrakok commented Aug 23, 2024

  1. The PR adds a support test resources in Compose multiplatform projects.
  2. The PR adds a support multi-module resources in JVM-only projects.

Fixes https://youtrack.jetbrains.com/issue/CMP-1470
Fixes https://youtrack.jetbrains.com/issue/CMP-5963

Release Notes

Features - Resources

  • Added support of test resources in Compose Multiplatform projects
  • Added support of multi-module resources in JVM-only projects

@terrakok terrakok changed the title K.tskh/test resources Support test resources in Compose UI tests. Aug 26, 2024
@terrakok terrakok requested a review from igordmn August 26, 2024 15:13
@igordmn igordmn requested a review from m-sasha August 27, 2024 15:53
@igordmn
Copy link
Collaborator

igordmn commented Aug 27, 2024

Adding a second reviewer, as we have a new API setAndroidInstrumentedContext

@igordmn igordmn requested review from eymar and removed request for m-sasha August 28, 2024 09:43
@igordmn
Copy link
Collaborator

igordmn commented Aug 28, 2024

@eymar, could you review the new API?


@Test
fun checkTestFileResource() {
runTest {
Copy link
Collaborator

@eymar eymar Aug 28, 2024

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.

@terrakok
Copy link
Collaborator Author

@igordmn I found a way how to get an instrumentation context without additional configuration. check the latest commit

@terrakok terrakok requested a review from igordmn August 28, 2024 13:17
@terrakok terrakok merged commit f86b9ed into master Aug 29, 2024
6 of 12 checks passed
@terrakok terrakok deleted the k.tskh/test-resources branch August 29, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants