diff --git a/lib/utils.pm b/lib/utils.pm index 8f25349f..e1065aa8 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_kde/; +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/; # We introduce this global variable to hold the list of applications that have # registered during the apps_startstop_test when they have sucessfully run. @@ -1190,29 +1190,46 @@ sub register_application { # we will keep it that way. The following code has been taken from the # KDE startstop tests but it is good to have it here, because it will be # needed more often now, it seems. -sub solidify_wallpaper_kde { +sub solidify_wallpaper { + my $desktop = get_var("DESKTOP"); + if ($desktop eq "KDE") { # Run the Desktop settings - hold_key 'alt'; - send_key 'd'; - send_key 's'; - release_key 'alt'; - # Select type of background - assert_and_click "deskset_select_type"; - wait_still_screen 2; - # Select plain color type - assert_and_click "deskset_plain_color"; - wait_still_screen 2; - # Open colors selection - assert_and_click "deskset_select_color"; - wait_still_screen 2; - # Select black - assert_and_click "deskset_select_black"; - wait_still_screen 2; - # Confirm - assert_and_click "kde_ok"; - wait_still_screen 2; - # Close the application - assert_and_click "kde_ok"; + hold_key 'alt'; + send_key 'd'; + send_key 's'; + release_key 'alt'; + # Select type of background + assert_and_click "deskset_select_type"; + wait_still_screen 2; + # Select plain color type + assert_and_click "deskset_plain_color"; + wait_still_screen 2; + # Open colors selection + assert_and_click "deskset_select_color"; + wait_still_screen 2; + # Select black + assert_and_click "deskset_select_black"; + wait_still_screen 2; + # Confirm + assert_and_click "kde_ok"; + wait_still_screen 2; + # Close the application + assert_and_click "kde_ok"; + } + elsif ($desktop eq "gnome") { + # Start the terminal to set up backgrounds. + menu_launch_type "gnome-terminal"; + # When the application opens, run command in it to set the background to black + type_very_safely "gsettings set org.gnome.desktop.background picture-uri ''"; + send_key 'ret'; + wait_still_screen 2; + type_very_safely "gsettings set org.gnome.desktop.background primary-color '#000000'"; + send_key 'ret'; + wait_still_screen 2; + quit_with_shortcut(); + # check that is has changed color + assert_screen 'apps_settings_screen_black'; + } } 1; diff --git a/needles/gnome/locked_screen_switch_user.json b/needles/gnome/locked_screen_switch_user.json index 8541fea9..d369cce5 100644 --- a/needles/gnome/locked_screen_switch_user.json +++ b/needles/gnome/locked_screen_switch_user.json @@ -1,15 +1,15 @@ -{ - "properties": [], - "tags": [ - "locked_screen_switch_user" - ], - "area": [ - { - "xpos": 963, - "ypos": 708, - "width": 22, - "height": 21, - "type": "match" - } - ] +{ + "area": [ + { + "xpos": 962, + "ypos": 707, + "width": 27, + "type": "match", + "height": 19 + } + ], + "properties": [], + "tags": [ + "locked_screen_switch_user" + ] } \ No newline at end of file diff --git a/needles/gnome/locked_screen_switch_user.png b/needles/gnome/locked_screen_switch_user.png index 868d1784..78124eda 100644 Binary files a/needles/gnome/locked_screen_switch_user.png and b/needles/gnome/locked_screen_switch_user.png differ diff --git a/needles/gnome/system_menu_button.json b/needles/gnome/system_menu_button.json index 7ae2b8b1..b952d676 100644 --- a/needles/gnome/system_menu_button.json +++ b/needles/gnome/system_menu_button.json @@ -1,15 +1,15 @@ -{ - "properties": [], - "tags": [ - "system_menu_button" - ], - "area": [ - { - "xpos": 969, - "ypos": 2, - "width": 45, - "height": 25, - "type": "match" - } - ] +{ + "area": [ + { + "type": "match", + "width": 45, + "height": 25, + "xpos": 969, + "ypos": 2 + } + ], + "properties": [], + "tags": [ + "system_menu_button" + ] } \ No newline at end of file diff --git a/needles/gnome/system_menu_button.png b/needles/gnome/system_menu_button.png index 09cc17c7..1ba71d22 100644 Binary files a/needles/gnome/system_menu_button.png and b/needles/gnome/system_menu_button.png differ diff --git a/tests/apps_gnome_preset.pm b/tests/apps_gnome_preset.pm index 1199f927..8767781d 100644 --- a/tests/apps_gnome_preset.pm +++ b/tests/apps_gnome_preset.pm @@ -8,25 +8,8 @@ use utils; sub run { my $self = shift; - # open the application, let use the method that does not require any needles, - # because this way, the terminal will always start even if some needles - # might fail because of changing background in various releases. - send_key 'alt-f1'; - wait_still_screen 2; - type_very_safely 'terminal'; - send_key 'ret'; - wait_still_screen 5; - - # When the application opens, run command in it to set the background to black - type_very_safely "gsettings set org.gnome.desktop.background picture-uri ''"; - send_key 'ret'; - wait_still_screen 2; - type_very_safely "gsettings set org.gnome.desktop.background primary-color '#000000'"; - send_key 'ret'; - wait_still_screen 2; - quit_with_shortcut(); - # check that is has changed color - assert_screen 'apps_settings_screen_black'; + # Change the background to black. + solidify_wallpaper; } # If this test fails, the others will probably start failing too, diff --git a/tests/apps_startstop/kde/aasetting.pm b/tests/apps_startstop/kde/aasetting.pm index 8d173fbf..52ecc476 100644 --- a/tests/apps_startstop/kde/aasetting.pm +++ b/tests/apps_startstop/kde/aasetting.pm @@ -8,7 +8,7 @@ use utils; sub run { my $self = shift; - solidify_wallpaper_kde; + solidify_wallpaper; # get rid of unwanted notifications that interfere with tests click_unwanted_notifications; } diff --git a/tests/desktop_login.pm b/tests/desktop_login.pm index 606cf492..2a5ef3f0 100644 --- a/tests/desktop_login.pm +++ b/tests/desktop_login.pm @@ -203,7 +203,7 @@ sub run { our $desktop = get_var("DESKTOP"); # Get rid of the KDE wallpaper and make background black. if ($desktop eq "kde") { - solidify_wallpaper_kde; + solidify_wallpaper; # also get rid of the wallpaper on SDDM screen. This is system # wide so we only need do it once menu_launch_type $term; @@ -243,9 +243,9 @@ sub run { # Log in with the first user account. login_user(user=>"jack", password=>$jackpass); - if ($desktop eq "kde") { - solidify_wallpaper_kde; - } + # Because some of the desktop candiness is based on semi-transparent items that change colours + # with every background change, we want to get rid of the background and make it a solid color. + solidify_wallpaper; check_user_logged_in("jack"); # Log out the user. logout_user(); @@ -258,8 +258,9 @@ sub run { else { # If not, we are in KDE and we will log in normally. login_user(user=>"jim", password=>$jimpass); - solidify_wallpaper_kde; } + # The backgrounds must be solid for both newly created users to take effect in the login session. + solidify_wallpaper; check_user_logged_in("jim"); # And this time reboot the system using the menu. reboot_system();