#163 Make solidify_wallpaper more universal to handle different desktops.
Merged 3 years ago by adamwill. Opened 3 years ago by lruzicka.

file modified
+40 -23
@@ -7,7 +7,7 @@ 

  

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

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

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

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

file modified
+2 -19
@@ -8,25 +8,8 @@ 

  

  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, 

@@ -8,7 +8,7 @@ 

  

  sub run {

      my $self = shift;

-     solidify_wallpaper_kde;

+     solidify_wallpaper;

      # get rid of unwanted notifications that interfere with tests

      click_unwanted_notifications;

  }

file modified
+6 -5
@@ -203,7 +203,7 @@ 

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

  

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

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

This changes the solidify_wallpaper_kde subroutine into a universal solidify_wallpaper subroutine that can handle both gnome and kde and changes the desktop wallpaper into a solid color to allow for long term needles without the need to reneedle when the desktop wallpaper changes.

Build succeeded.

rebased onto 7046d276164ed201a1f18c09c2443a55d0c95bde

3 years ago

Build succeeded.

rebased onto 61f845d

3 years ago

Pull-Request has been merged by adamwill

3 years ago

Build succeeded.

Metadata Update from @lruzicka:
- Pull-request tagged with: improvetest
- Request assigned

3 years ago

Metadata Update from @lruzicka:
- Request assignee reset

3 years ago