Why it exists
Android has Paparazzi, which renders through LayoutLib. Compose Multiplatform does not, because LayoutLib is Android's renderer and the code under test is not Android code. viddik renders through a real Compose Desktop window on Skiko, on a plain JVM — the same renderer that will actually draw the component.
One annotation, two outputs
@ViddikScreenshot
@Composable
fun EmptyBasket() = BasketScreen(state = Basket.empty)
A KSP processor collects every annotated composable into a registry, and that registry is used twice: ViddikEngine captures each one to PNG and diffs it against the golden as a JUnit 5 test, and ViddikShowroom renders the same registry as a live component gallery. One set of declarations, so the browser cannot drift from the tests.
Install
plugins { id("com.google.devtools.ksp") version "<KSP_VERSION>" }
repositories { maven("https://reposilite.kotlin.website/snapshots") }
dependencies {
testImplementation("ru.workinprogress:viddik-annotations:<VERSION>")
testImplementation("ru.workinprogress:viddik-testing-core:<VERSION>")
add("kspDesktopTest", "ru.workinprogress:viddik-processor:<VERSION>")
}
The KSP configuration name is derived from your target name — kspDesktopTest here, kspTest in a plain kotlin("jvm") project, where you also need the per-target artefact coordinates. Getting it wrong produces no error, only zero generated tests, which is exactly the failure worth knowing about in advance.
Why goldens travel
Because capture goes through Compose Desktop rather than a platform toolkit, the same golden holds on macOS, Linux and Windows — which is what makes goldens reviewable in a pull request instead of noise every time CI changes machines.