Closed igordmn closed 1 year ago
For now we can use this in build.gradle.kts:
dependencies {
testImplementation(compose("org.jetbrains.compose.ui:ui-test-junit4"))
}
Example of unit test
Also we need to add docs how to do screenshot-based testing:
val window = TestComposeWindow(width = 1024, height = 768)
window.setContent {
}
File(path).writeBytes(window.surface.makeImageSnapshot().encodeToData()!!.bytes)
We should also add an important note about JUnit version: createComposeRule
only works with JUnit 4.
Hi all! Would appreciate any notes at all, on how to get started setting up multiplatform tests using the above mentioned library.
Added an example to both the compose multiplatform desktop template, and the imageviewer
example project.
Do we need anything else here, @igordmn?
Added an example to both the compose multiplatform desktop template, and the imageviewer example project. Do we need anything else here, @igordmn?
We can close the issue after we add a doc and merge everything to master.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Also we need to add
uiTestJUnit4
to gradle plugin: