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 --- tools/tests/test_ui_flow.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/tests/test_ui_flow.py') diff --git a/tools/tests/test_ui_flow.py b/tools/tests/test_ui_flow.py index d98b4c2..5e359c2 100644 --- a/tools/tests/test_ui_flow.py +++ b/tools/tests/test_ui_flow.py @@ -81,3 +81,13 @@ def test_barcodes_on_reads_a_drawn_code(tmp_path: Path) -> None: screen = Image.open(path).convert("RGB") assert ui_flow.barcodes_on(screen) == ["OTPW stress"] assert ui_flow.barcodes_on(Image.new("RGB", (100, 100), "white")) == [] + + +def test_vertical_shift_measures_a_scrolled_list() -> None: + rows = Image.new("L", (60, 400), 0) + for top in range(0, 400, 50): # bands of different shades, like menu items + rows.paste(40 + top // 2, (5, top + 5, 55, top + 40)) + before = rows.crop((0, 0, 60, 200)) + assert ui_flow.vertical_shift(before, rows.crop((0, 37, 60, 237))) == 37 + assert ui_flow.vertical_shift(rows.crop((0, 37, 60, 237)), before) == -37 + assert ui_flow.vertical_shift(before, before) == 0 -- cgit v1.2.3