prasad-vennam/awesome-android-ai-agent-skills

android-screenshot-testing

Use when implementing visual regression tests, verifying UI layouts, or using Paparazzi/Roborazzi for Android.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/prasad-vennam/awesome-android-ai-agent-skills --skill android-screenshot-testing

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

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 FixedTime during screenshot capture to avoid timing issues.

📦 Gradle Configuration

kotlin
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 verifyPaparazziDebug on every Pull Request.
  • Review Workflow: Use tools like GitHub PR comments to display screenshot diffs directly to reviewers.

🔗 Related Resources

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills