From f6668454daaa0b5b559723b3bb685c244456247b Mon Sep 17 00:00:00 2001 From: Lena Date: Wed, 1 Jul 2026 00:00:00 +0000 Subject: test: add a screenshot capture tier The store screenshots were made by hand, so nothing kept them in step with the UI. Add ./test screenshots, which boots a pixel_6 AVD on the same image the e2e tier uses and overwrites the tracked PNGs. The AVD is its own so a capture run cannot disturb the device state e2e asserts against, and the panel comes from the device profile: forcing geometry with wm size on a booted software-GPU emulator ANRs SystemUI and the ANR dialog lands in the capture. SystemUI demo mode does the same, so the status bar is left live. Each shot is rejected unless the app owns the focused window and the PNG has the expected geometry. --- test | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test b/test index ec31236..d5bf317 100755 --- a/test +++ b/test @@ -7,6 +7,9 @@ # ./test all unit + e2e # ./test record boot emulator, run a Mirror session, inject events, # capture screen recording to ./output.mp4 (needs /dev/kvm) +# ./test screenshots +# boot emulator, capture the fastlane store screenshots +# into fastlane/metadata/.../phoneScreenshots (needs /dev/kvm) # ./test apk build a signed release APK with a throwaway keystore # (exercises scripts/build-apk end-to-end, no KVM) # @@ -20,7 +23,7 @@ cmd="${1:-unit}" target=unit case "$cmd" in - e2e|all|record) target=e2e ;; + e2e|all|record|screenshots) target=e2e ;; esac # The image tag is a hash of the rig inputs, so editing the Dockerfile @@ -30,14 +33,14 @@ IMG="scrcpy-android-test-$target:$(cat "$ROOT/test-rig/Dockerfile" \ | sha256sum | cut -c1-12)" case "$cmd" in - unit|e2e|all|record|apk) ;; + unit|e2e|all|record|screenshots|apk) ;; -h|--help) # Usage is the header comment block: print from line 2 down to # the first non-comment line. awk 'NR > 1 && /^#/ { sub(/^# ?/, ""); print; next } NR > 1 { exit }' "$0" >&2 exit 0 ;; *) - echo "usage: $0 [unit|e2e|all|record|apk]" >&2 + echo "usage: $0 [unit|e2e|all|record|screenshots|apk]" >&2 exit 2 ;; esac @@ -62,7 +65,7 @@ fi # KVM check for tiers that boot the emulator. needs_kvm= case "$cmd" in - e2e|all|record) needs_kvm=1 ;; + e2e|all|record|screenshots) needs_kvm=1 ;; esac kvm_args= -- cgit v1.2.3