diff --git a/tests/desktop_update_graphical.pm b/tests/desktop_update_graphical.pm index 1ee81c67..218db152 100644 --- a/tests/desktop_update_graphical.pm +++ b/tests/desktop_update_graphical.pm @@ -101,14 +101,16 @@ sub run { click_lastmatch if (check_screen "desktop_package_tool_update_download_unsigned", 30); } elsif ($desktop eq 'gnome' && !get_var("ADVISORY_OR_TASK")) { - # we might get a key import prompt + # we might get key import prompts # https://gitlab.gnome.org/GNOME/gnome-software/-/issues/2874 # this won't happen for update tests as we've already # imported it in an earlier dnf command-line operation - if (check_screen 'desktop_package_tool_import_key', 30) { + my $limit = 5; + while (check_screen 'desktop_package_tool_import_key', 30 && $limit) { click_lastmatch; my $pass = get_var("USER_PASSWORD", "weakpassword"); type_very_safely("$pass\n") if (check_screen("auth_required", 10)); + $limit--; } } # If there is an issue and Software reports it, let us click