From c9408e2335fa61fe20cbcbe99a2e04b1a51f706b Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sat, 25 Jan 2025 10:30:24 -0800 Subject: [PATCH] select_cockpit_update: be more defensive against scrolls This new way is working better, but a few times I've seen it fail, I think because it's matching the 'updates' link while it's still scrolling so when it clicks, the link has moved and the click fails. Let's wait a bit after we see it, then match *again* and click, instead of relying on the last match area. Signed-off-by: Adam Williamson --- lib/cockpit.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cockpit.pm b/lib/cockpit.pm index ece0db57..91e17707 100644 --- a/lib/cockpit.pm +++ b/lib/cockpit.pm @@ -52,7 +52,8 @@ sub select_cockpit_update { click_lastmatch; if (match_has_tag "cockpit_search") { send_key_until_needlematch("cockpit_software_updates", "down", 10, 2); - click_lastmatch; + wait_still_screen 1; + assert_and_click("cockpit_software_updates"); } # wait for the updates to download assert_screen 'cockpit_updates_check', 300;