From 4a6cd8bcd51819a208a4f47d2f3268e8ecfa6f39 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 9 Jul 2020 14:25:22 -0700 Subject: [PATCH] Abstract out overview type-to-search bug workaround And also use it in GNOME apps settings.pm test. Signed-off-by: Adam Williamson --- lib/utils.pm | 19 +++++++++++++------ tests/_graphical_input.pm | 6 +----- tests/apps_startstop/gnome/settings.pm | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index dcff4cce..44884706 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -7,7 +7,7 @@ use Exporter; use lockapi; use testapi; -our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type repo_setup setup_workaround_repo cleanup_workaround_repo gnome_initial_setup anaconda_create_user check_desktop download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut lo_dismiss_tip disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile bypass_1691487 get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log click_unwanted_notifications repos_mirrorlist register_application get_registered_applications solidify_wallpaper/; +our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type repo_setup setup_workaround_repo cleanup_workaround_repo gnome_initial_setup anaconda_create_user check_desktop download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut lo_dismiss_tip disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile bypass_1691487 get_release_number workaround_ble26 check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log click_unwanted_notifications repos_mirrorlist register_application get_registered_applications solidify_wallpaper/; # We introduce this global variable to hold the list of applications that have # registered during the apps_startstop_test when they have sucessfully run. @@ -1011,6 +1011,17 @@ sub get_release_number { return $version } +sub workaround_ble26 { + # FIXME: workaround for + # https://pagure.io/background-logo-extension/issue/26 + # when using the overview type-to-search box + my $relnum = get_release_number; + if (get_var("DESKTOP") eq "gnome" && $relnum > 32) { + # FIXME: workaround https://pagure.io/background-logo-extension/issue/26 + assert_and_click "overview_search_box"; + } + + sub menu_launch_type { # Launch an application in a graphical environment, by opening a # launcher, typing the specified string and hitting enter. Pass @@ -1020,11 +1031,7 @@ sub menu_launch_type { send_key 'alt-f1'; # srsly KDE y u so slo wait_still_screen 3; - my $relnum = get_release_number; - if (get_var("DESKTOP") eq "gnome" && $relnum > 32) { - # FIXME: workaround https://pagure.io/background-logo-extension/issue/26 - assert_and_click "overview_search_box"; - } + workaround_ble26; type_very_safely $app; send_key 'ret'; } diff --git a/tests/_graphical_input.pm b/tests/_graphical_input.pm index 45f27679..c85b3ef6 100644 --- a/tests/_graphical_input.pm +++ b/tests/_graphical_input.pm @@ -18,11 +18,7 @@ sub run { if (get_var("LANGUAGE") eq 'japanese') { # wait a bit for input switch to complete sleep 3; - my $relnum = get_release_number; - if (get_var("DESKTOP") eq "gnome" && $relnum > 32) { - # FIXME: workaround https://pagure.io/background-logo-extension/issue/26 - assert_and_click "overview_search_box"; - } + workaround_ble26; # assume we can test input from whatever 'alt-f1' opened type_safely "yama"; diff --git a/tests/apps_startstop/gnome/settings.pm b/tests/apps_startstop/gnome/settings.pm index 2d71506d..fedcef46 100644 --- a/tests/apps_startstop/gnome/settings.pm +++ b/tests/apps_startstop/gnome/settings.pm @@ -9,6 +9,7 @@ sub run { my $self = shift; # start the settings application send_key 'alt-f1'; + workaround_ble26; type_very_safely 'settings'; send_key 'ret';