Records initial golden set + wires verifyRoborazziDebug into CI. Diffs
uploaded as artifact on failure. ScreenshotTests @Ignore removed.
Root cause of the prior RoboMonitoringInstrumentation:102 failure:
createComposeRule() launches ActivityScenarioRule<ComponentActivity>
which fires a MAIN/LAUNCHER intent, but the merged unit-test manifest
declares androidx.activity.ComponentActivity without a LAUNCHER filter,
so Robolectric's PM returns "Unable to resolve activity for Intent".
Fix: switch to the standalone captureRoboImage(path) { composable }
helper from roborazzi-compose, which registers
RoborazziTransparentActivity with Robolectric's shadow PackageManager
at runtime and bypasses ActivityScenario entirely.
Also pin roborazzi outputDir to src/androidUnitTest/roborazzi so
goldens live in git (not build/) and survive gradle clean.
36 goldens, 540KB total.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
name: Android UI Tests
|
|
on:
|
|
pull_request:
|
|
branches: [main, master]
|
|
push:
|
|
branches: [main, master]
|
|
jobs:
|
|
ui-tests:
|
|
runs-on: macos-14
|
|
timeout-minutes: 45
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-java@v4
|
|
with: { distribution: temurin, java-version: 17 }
|
|
- name: Accept Android licenses
|
|
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses || true
|
|
- name: Verify test-tag parity
|
|
run: ./scripts/verify_test_tag_parity.sh
|
|
- name: Run unit tests
|
|
run: ./gradlew :composeApp:testDebugUnitTest
|
|
- name: Verify screenshot regressions
|
|
run: ./gradlew :composeApp:verifyRoborazziDebug
|
|
- name: Upload screenshot diffs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: roborazzi-diffs
|
|
path: composeApp/build/outputs/roborazzi/
|
|
- name: Run instrumented tests (managed device)
|
|
run: ./gradlew :composeApp:pixel7Api34DebugAndroidTest
|
|
env:
|
|
GRADLE_OPTS: -Xmx4g -XX:+UseParallelGC
|
|
- name: Upload test reports
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: test-reports
|
|
path: composeApp/build/reports/
|