From b8addc87f804789368612bf8e1be31a2bf28efe1 Mon Sep 17 00:00:00 2001 From: cirakg Date: Sun, 25 Oct 2026 23:51:52 +0100 Subject: test(ui): second UI scenario, and the fixes it found A second UI-test build (uitest-extra.jungle) covers the legacy PIN and the forced new PIN, Change and Reset PIN, a queued Require PIN, UPC-A, Code 39, the code error screen, the encoding progress, auto-lock on a barcode, the light theme and the glance without a code; the main flow adds the Steam and Library details and the menu's text screens. Fixed from what it found: Entry IDs tripped the watchdog with 110 entries; auto-lock didn't close a locked barcode; a queued Require PIN showed "Confirm in menu"; locked barcodes lacked the padlock; the PIN keypad's bottom row, the Reset PIN question, text-screen bottoms, the glance title and the light-theme warning colour. Goldens approved on all seven watches; only the Forerunner 70 was re-verified after the version bump. Co-Authored-By: Claude Opus 5.5 --- docker/scripts/build-app.sh | 14 ++++++++------ docker/scripts/screenshots.sh | 34 ++++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 14 deletions(-) (limited to 'docker') diff --git a/docker/scripts/build-app.sh b/docker/scripts/build-app.sh index 5ead272..4d027a1 100755 --- a/docker/scripts/build-app.sh +++ b/docker/scripts/build-app.sh @@ -1,13 +1,14 @@ #!/usr/bin/env bash # Author: cirakg & claude ai -# Summary: Compile the watch app for one device: debug, release, unit-test, UI-test or watchdog stress build. +# Summary: Compile the watch app for one device: debug, release, unit-test, UI-test (two scenarios) or watchdog stress build. # -# Usage: build-app.sh debug|release|test|uitest|stress DEVICE +# Usage: build-app.sh debug|release|test|uitest|uitest-extra|stress DEVICE # Output: build//.prg, and the compiler log next to it. # # Policy (README section 17.7): strict type checking (-l 3), and any compiler # warning fails the build. UI-test builds add uitest.jungle (fixed clock, -# fake entries; see source/util/TestMode.mc), stress builds stress.jungle (the +# fake entries; see source/util/TestMode.mc), or uitest-extra.jungle for the +# extra scenario's fixture, stress builds stress.jungle (the # watchdog stress test, source/util/StressTest.mc). Test builds add # test.jungle, so test code never reaches debug or release builds; release builds (-r) also drop every # (:debug) declaration, such as the diagnostics in source/util/Diag.mc. @@ -15,8 +16,8 @@ set -euo pipefail # shellcheck source=ciq-env.sh source "$(dirname "${BASH_SOURCE[0]}")/ciq-env.sh" -mode="${1:?usage: build-app.sh debug|release|test|uitest|stress DEVICE}" -device="${2:?usage: build-app.sh debug|release|test|uitest|stress DEVICE}" +mode="${1:?usage: build-app.sh debug|release|test|uitest|uitest-extra|stress DEVICE}" +device="${2:?usage: build-app.sh debug|release|test|uitest|uitest-extra|stress DEVICE}" ciq_require_sdk ciq_require_key @@ -30,12 +31,13 @@ case "${mode}" in debug) ;; release) args+=(-r) ;; uitest) jungles="${jungles};/work/uitest.jungle" ;; + uitest-extra) jungles="${jungles};/work/uitest-extra.jungle" ;; stress) jungles="${jungles};/work/stress.jungle" ;; test) jungles="${jungles};/work/test.jungle" args+=(-t) ;; - *) die "unknown build mode '${mode}' (use debug, release, test, uitest or stress)" ;; + *) die "unknown build mode '${mode}' (use debug, release, test, uitest, uitest-extra or stress)" ;; esac out_dir="${BUILD_DIR}/${mode}" diff --git a/docker/scripts/screenshots.sh b/docker/scripts/screenshots.sh index c0d91d6..6c3161f 100755 --- a/docker/scripts/screenshots.sh +++ b/docker/scripts/screenshots.sh @@ -11,7 +11,10 @@ # frozen clock, so every screenshot is reproducible. tools/ui_flow.py # drives the app and checks the screens. Then the app is launched again and # its glance, which now shows the favourite's code (the first run sealed it), -# is checked as glance_code.png. +# is checked as glance_code.png. Then the second UI-test build +# (uitest-extra.jungle: legacy PIN, queued "Require PIN", more symbologies) +# runs the extra scenario (ui_flow.py --scenario extra), and its glance, +# without a code, is checked as glance.png. set -euo pipefail # shellcheck source=ciq-env.sh source "$(dirname "${BASH_SOURCE[0]}")/ciq-env.sh" @@ -22,6 +25,7 @@ ciq_require_key for device in "$@"; do build-app.sh uitest "${device}" + build-app.sh uitest-extra "${device}" done ciq_start_display @@ -29,15 +33,16 @@ ciq_start_simulator out="${BUILD_DIR}/screenshots" -# A new launch starts in the glance; screenshot it before anything opens the app. +# A new launch of MODE's build starts in the glance; screenshot it as SCREEN +# (its "DIAG shown" name) before anything opens the app. shoot_glance() { - local device="$1" glance_log="${out}/$1/glance.log" + local device="$1" mode="$2" screen="$3" glance_log="${out}/$1/${3}.log" : >"${glance_log}" - monkeydo "${BUILD_DIR}/uitest/${device}.prg" "${device}" >>"${glance_log}" 2>&1 & + monkeydo "${BUILD_DIR}/${mode}/${device}.prg" "${device}" >>"${glance_log}" 2>&1 & CIQ_MONKEYDO_PID=$! local shown=0 for _ in $(seq 1 600); do - if grep -q "DIAG shown glance_code" "${glance_log}"; then + if grep -Eq "DIAG shown ${screen}[[:space:]]*$" "${glance_log}"; then shown=1 break fi @@ -45,12 +50,12 @@ shoot_glance() { done if ((shown == 0)); then ciq_stop_app - log "${device}: the glance with the favourite's code didn't appear; see ${glance_log}" + log "${device}: the glance (${screen}) didn't appear; see ${glance_log}" return 1 fi sleep 1 local status=0 - python3 /work/tools/ui_flow.py --shot glance_code --device-dir "${CIQ_HOME}/Devices/${device}" \ + python3 /work/tools/ui_flow.py --shot "${screen}" --device-dir "${CIQ_HOME}/Devices/${device}" \ --window "$(ciq_simulator_window)" --out "${out}/${device}" --golden "/work/test/golden/${device}" \ "${approve[@]}" || status=1 ciq_stop_app @@ -73,7 +78,20 @@ for device in "$@"; do --window "$(ciq_simulator_window)" --out "${out}/${device}" --golden "/work/test/golden/${device}" \ "${approve[@]}" || failed=1 ciq_stop_app - shoot_glance "${device}" || failed=1 + shoot_glance "${device}" uitest glance_code || failed=1 + # The extra scenario: its own build and launch (README 17.4). + extra_log="${out}/${device}/app-extra.log" + if ! ciq_launch_app "${device}" "${extra_log}" uitest-extra; then + ciq_stop_app + log "no first frame of the extra scenario on ${device}; see ${extra_log}" + failed=1 + continue + fi + python3 /work/tools/ui_flow.py --scenario extra --device-dir "${CIQ_HOME}/Devices/${device}" --log "${extra_log}" \ + --window "$(ciq_simulator_window)" --out "${out}/${device}" --golden "/work/test/golden/${device}" \ + "${approve[@]}" || failed=1 + ciq_stop_app + shoot_glance "${device}" uitest-extra glance || failed=1 done ((failed == 0)) || die "screenshot checks failed; see build/screenshots/" -- cgit v1.2.3