Skip to content

Conversation

@EmilioBejasa
Copy link
Collaborator

Adds a lightweight GitHub Actions workflow to restore automated screenshot testing. This reintroduces the screenshot setup after it was lost during earlier branch changes, ensuring screenshots are generated and available in CI again.

EmilioBejasa and others added 20 commits January 5, 2026 13:22
Implements automated screenshot testing workflow that:
- Runs on push to main/github-actions branches and PRs to main
- Sets up Android emulator (Pixel 3a, API 28) with AVD caching
- Executes connectedDebugAndroidTest for all screenshot tests
- Uploads test results and screenshots as artifacts

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add chmod +x step to ensure gradlew has execute permissions
before running tests, fixing the "./gradlew: not found" error.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Move chmod +x command inside emulator runner and pull screenshots
script blocks to ensure permissions are set in the correct context.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Set executable permission bit on gradlew file to fix
"./gradlew: not found" error in GitHub Actions.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Change multiline script to single line with && to ensure
cd and gradlew execution happen in the same shell context.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add working-directory to run gradlew from android directory.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Run ./android/gradlew with -p android flag instead of trying
to cd into the directory, avoiding path resolution issues.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Facebook screenshot library 0.15.0 has compatibility issues with
API 28. Upgrading to API 30 with google_apis target should resolve
the NoSuchMethodException error.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
API 30 had emulator startup issues. API 29 is more stable in
GitHub Actions. Also added disable-spellchecker option.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Increase timeout from 30 to 45 minutes
- Add Gradle dependency caching to speed up builds
- Enable parallel Gradle builds and build caching
- Build only x86_64 architecture (emulator arch) instead of all 4
- Increase JVM heap size for faster compilation

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Attempt to fix NoSuchMethodException on API 29 by upgrading
from 0.15.0 to 0.15.1 which may have better compatibility.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Version 0.15.1 doesn't exist. Reverted to 0.15.0 and downgraded
emulator from API 29 to API 26 (Android 8.0) which has better
compatibility with the Facebook screenshot library.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add disk space cleanup step to remove unused SDKs
- Fix reactNativeArchitectures to properly build only x86_64
- Previous syntax was incorrect and built all 4 architectures

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Configure Facebook screenshot testing plugin with multipleDevices mode enabled and python3 executable. Add Python setup step to GitHub Actions workflow to support screenshot processing.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Modified screenshot tests to save complete, single-image screenshots instead of tiled images. Removed Screenshot.snap() calls and updated all test methods to use manual bitmap compression. Screenshots now saved to /sdcard/screenshots/com.testapp.test/full/ for easy access.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Keep EAASE-based workflow from main branch. Screenshot test changes for complete non-tiled images remain from github-actions branch.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added Python 3.x installation step to the GitHub Actions workflow to support the Facebook screenshot testing plugin's image processing requirements. This addresses the TODO comment about needing Python fixes for recordDebugAndroidTestScreenshotTest.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added steps to pull screenshots from emulator and upload them as GitHub Actions artifacts. This allows viewing test screenshots directly from the workflow run without needing to download them manually.

Changes:
- Pull screenshots from /sdcard/screenshots and app storage
- Upload all screenshots and test reports as artifacts
- Use if: always() to ensure artifacts are collected even if tests fail

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed artifact path to only include XML test results, excluding profiling files that contain colons in filenames which are not allowed in GitHub Actions artifacts.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Comment on lines +89 to +93
- name: Pull screenshots from emulator
if: always()
run: |
adb pull /sdcard/screenshots ./screenshots || echo "No screenshots found in /sdcard/screenshots"
adb pull /data/data/com.testapp/files/screenshots ./app-screenshots || echo "No screenshots found in app storage"
Copy link
Contributor

Choose a reason for hiding this comment

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

there's no emulator at this point anymore. You have to do it from within the eaase run invocation. Once that invocation is done, the emulator is killed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so instead of using gradle, i have to use eaase run, is there documentation to set this up?

EmilioBejasa and others added 7 commits January 12, 2026 12:47
Enables screenshot tests to render actual React Native stories instead of manually recreating UI in native Android code. Currently requires Metro bundler running during tests.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Use Screenshot.snap() API instead of manual bitmap saving. Extract React Native load timeout to constant. Simplify StoryRenderer component.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Bundle JavaScript directly into APK by setting debuggableVariants to empty list, allowing tests to run without manually starting Metro. Reduced timeout from 15s to 5s since bundled JS loads faster.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Validates that StoryRenderer infrastructure works for multiple story states. Tests render stories with clickCount=5 and clickCount=42 respectively.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Instead of hardcoding component mappings and state, StoryRenderer now
uses Storybook's actual view._idToPrepared to render any story
dynamically. Also exports getAllStoryIds() and getAllStories() helpers
for automatic test generation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- StorybookRegistry: Native module that receives story list from JS
- ScreenshotTestPackage: Registers the native module
- StoryRenderer: Updated to register stories with native module on load
- StoryManifestBootstrapTest: Generates the story manifest
- StoryScreenshotTest: Screenshots all discovered stories automatically

This allows screenshot tests to automatically discover and test all
Storybook stories without manually writing test methods for each one.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

3 participants