1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-23 18:53:08 +00:00

Make solidify_wallpaper more universal to handle different desktops.

This commit is contained in:
Lukáš Růžička 2020-04-28 11:12:43 +02:00 committed by adamwill
parent 0594fc8d57
commit 61f845dbbf
8 changed files with 77 additions and 76 deletions

View File

@ -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;

View File

@ -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"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -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"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -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,

View File

@ -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;
}

View File

@ -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();