Skip to content

feat: add screenshot testing using gcp#1

Merged
Manabu-GT merged 2 commits intomainfrom
feature/14-screenshot-tests
Feb 12, 2026
Merged

feat: add screenshot testing using gcp#1
Manabu-GT merged 2 commits intomainfrom
feature/14-screenshot-tests

Conversation

@Manabu-GT
Copy link
Copy Markdown
Owner

@Manabu-GT Manabu-GT commented Feb 12, 2026

Summary by CodeRabbit

  • Tests

    • Implemented screenshot testing to validate visual components across multiple states.
    • Added CI steps to run screenshot verification and collect/upload screenshot-diff reports for review.
  • Chores

    • Added build configuration and dependencies to enable screenshot testing support.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 12, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds Compose screenshot testing: Gradle plugin/version/dependencies and an experimental flag; introduces screenshot preview tests and a reusable EffectCard; updates CI to run a screenshot validation step (continue-on-error) and always upload screenshot diff artifacts with 14-day retention.

Changes

Cohort / File(s) Summary
CI/CD Workflow
.github/workflows/android-ci.yml
Adds "Screenshot test (verify)" step (runs ./gradlew :aether:validateDebugScreenshotTest with continue-on-error) and an "Upload screenshot diffs" artifact upload step that always runs, uploading aether/build/reports/screenshotTest/ with 14-day retention.
Root build config
build.gradle.kts, gradle/libs.versions.toml, gradle.properties
Adds libs.plugins.screenshot plugin alias, adds screenshot version and screenshot-validation-api/androidx-ui-tooling library entries, and sets android.experimental.enableScreenshotTest=true property.
Module build config
aether/build.gradle.kts
Applies screenshot plugin alias (via plugins block), enables android.experimental.enableScreenshotTest in android.experimentalProperties, and adds screenshotTestImplementation deps for screenshot validation API and Compose UI tooling.
Screenshot Test Suite
aether/src/screenshotTest/kotlin/.../EffectCard.kt, .../CloudsScreenshots.kt, .../RainScreenshots.kt, .../SnowScreenshots.kt, .../LightningFlashScreenshots.kt
Adds EffectCard composable used by new preview screenshot tests; introduces multiple internal @PreviewTest preview composables covering Clouds, Rain, Snow, and LightningFlash variants for screenshot validation.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as "Developer / PR"
    participant CI as "GitHub Actions CI"
    participant Gradle as "Gradle (validateDebugScreenshotTest)"
    participant Artifact as "Actions Artifact Storage"

    rect rgba(220,240,255,0.5)
    Dev->>CI: Push PR / trigger workflow
    end

    CI->>Gradle: Run checks
    CI->>Gradle: ./gradlew :aether:validateDebugScreenshotTest
    Gradle-->>CI: Screenshot validation results (may continue on error)
    CI->>Artifact: Upload aether/build/reports/screenshotTest/ (always)
    Artifact-->>CI: Artifact stored (14d retention)
    CI-->>Dev: Workflow status + artifacts link
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding screenshot testing infrastructure using GCP. It is specific, clear, and directly reflects the primary objective of the changeset.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/14-screenshot-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@gradle/libs.versions.toml`:
- Line 36: Remove the unused version catalog entries for coreKtx and the library
alias androidx-core-ktx: delete the coreKtx = "1.17.0" version declaration and
the androidx-core-ktx library declaration (the alias referencing coreKtx) from
the versions TOML, then run a Gradle sync/build to ensure no remaining
references; if any references exist, replace them with the appropriate
alternative dependency or remove the usage.
🧹 Nitpick comments (2)
gradle.properties (1)

8-9: Redundant with experimentalProperties in aether/build.gradle.kts.

This property is also set via experimentalProperties["android.experimental.enableScreenshotTest"] = true in aether/build.gradle.kts (line 32). Setting it in gradle.properties enables it globally for all modules, which may be broader than intended. Consider keeping it only in the module-level build file where screenshot tests actually live.

aether/src/screenshotTest/kotlin/com/ms/square/aether/screenshot/EffectCard.kt (1)

10-13: Consider specifying explicit preview dimensions for deterministic screenshots.

EffectCard uses fillMaxSize(), and none of the @Preview annotations in the test files specify widthDp/heightDp. The default preview size should be consistent across runs, but explicitly setting dimensions (either here or on the @Preview annotations) would make the expected output size obvious and guard against tooling defaults changing.

Also applies to: 18-29

@Manabu-GT Manabu-GT merged commit 184ec78 into main Feb 12, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant