aboutsummaryrefslogtreecommitdiff
path: root/tools/tests/test_ui_flow.py
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-10-25 23:51:52 +0100
committercirakg <cirakg@cirakg.xyz>2026-10-25 23:51:52 +0100
commitb8addc87f804789368612bf8e1be31a2bf28efe1 (patch)
treebece4051eb6f009eba05ffdd585420232741a7d7 /tools/tests/test_ui_flow.py
parent140a6660f63f88d05ba9aae0bf1c4b401bb6574d (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'tools/tests/test_ui_flow.py')
-rw-r--r--tools/tests/test_ui_flow.py10
1 files changed, 10 insertions, 0 deletions
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