From 405dfb49b3bc77fe71bbaf1c3b58c79dd9b34317 Mon Sep 17 00:00:00 2001 From: "Adam M. Szalkowski" Date: Sun, 6 Sep 2026 18:57:23 +0200 Subject: [PATCH] test(ci): poll UI dump for pin shortcut dialog before fallback --- scripts/test_upgrade_shortcut.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/test_upgrade_shortcut.py b/scripts/test_upgrade_shortcut.py index 5a201a4..0acb4b5 100644 --- a/scripts/test_upgrade_shortcut.py +++ b/scripts/test_upgrade_shortcut.py @@ -292,7 +292,8 @@ def test_upgrade_flow(): print("Confirming System Pin Shortcut dialog...") pinPattern = re.compile(r'(?i)(add automatically|add to home screen|\badd\b|allow|ok)') clicked_pin = False - for attempt in range(5): + for attempt in range(10): + time.sleep(1) xml = dump_ui() for match in re.finditer(r']+)>', xml): attr = match.group(1) @@ -302,7 +303,7 @@ def test_upgrade_flow(): dm = re.search(r'content-desc="([^"]*)"', attr) if dm: node_text += " " + dm.group(1) - if pinPattern.search(node_text): + if pinPattern.search(node_text) or 'button1' in attr or 'btn_add' in attr: bounds_match = re.search(r'bounds="\[(\d+),(\d+)\]\[(\d+),(\d+)\]"', attr) if bounds_match: x1, y1, x2, y2 = map(int, bounds_match.groups()) @@ -315,7 +316,9 @@ def test_upgrade_flow(): break if clicked_pin: break - print("Retrying pin dialog search / DPAD navigation...") + + if not clicked_pin: + print("Fallback pin dialog tap...") adb_shell("input keyevent KEYCODE_DPAD_RIGHT", check=False) adb_shell("input keyevent KEYCODE_ENTER", check=False) time.sleep(1)