diff --git a/lib/utils.pm b/lib/utils.pm index bff437aa..0437638f 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -875,13 +875,27 @@ sub check_desktop { timeout => 30, @_ ); - assert_screen "apps_menu_button", $args{timeout}; - # GNOME 40 starts on the overview by default; for consistency with - # older GNOME and KDE, let's just close it - if (match_has_tag "apps_menu_button_active") { - wait_still_screen 3; - send_key "alt-f1"; - assert_screen "apps_menu_button_inactive"; + my $count = 5; + my $activematched = 0; + while ($count > 0) { + $count -= 1; + assert_screen "apps_menu_button", $args{timeout}; + # GNOME 40 starts on the overview by default; for consistency with + # older GNOME and KDE, let's just close it + if (match_has_tag "apps_menu_button_active") { + $activematched = 1; + wait_still_screen 5; + send_key "super"; + wait_still_screen 5; + } + else { + # this means we saw 'inactive', which is what we want + last; + } + } + if ($activematched) { + # make sure we got to inactive after active + die "never reached apps_menu_button_inactive!" unless (match_has_tag "apps_menu_button_inactive"); } } @@ -928,7 +942,7 @@ sub start_with_launcher { # The following varies for different desktops. if ($desktop eq 'gnome') { # Start the Activities page - send_key 'alt-f1'; + send_key 'super'; wait_still_screen 5; # Click on the menu icon to come into the menus @@ -1128,8 +1142,7 @@ sub menu_launch_type { # launcher, typing the specified string and hitting enter. Pass # the string to be typed to launch whatever it is you want. my $app = shift; - # super does not work on KDE, because fml - send_key 'alt-f1'; + send_key 'super'; # srsly KDE y u so slo wait_still_screen 3; type_very_safely $app; diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index 2b82e343..9303fc80 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -113,8 +113,22 @@ sub run { else { # on lives, we have to explicitly launch anaconda if (get_var('LIVE')) { - assert_screen ["live_start_anaconda_icon", "apps_menu_button_active"], 300; - send_key "alt-f1" if match_has_tag "apps_menu_button_active"; + my $count = 5; + while ($count > 0) { + $count -= 1; + assert_screen ["live_start_anaconda_icon", "apps_menu_button_active"], 300; + if (match_has_tag "apps_menu_button_active") { + # give GNOME some time to be sure it's done starting up + # and ready for input + wait_still_screen 5; + send_key "super"; + wait_still_screen 5; + } + else { + # this means we saw the launcher, which is what we want + last; + } + } # for KDE we need to double-click after kde-settings-34.6-1, # which is stable now. # FIXME: when F33 goes EOL, make the condition just "if kde" diff --git a/tests/_graphical_input.pm b/tests/_graphical_input.pm index a7a3af74..dd412154 100644 --- a/tests/_graphical_input.pm +++ b/tests/_graphical_input.pm @@ -20,7 +20,7 @@ sub run { } # do this from the overview because the desktop uses the stupid # transparent top bar which messes with our needles - send_key "alt-f1"; + send_key "super"; assert_screen "overview_app_grid"; # check both layouts are available at the desktop; here, # we can expect input method switching to work too @@ -33,7 +33,7 @@ sub run { # wait a bit for input switch to complete sleep 3; - # assume we can test input from whatever 'alt-f1' opened + # assume we can test input from whatever 'super' opened type_safely "yama"; assert_screen "desktop_yama_hiragana"; send_key "spc"; diff --git a/tests/apps_startstop/gnome/settings.pm b/tests/apps_startstop/gnome/settings.pm index 2d71506d..f78679b1 100644 --- a/tests/apps_startstop/gnome/settings.pm +++ b/tests/apps_startstop/gnome/settings.pm @@ -8,10 +8,8 @@ use utils; sub run { my $self = shift; # start the settings application - send_key 'alt-f1'; - type_very_safely 'settings'; - send_key 'ret'; - + menu_launch_type 'settings'; + # select Background menu item assert_and_click 'apps_settings_menu_background'; wait_still_screen 5; diff --git a/tests/apps_startstop/gnome/terminal.pm b/tests/apps_startstop/gnome/terminal.pm index afeea47a..328a1cd9 100644 --- a/tests/apps_startstop/gnome/terminal.pm +++ b/tests/apps_startstop/gnome/terminal.pm @@ -3,17 +3,12 @@ use strict; use testapi; use utils; -# This test tests if Terminal starts and uses it to change desktop settings for all the following tests. -# Therefore, if you want to use all the tests from the APPS family, this should be the very first to do. +# This test tests if Terminal starts. sub run { my $self = shift; # open the application - send_key 'alt-f1'; - wait_still_screen 2; - type_very_safely 'terminal'; - send_key 'ret'; - wait_still_screen 5; + menu_launch_type "terminal"; assert_screen "apps_run_terminal"; # Register application diff --git a/tests/desktop_browser.pm b/tests/desktop_browser.pm index 0dbe968e..c5cf1f14 100644 --- a/tests/desktop_browser.pm +++ b/tests/desktop_browser.pm @@ -28,7 +28,7 @@ sub _open_new_tab { sub run { my $self = shift; check_desktop; - send_key 'alt-f1'; + send_key 'super'; # wait out animations wait_still_screen(stilltime=>4, similarity_level=>45); assert_and_click 'browser_launcher';