monitoring: GUI-AUTOMATION-NOTES + AUTO_ANDROID/AUTO_GUI flags

Document minimal variant; Linux defaults to Android-only automation;
macOS can enable both ecosystems later via flags.
This commit is contained in:
Hernâni Marques 2026-07-17 21:24:05 +02:00
parent e51b3208c2
commit c57f08b9d6
No known key found for this signature in database
GPG key ID: CB5738652768F7E9
6 changed files with 231 additions and 193 deletions

View file

@ -19,7 +19,7 @@
# Env: ANDROID_SERIAL, PKG, EXP_PW_FILE, BANK, MERCHANT, INSTANCE,
# WITHDRAW_AMOUNTS, PRODUCTS, PAY_LIMIT, SHOTDIR, PAUSE
#
# See AUTOMATED-GUI-NOTES.md § "hernani-inference branches"
# See GUI-AUTOMATION-NOTES.md
#
set -euo pipefail
ROOT=$(cd "$(dirname "$0")" && pwd)
@ -37,6 +37,16 @@ step() { echo; echo "======== $* ========"; }
info() { echo " $*"; }
pause() { sleep "${1:-${PAUSE:-0.8}}"; }
# Platform flags — Linux default Android+GUI (see GUI-AUTOMATION-NOTES.md)
os=$(uname -s)
case "${AUTO_PLATFORM:-auto}" in
auto) case "$os" in Linux|Darwin) : "${AUTO_ANDROID:=1}"; : "${AUTO_GUI:=1}" ;; *) : "${AUTO_ANDROID:=0}"; : "${AUTO_GUI:=0}" ;; esac ;;
linux|macos) : "${AUTO_ANDROID:=1}"; : "${AUTO_GUI:=1}" ;;
*) : "${AUTO_ANDROID:=0}"; : "${AUTO_GUI:=0}" ;;
esac
[ "${AUTO_ANDROID}" = "1" ] || { echo "skipped: AUTO_ANDROID=${AUTO_ANDROID}"; exit 0; }
[ "${AUTO_GUI}" = "1" ] || { echo "skipped: AUTO_GUI=${AUTO_GUI} (chain is GUI)"; exit 0; }
if ! command -v adb >/dev/null 2>&1; then
[ -x "$HOME/Android/Sdk/platform-tools/adb" ] && export PATH="$HOME/Android/Sdk/platform-tools:$PATH"
fi
@ -361,4 +371,4 @@ step "4 done → $SHOTDIR"
ls -la "$SHOTDIR" | tail -40
adb_sh dumpsys window 2>/dev/null | grep mCurrentFocus | head -1 || true
info "PKG=$PKG amounts=${AMOUNTS[*]} pays(limit)=$PAY_LIMIT"
echo "See AUTOMATED-GUI-NOTES.md (ported from taler-android dev/hernani-inference/gui-workflows)"
echo "See GUI-AUTOMATION-NOTES.md (ported from taler-android dev/hernani-inference/gui-workflows)"