test: Add Compose screenshot testing support

Integrate the experimental Android screenshot testing plugin into the `core:ui` module. This includes initial visual regression tests for Alert components and updates to the CI workflow for automated validation.

- core/ui: Add `AlertScreenshotTest` and screenshot test dependencies
- gradle.properties: Enable `android.experimental.enableScreenshotTest`
- libs.versions.toml: Add `com.android.compose.screenshot` plugin and validation API
- reusable-check.yml: Add screenshot validation tasks to GitHub Actions workflow
This commit is contained in:
James Rich 2026-03-02 09:36:04 -06:00
parent 8c6bd8ab7a
commit eacabf4bd4
10 changed files with 90 additions and 1 deletions

View file

@ -12,6 +12,9 @@ on:
run_instrumented_tests:
type: boolean
default: true
run_screenshot_tests:
type: boolean
default: true
flavors:
type: string
default: '["google"]'
@ -110,6 +113,15 @@ jobs:
fi
fi
# Screenshot Test Tasks
if [ "${{ inputs.run_screenshot_tests }}" = "true" ] && [ "$IS_FIRST_API" = "true" ]; then
if [ "$FLAVOR" = "google" ]; then
TASKS="$TASKS validateGoogleDebugScreenshotTest "
elif [ "$FLAVOR" = "fdroid" ]; then
TASKS="$TASKS validateFdroidDebugScreenshotTest "
fi
fi
# Instrumented Test Tasks
if [ "${{ inputs.run_instrumented_tests }}" = "true" ]; then
[ "$IS_FIRST_FLAVOR" = "true" ] && TASKS="$TASKS connectedDebugAndroidTest "