From 9dc2db1d892fb43e20a4294851fa1dc80a36992d Mon Sep 17 00:00:00 2001 From: babin Date: Sat, 19 Sep 2026 15:48:22 +0300 Subject: [PATCH] Recognize accessible Android power button labels --- scripts/android_smoke.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/android_smoke.py b/scripts/android_smoke.py index 7af7e95..8a5067a 100644 --- a/scripts/android_smoke.py +++ b/scripts/android_smoke.py @@ -45,7 +45,10 @@ def ui_dump(label): def label_node(tree, label): for node in tree.iter("node"): - if label in (node.get("text", ""), node.get("content-desc", "")): + # Android aggregates the decorative arrow into the button's accessible + # text (observed in the API35 CI dump). Accept only that exact suffix. + names = (node.get("text", "").strip(), node.get("content-desc", "").strip()) + if any(name in (label, f"{label} →") for name in names): bounds = re.fullmatch(r"\[(\d+),(\d+)\]\[(\d+),(\d+)\]", node.get("bounds", "")) if bounds: x1, y1, x2, y2 = map(int, bounds.groups())