kmp-roborazzi

Implements Compose UI interaction tests and Roborazzi screenshot regression tests for Kotlin Multiplatform.

2|Updated Jun 6, 2026
One-click install
npx skills add https://github.com/ronjunevaldoz/kmp-agent-skills --skill kmp-roborazzi-ronjunevaldoz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kmp-roborazzi
Source: https://github.com/ronjunevaldoz/kmp-agent-skills/tree/main/skills/kmp-roborazzi
Command: npx skills add https://github.com/ronjunevaldoz/kmp-agent-skills --skill kmp-roborazzi-ronjunevaldoz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Kotlin Multiplatform UI code lacks a unified testing strategy: interaction tests written for one platform don't run on others, and visual regressions slip through because screenshot testing has no multiplatform equivalent. This Skill provides a complete three-layer UI testing stack — semantic test tags, commonTest interaction tests, and JVM screenshot goldens — so visual and behavioral regressions are caught in CI before merge. ## Core Features & Use Cases - Semantic Test Tags: Establishes a TestTags object convention in commonMain with <feature>:<node> naming so tests target stable identifiers instead of fragile copy text. - Multiplatform Interaction Tests: Writes runComposeUiTest tests in commonTest covering clicks, text input, drag gestures, and layout stability, runnable on JVM, Android instrumented, iOS simulator, and Wasm targets. - Roborazzi Screenshot Tests: Captures @Preview composables as golden PNGs in jvmTest with required light/dark variants, plus .bounds.json sidecars for exact position/size regression diffs. - CI Integration: Provides GitHub Actions workflows with jvmTest as the required gate and an opt-in nightly device matrix, including screenshot diff artifact upload on failure. - Use Case: A team adding a login screen to their KMP app uses this Skill to tag the email field and login button, write interaction tests verifying disabled states and intent firing, record golden screenshots in light and dark themes, and wire the whole suite into CI. ## Quick Start Ask the agent to set up Roborazzi screenshot testing and Compose UI interaction tests for a feature module in your Kotlin Multiplatform project.

Frequently Asked Questions about kmp-roborazzi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write screenshot tests for Compose Multiplatform?▼

Use Roborazzi's captureRoboImage in jvmTest to capture @Preview composables as golden PNGs. Record goldens with ./gradlew jvmTest -PrecordRoborazzi, then verify with plain ./gradlew jvmTest. Roborazzi is JVM-only since it depends on Robolectric's shadow rendering.

How do I test Compose UI on multiple platforms in Kotlin Multiplatform?▼

Write interaction tests in commonTest using runComposeUiTest with onNodeWithTag, performClick, and assertIsDisplayed. The same test body runs on JVM, Android instrumented, iOS simulator, and Wasm targets. Declare compose.uiTest once in commonTest.dependencies.

Can Roborazzi run in commonTest for multiplatform screenshot tests?▼

No, Roborazzi has no multiplatform equivalent. It is built directly on Robolectric's Android-framework shadow rendering, so screenshot tests must stay in jvmTest regardless of where interaction tests live.

Should I use onNodeWithTag or onNodeWithText in Compose tests?▼

Use onNodeWithTag with constants defined in a TestTags object in commonMain. Text-based selectors break when copy changes or gets localized, while semantic tags remain stable across copy edits and translations.

Why do Roborazzi screenshot tests fail after a Compose upgrade?▼

Font rendering shifts between Compose versions, causing pixel diffs against committed goldens. Re-record the golden images with ./gradlew jvmTest -PrecordRoborazzi and commit the updated snapshots.

Should emulator UI tests be part of the required CI gate?▼

No, keep jvmTest as the required per-PR gate since it runs both interaction tests and screenshots without an emulator. Run androidDeviceTest, iosSimulatorArm64Test, and wasmJsTest as an opt-in or nightly matrix because emulator boot time is expensive.