Skip to content

Add Screenshotbot integration for visual regression testing#9

Closed
EmilioBejasa wants to merge 17 commits intomainfrom
screenshotbot_implementation
Closed

Add Screenshotbot integration for visual regression testing#9
EmilioBejasa wants to merge 17 commits intomainfrom
screenshotbot_implementation

Conversation

@EmilioBejasa
Copy link
Collaborator

Integrates Screenshotbot to automatically detect visual changes in the app by comparing screenshots on every PR/push.

What's Added

  • Screenshotbot Gradle plugin (v1.22)
  • GitHub Actions workflow to run screenshot tests and upload to Screenshotbot
  • Setup documentation in SCREENSHOTBOT_SETUP.md

Setup Needed

Add these GitHub secrets (see setup doc for details):

  • SCREENSHOTBOT_API_KEY
  • SCREENSHOTBOT_API_SECRET

Get credentials from https://screenshotbot.io after creating an account.

How to Test

cd android
./gradlew recordAndVerifyDebugAndroidScreenshotbotCI

🤖 Generated with https://claude.com/claude-code


Much simpler and gets straight to the point!

EmilioBejasa and others added 17 commits December 26, 2025 11:41
Updated testTimerFeaturePaused to use natural view measurement instead of fixed dimensions. This ensures the full timer feature is captured including the title, time display, and both action buttons. The screenshot now saves to external storage for easier retrieval and verification.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Created testCoinFlipFeatureHeads to capture the coin flip component showing the HEADS result. The test includes:
- Coin Flip title
- Gold circular coin displaying HEADS
- Flip Coin action button
- Stats showing total flips and result

Uses the same natural view measurement approach as the timer test to ensure complete component capture.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Created testMyFeature to capture the button click counter component. The test includes:
- My Feature title
- Click Me! button
- Counter showing "Clicked 3 times"

Uses the same natural view measurement approach (400dp width, UNSPECIFIED height) to ensure complete component capture.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Created testSwitchFeatureEnabled to capture the switch component in enabled state. The test includes:
- Feature Switch label
- Green ON switch representation
- Conditional image placeholder (shown when enabled)

Uses a simplified switch visual (TextView with rounded background) to avoid animation thread issues with the native Switch widget. Uses the same natural view measurement approach for complete component capture.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added two workflow options:
1. Basic workflow - Runs tests and uploads screenshots as artifacts
2. Advanced workflow - Includes screenshot comparison with Screenshotbot/Percy

Workflows automatically run on PRs and provide:
- Automated screenshot testing on every PR
- Test result publishing
- Screenshot artifacts
- Optional visual regression testing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added Screenshotbot Gradle plugin to automatically upload and compare screenshots for visual regression testing.

Changes:
- Added Screenshotbot plugin (v1.22) to root build.gradle
- Applied plugin to app module
- Created GitHub Actions workflow for automated screenshot testing
- Added comprehensive setup documentation (SCREENSHOTBOT_SETUP.md)
- Updated .gitignore to exclude generated screenshots

Usage:
- Run locally: ./gradlew recordAndVerifyDebugAndroidScreenshotbotCI
- Configure API keys via environment variables or GitHub secrets
- View results in Screenshotbot dashboard

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The Gradle plugin conflicts with React Native's build system. Switched to using Screenshotbot CLI for manual upload instead.

Changes:
- Removed Screenshotbot Gradle plugin from build files
- Updated GitHub Actions workflow to use Screenshotbot CLI
- Pull screenshots from /sdcard/Download/ and upload manually
- Updated documentation with CLI usage instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Added legacy external storage permission to AndroidManifest.xml for API 30+
- Fixed Screenshotbot CLI download URL (use GitHub releases)
- Make upload step conditional on API keys being set

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
EmilioBejasa added a commit that referenced this pull request Jan 9, 2026
Integrated Screenshotbot CLI to automatically upload screenshots for visual regression testing. After screenshot tests run with EAASE, screenshots are now uploaded to Screenshotbot for comparison and tracking.

Changes:
- Download Screenshotbot CLI binary
- Upload screenshots to Screenshotbot with branch and commit info
- Uses SCREENSHOTBOT_API_KEY and SCREENSHOTBOT_API_SECRET from GitHub secrets
- Uploads to 'android-screenshots' channel

Based on the CLI approach from PR #9 which avoids Gradle plugin conflicts with React Native.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@EmilioBejasa
Copy link
Collaborator Author

Superseded by newer work

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