From c7abcb972e602e1c74d1754370af83c0603f6c71 Mon Sep 17 00:00:00 2001 From: wusumac <736139669@qq.com> Date: Tue, 15 Sep 2026 10:21:29 +0800 Subject: [PATCH] test(m79-d): poll for risk options instead of failing a still-populating board --- runtime/tools/m60_full_cycle_playthrough.gd | 28 ++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/runtime/tools/m60_full_cycle_playthrough.gd b/runtime/tools/m60_full_cycle_playthrough.gd index 10badf89..5c28c071 100644 --- a/runtime/tools/m60_full_cycle_playthrough.gd +++ b/runtime/tools/m60_full_cycle_playthrough.gd @@ -162,18 +162,28 @@ func _press_first_risk_option(label: String) -> void: var list := shell.find_child("RiskOptionList", true, false) as Control var control: Control = null var used := "" - var parents: Array = [list] if list != null else [shell] - for parent in parents: - if parent == null: - continue - for child in parent.find_children("RiskOption*", "BaseButton", true, false): - var button := child as BaseButton - if button != null and button.is_visible_in_tree() and not button.disabled: - control = button - used = String(button.name) + # The risk board populates its options asynchronously after the screen + # transition; under a loaded suite run the first frame can still show an + # empty list, so poll briefly instead of failing a healthy board. + for _attempt in 30: + control = null + var parents: Array = [list] if list != null else [shell] + for parent in parents: + if parent == null: + continue + for child in parent.find_children("RiskOption*", "BaseButton", true, false): + var button := child as BaseButton + if button != null and button.is_visible_in_tree() and not button.disabled: + control = button + used = String(button.name) + break + if control != null: break if control != null: break + if list == null: + list = shell.find_child("RiskOptionList", true, false) as Control + await _frames(6) if control == null: await _step(label, "a selectable risk option", shell.current_screen, "blocked", "no enabled RiskOption node") _finish(1)