android-screenshot-testing
Skill11 starsChanged 8 months agoMITView on GitHub
Use when implementing visual regression tests, verifying UI layouts, or using Paparazzi/Roborazzi for Android.
In this repository40 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- android-accessibilitySkill
- android-adaptive-layoutsSkill
- android-adb-terminalSkill
- android-background-executionSkill
- android-bluetooth-bleSkill
- android-build-verificationSkill
- android-camerax-mlkitSkill
- android-ci-cd-expertSkill
- android-clean-architectureSkill
- android-code-review-expertSkill
- android-coroutines-expertSkill
- android-custom-drawing-canvasSkill
- android-design-system-m3Skill
- android-design-to-codeSkill
- android-detekt-expertSkill
- android-enterprise-securitySkill
- android-gemini-nanoSkill
- android-google-workspace-expertSkill
- android-gradle-expertSkill
- android-hardware-testingSkill
- android-jetpack-composeSkill
- android-kmp-compose-uiSkill
- android-kmp-platform-channelsSkill
- android-kmp-sharedSkill
- android-ktlint-formattingSkill
- android-lint-and-qualitySkill
- android-local-stt-ttsSkill
- android-location-mapsSkill
- android-macrobenchmarkSkill
- android-media3-exoplayerSkill
- android-media-and-image-expertSkill
- android-motion-animationsSkill
- android-navigation-expertSkill
- android-offline-firstSkill
- android-performance-auditSkill
- android-rag-localSkill
- android-security-hardenedSkill
- android-unit-testingSkill
- android-wear-os-composeSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 47
Rule: Commit these screenshots to your repository.
- Distinctive: line 52
Use Redline or Side-by-side views to inspect failures.
- Distinctive: line 81
Review Workflow: Use tools like GitHub PR comments to display screenshot diffs directly to reviewers.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Android Screenshot Testing 📸🛡️
Expert techniques for implementing visual regression testing to ensure UI consistency and catch unintended layout changes automatically.
⚡ When to Use
- UI Consistency: Verifying complex layouts across screen sizes.
- Visual Regression: Catching pixel-level changes in CI/CD.
- Design System Audit: Verifying components against design specs.
- Screenshot Automation: Generating millions of UI variants (Dark mode, RTL, Font scales).
- Test-Driven Design: Testing UI before deploying to devices.
🏗️ Core Tools
1. Paparazzi (Cash App)
- Benefit: Runs entirely on the JVM (Host). NO DEVICE/EMULATOR REQUIRED.
- Use Case: Testing Jetpack Compose components fast and frequently.
- Gradle Task:
./gradlew recordPaparazziDebug/./gradlew verifyPaparazziDebug
2. Roborazzi (Droidkaigi)
- Benefit: Works with Robolectric and provides screenshots in standard unit tests.
- Use Case: Testing with existing Robolectric mocks and complex native view hierarchies.
3. Showkase (Airbnb)
- Benefit: Auto-generates a library of previews for your app's design system.
- Use Case: Creating a "living design system" documentation.
📐 Screenshot Strategy
1. The "Base" Screenshot
- Record a "Golden Screenshot" that represents the correct state.
- Rule: Commit these screenshots to your repository.
2. Verification (The Diff)
- The test compares the current output with the "Golden" version.
- Any pixel difference (even 1px) will cause the test to fail.
- Use Redline or Side-by-side views to inspect failures.
🚀 Modern Screenshot Workflow
- Multi-config Previews: Test every component in:
- Light vs. Dark mode.
- Large font scales (Accessibility).
- RTL (Right-to-Left) languages.
- Different screen densities (ldpi to xxxhdpi).
- Data Mocking: Use hardcoded, stable mocks for screenshots (Avoid dynamic dates or network data).
- Stable Animations: Disable animations or use
FixedTimeduring screenshot capture to avoid timing issues.
📦 Gradle Configuration
plugins {
id("app.cash.paparazzi") version "1.3.1"
}
paparazzi {
// Optional: customize screen size or theme
deviceConfig = DeviceConfig.PIXEL_5
}🧪 Testing Best Practices
- Atomic Components: Favor testing individual atoms (e.g., buttons, chips) over full screens.
- CI/CD Integration: Automatically run
./gradlew verifyPaparazziDebugon every Pull Request. - Review Workflow: Use tools like GitHub PR comments to display screenshot diffs directly to reviewers.
🔗 Related Resources
- Paparazzi Documentation
- Roborazzi Documentation
- Unit Testing Skill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

