From e05a7629a3d9b3217266b15c2bacec362145f434 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 10 Mar 2022 16:29:31 -0800 Subject: [PATCH] Handle Firefox 97+ not prompting what to do about downloads Firefox 97+ don't ask you what to do with downloads any more, they just...download them. For now we'll handle both workflows, once 97+ is stable everywhere we can drop handling the old one. Signed-off-by: Adam Williamson --- tests/desktop_browser.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/desktop_browser.pm b/tests/desktop_browser.pm index c5cf1f14..a92b7f47 100644 --- a/tests/desktop_browser.pm +++ b/tests/desktop_browser.pm @@ -49,10 +49,16 @@ sub run { type_very_safely "https://kernel.org\n"; assert_and_click "browser_kernelorg_patch"; wait_still_screen(stilltime=>2, similarity_level=>45); - assert_and_click "browser_download_save"; - sleep 2; - send_key 'ret'; - wait_still_screen(stilltime=>3, similarity_level=>45); + # FIXME: Firefox 97+ don't show the "choose what to do" popup + # by default, they just download the file. Once 97 is stable + # on all releases we can drop the browser_download_save handling + assert_screen ["browser_download_save", "browser_download_complete"]; + if (match_has_tag("browser_download_save")) { + click_lastmatch; + sleep 2; + send_key 'ret'; + wait_still_screen(stilltime=>3, similarity_level=>45); + } # browsers do...something...when the download completes, and we # expect there's a single click to make it go away and return # browser to a state where we can open a new tab