diff --git a/lib/fedoradistribution.pm b/lib/fedoradistribution.pm index 5f455066..e1a9e46d 100644 --- a/lib/fedoradistribution.pm +++ b/lib/fedoradistribution.pm @@ -4,6 +4,7 @@ use strict; use base 'distribution'; use Cwd; +use i3; # Fedora distribution class @@ -63,7 +64,7 @@ sub init() { # If this should change in the future, we would need to enhance this routine. sub x11_start_program { my ($self, $program, $timeout, $options) = @_; - send_key "alt-f2"; + send_key (get_var("DESKTOP") eq "i3" ? get_i3_modifier() . "-d" : "alt-f2"); assert_screen "desktop_runner"; type_string $program, 20; sleep 5; # because of KDE dialog - SUSE guys are doing the same! @@ -182,5 +183,19 @@ sub assert_script_sudo { return; } +sub become_root { + my ($self) = @_; + + my $rootpwd = get_var("ROOT_PASSWORD", "weakpassword"); + + if (check_screen("apps_run_terminal") || is_serial_terminal()) { + type_string("su -\n"); + sleep(2); + type_string("$rootpwd\n"); + } else { + die "No terminal to become root is present"; + } +} + 1; # vim: set sw=4 et: diff --git a/lib/i3.pm b/lib/i3.pm new file mode 100644 index 00000000..0f71bd3e --- /dev/null +++ b/lib/i3.pm @@ -0,0 +1,55 @@ +package i3; + +use strict; + +use base 'Exporter'; +use Exporter; + +use testapi; +use utils; + +our @EXPORT = qw/firstlaunch_setup get_i3_modifier create_user_i3_config launch_terminal/; + + +sub get_i3_modifier { + return get_var("I3_MODIFIER", 'alt'); +} + +sub firstlaunch_setup { + my %args = @_; + my $timeout = $args{timeout} || 30; + my $modifier = $args{modifier} || get_i3_modifier(); + + die "invalid modifier $modifier, only alt and super are possible" unless (($modifier eq 'alt') || ($modifier eq 'super')); + + assert_screen('i3_firstlaunch_wizard', $timeout); + + if ($modifier eq 'alt') { + send_key('esc', wait_screen_change => 1); + } else { + send_key('ret', wait_screen_change => 1); + send_key_until_needlematch('down', 'i3_generate_config'); + send_key('ret', wait_screen_change => 1); + } +} + +sub create_user_i3_config { + my %args = @_; + + my $login = $args{login}; + my $remove_config_wizard = $args{remove_config_wizard} || 1; + + assert_script_run("mkdir -p /home/$login/.config/i3/"); + # ensure that no alias of cp prevents an existing config from being overwritten + assert_script_run("/usr/bin/cp -f /etc/i3/config /home/$login/.config/i3/config"); + if ($remove_config_wizard) { + assert_script_run("sed -i '/i3-config-wizard/d' /home/$login/.config/i3/config"); + } + assert_script_run "chown -R $login.$login /home/$login/.config"; + assert_script_run "restorecon -vr /home/$login/.config"; +} + +sub launch_terminal { + send_key(get_i3_modifier() . '-ret'); + assert_screen("apps_run_terminal"); +} diff --git a/lib/utils.pm b/lib/utils.pm index 182d1845..caf5508e 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -4,6 +4,7 @@ use strict; use base 'Exporter'; use Exporter; +use i3; use lockapi; use testapi qw(is_serial_terminal :DEFAULT); @@ -1082,6 +1083,7 @@ sub check_desktop { # close it if it's open. my %args = ( timeout => 30, + no_firstlaunch_check => 0, @_ ); my $count = 5; @@ -1108,11 +1110,35 @@ sub check_desktop { last; } } + + if (get_var("DESKTOP") eq 'i3') { + my $version = get_var('VERSION'); + + # i3 launches pretty quickly, but sometimes we have to wait for the + # whole VM to launch + assert_screen("i3-bar", $args{timeout}); + if ($version ne "Rawhide") { + assert_screen("${version}_background"); + } + + unless ($args{no_firstlaunch_check}) { + die "firstlaunch setup is present" if defined(check_screen('i3_firstlaunch_wizard')); + } + } else { + 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"; + } + } + 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"); } -} sub quit_firefox { # Quit Firefox, handling the 'close multiple tabs' warning screen if @@ -1376,9 +1402,13 @@ sub menu_launch_type { diag("Moving the mouse away from the launcher."); mouse_set(1, 1); } - wait_screen_change { send_key 'super'; }; - # srsly KDE y u so slo - wait_still_screen 3; + if (get_var("DESKTOP") eq "i3") { + send_key(get_var("I3_MODIFIER", 'alt') . "-d"); + } else { + wait_screen_change { send_key 'super'; }; + # srsly KDE y u so slo + wait_still_screen 3; + } type_very_safely $app; # Wait for KDE to place focus correctly. wait_still_screen 2; diff --git a/needles/addon_add-i3-20210719.json b/needles/addon_add-i3-20210719.json new file mode 100644 index 00000000..76c7ede7 --- /dev/null +++ b/needles/addon_add-i3-20210719.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "width": 30, + "height": 18, + "ypos": 508, + "xpos": 475, + "type": "match" + } + ], + "properties": [], + "tags": [ + "firefox_addon_add" + ] +} \ No newline at end of file diff --git a/needles/addon_add-i3-20210719.png b/needles/addon_add-i3-20210719.png new file mode 100644 index 00000000..1a0fa0f7 Binary files /dev/null and b/needles/addon_add-i3-20210719.png differ diff --git a/needles/addon_success-i3-20210719.json b/needles/addon_success-i3-20210719.json new file mode 100644 index 00000000..5b375923 --- /dev/null +++ b/needles/addon_success-i3-20210719.json @@ -0,0 +1,22 @@ +{ + "area": [ + { + "xpos": 520, + "type": "match", + "width": 62, + "height": 17, + "ypos": 508 + }, + { + "width": 20, + "ypos": 73, + "height": 19, + "type": "match", + "xpos": 951 + } + ], + "properties": [], + "tags": [ + "firefox_addon_success" + ] +} \ No newline at end of file diff --git a/needles/addon_success-i3-20210719.png b/needles/addon_success-i3-20210719.png new file mode 100644 index 00000000..443f621a Binary files /dev/null and b/needles/addon_success-i3-20210719.png differ diff --git a/needles/i3-bar.json b/needles/i3-bar.json new file mode 100644 index 00000000..82df0840 --- /dev/null +++ b/needles/i3-bar.json @@ -0,0 +1,29 @@ +{ + "area": [ + { + "xpos": 0, + "type": "match", + "width": 16, + "ypos": 751, + "height": 17 + }, + { + "height": 14, + "width": 15, + "ypos": 752, + "type": "match", + "xpos": 434 + }, + { + "type": "match", + "xpos": 486, + "height": 14, + "width": 18, + "ypos": 751 + } + ], + "properties": [], + "tags": [ + "i3-bar" + ] +} \ No newline at end of file diff --git a/needles/i3-bar.png b/needles/i3-bar.png new file mode 100644 index 00000000..d9ccdd97 Binary files /dev/null and b/needles/i3-bar.png differ diff --git a/needles/i3-dmenu.json b/needles/i3-dmenu.json new file mode 100644 index 00000000..8e08b64a --- /dev/null +++ b/needles/i3-dmenu.json @@ -0,0 +1,22 @@ +{ + "area": [ + { + "xpos": 0, + "ypos": 0, + "width": 44, + "height": 17, + "type": "match" + }, + { + "xpos": 999, + "ypos": 0, + "width": 25, + "height": 18, + "type": "match" + } + ], + "properties": [], + "tags": [ + "desktop_runner" + ] +} \ No newline at end of file diff --git a/needles/i3-dmenu.png b/needles/i3-dmenu.png new file mode 100644 index 00000000..0cf505db Binary files /dev/null and b/needles/i3-dmenu.png differ diff --git a/needles/i3-lightdm-login_screen-no_cursor.json b/needles/i3-lightdm-login_screen-no_cursor.json new file mode 100644 index 00000000..1ecfce55 --- /dev/null +++ b/needles/i3-lightdm-login_screen-no_cursor.json @@ -0,0 +1,25 @@ +{ + "area": [ + { + "ypos": 369, + "width": 130, + "height": 41, + "type": "match", + "xpos": 460 + }, + { + "type": "match", + "height": 24, + "xpos": 599, + "width": 53, + "ypos": 424 + } + ], + "properties": [], + "tags": [ + "login_screen", + "graphical_login_input", + "graphical_login", + "lightdm_login_screen" + ] +} \ No newline at end of file diff --git a/needles/i3-lightdm-login_screen-no_cursor.png b/needles/i3-lightdm-login_screen-no_cursor.png new file mode 100644 index 00000000..09d30e27 Binary files /dev/null and b/needles/i3-lightdm-login_screen-no_cursor.png differ diff --git a/needles/i3-lightdm-login_screen.json b/needles/i3-lightdm-login_screen.json new file mode 100644 index 00000000..15970644 --- /dev/null +++ b/needles/i3-lightdm-login_screen.json @@ -0,0 +1,25 @@ +{ + "area": [ + { + "xpos": 460, + "ypos": 369, + "width": 130, + "height": 41, + "type": "match" + }, + { + "xpos": 599, + "ypos": 424, + "width": 53, + "height": 24, + "type": "match" + } + ], + "properties": [], + "tags": [ + "login_screen", + "graphical_login_input", + "graphical_login", + "lightdm_login_screen" + ] +} diff --git a/needles/i3-lightdm-login_screen.png b/needles/i3-lightdm-login_screen.png new file mode 100644 index 00000000..1f3e4882 Binary files /dev/null and b/needles/i3-lightdm-login_screen.png differ diff --git a/needles/i3-logout-bar.json b/needles/i3-logout-bar.json new file mode 100644 index 00000000..f1b705b9 --- /dev/null +++ b/needles/i3-logout-bar.json @@ -0,0 +1,26 @@ +{ + "area": [ + { + "xpos": 4, + "ypos": 5, + "width": 180, + "height": 17, + "type": "match" + }, + { + "xpos": 891, + "ypos": 7, + "width": 73, + "height": 15, + "type": "match", + "click_point": { + "xpos": 36.5, + "ypos": 7.5 + } + } + ], + "properties": [], + "tags": [ + "i3-logout-bar" + ] +} \ No newline at end of file diff --git a/needles/i3-logout-bar.png b/needles/i3-logout-bar.png new file mode 100644 index 00000000..de5cd1d3 Binary files /dev/null and b/needles/i3-logout-bar.png differ diff --git a/needles/i3-mousepad-printing_pdfprinter_ready.json b/needles/i3-mousepad-printing_pdfprinter_ready.json new file mode 100644 index 00000000..9e345f26 --- /dev/null +++ b/needles/i3-mousepad-printing_pdfprinter_ready.json @@ -0,0 +1,19 @@ +{ + "area": [ + { + "xpos": 227, + "ypos": 200, + "width": 113, + "height": 21, + "type": "match", + "click_point": { + "xpos": 56.5, + "ypos": 10.5 + } + } + ], + "properties": [], + "tags": [ + "printing_pdfprinter_ready" + ] +} \ No newline at end of file diff --git a/needles/i3-mousepad-printing_pdfprinter_ready.png b/needles/i3-mousepad-printing_pdfprinter_ready.png new file mode 100644 index 00000000..8ac76d08 Binary files /dev/null and b/needles/i3-mousepad-printing_pdfprinter_ready.png differ diff --git a/needles/i3-mousepad-printing_print.json b/needles/i3-mousepad-printing_print.json new file mode 100644 index 00000000..c506f47e --- /dev/null +++ b/needles/i3-mousepad-printing_print.json @@ -0,0 +1,19 @@ +{ + "area": [ + { + "xpos": 763, + "ypos": 601, + "width": 56, + "height": 21, + "type": "match", + "click_point": { + "xpos": 28, + "ypos": 10.5 + } + } + ], + "properties": [], + "tags": [ + "printing_print" + ] +} \ No newline at end of file diff --git a/needles/i3-mousepad-printing_print.png b/needles/i3-mousepad-printing_print.png new file mode 100644 index 00000000..25d90246 Binary files /dev/null and b/needles/i3-mousepad-printing_print.png differ diff --git a/needles/i3-mupdf-printing_check_sentence.json b/needles/i3-mupdf-printing_check_sentence.json new file mode 100644 index 00000000..acce42ff --- /dev/null +++ b/needles/i3-mupdf-printing_check_sentence.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "height": 18, + "type": "match", + "xpos": 116, + "ypos": 18, + "width": 328 + } + ], + "properties": [], + "tags": [ + "printing_check_sentence" + ] +} \ No newline at end of file diff --git a/needles/i3-mupdf-printing_check_sentence.png b/needles/i3-mupdf-printing_check_sentence.png new file mode 100644 index 00000000..ecb209d5 Binary files /dev/null and b/needles/i3-mupdf-printing_check_sentence.png differ diff --git a/needles/i3-pavucontrol.json b/needles/i3-pavucontrol.json new file mode 100644 index 00000000..d880e671 --- /dev/null +++ b/needles/i3-pavucontrol.json @@ -0,0 +1,36 @@ +{ + "area": [ + { + "xpos": 3, + "ypos": 3, + "width": 95, + "height": 11, + "type": "match" + }, + { + "xpos": 17, + "ypos": 22, + "width": 68, + "height": 25, + "type": "match" + }, + { + "xpos": 111, + "ypos": 26, + "width": 71, + "height": 20, + "type": "match" + }, + { + "xpos": 209, + "ypos": 25, + "width": 106, + "height": 21, + "type": "match" + } + ], + "properties": [], + "tags": [ + "audio_mixer" + ] +} \ No newline at end of file diff --git a/needles/i3-pavucontrol.png b/needles/i3-pavucontrol.png new file mode 100644 index 00000000..3643b35d Binary files /dev/null and b/needles/i3-pavucontrol.png differ diff --git a/needles/i3-urxvt-run.json b/needles/i3-urxvt-run.json new file mode 100644 index 00000000..2827fc7e --- /dev/null +++ b/needles/i3-urxvt-run.json @@ -0,0 +1,23 @@ +{ + "area": [ + { + "height": 14, + "type": "match", + "ypos": 2, + "width": 38, + "xpos": 2 + }, + { + "type": "match", + "ypos": 33, + "xpos": 163, + "width": 37, + "height": 13 + } + ], + "properties": [], + "tags": [ + "apps_run_terminal", + "i3_dunst_no_notification" + ] +} \ No newline at end of file diff --git a/needles/i3-urxvt-run.png b/needles/i3-urxvt-run.png new file mode 100644 index 00000000..6319ed33 Binary files /dev/null and b/needles/i3-urxvt-run.png differ diff --git a/needles/i3_dunst_foo_notification.json b/needles/i3_dunst_foo_notification.json new file mode 100644 index 00000000..2ae4b883 --- /dev/null +++ b/needles/i3_dunst_foo_notification.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "height": 19, + "ypos": 29, + "width": 285, + "type": "match", + "xpos": 702 + } + ], + "properties": [], + "tags": [ + "i3_dunst_foo_notification" + ] +} \ No newline at end of file diff --git a/needles/i3_dunst_foo_notification.png b/needles/i3_dunst_foo_notification.png new file mode 100644 index 00000000..49795c19 Binary files /dev/null and b/needles/i3_dunst_foo_notification.png differ diff --git a/needles/i3_firstlaunch_wizard.json b/needles/i3_firstlaunch_wizard.json new file mode 100644 index 00000000..7923ccfa --- /dev/null +++ b/needles/i3_firstlaunch_wizard.json @@ -0,0 +1,29 @@ +{ + "area": [ + { + "xpos": 493, + "ypos": 281, + "width": 137, + "height": 13, + "type": "match" + }, + { + "xpos": 514, + "ypos": 364, + "width": 201, + "height": 16, + "type": "match" + }, + { + "xpos": 519, + "ypos": 391, + "width": 214, + "height": 14, + "type": "match" + } + ], + "properties": [], + "tags": [ + "i3_firstlaunch_wizard" + ] +} diff --git a/needles/i3_firstlaunch_wizard.png b/needles/i3_firstlaunch_wizard.png new file mode 100644 index 00000000..9f2683a0 Binary files /dev/null and b/needles/i3_firstlaunch_wizard.png differ diff --git a/needles/i3_windows_split.json b/needles/i3_windows_split.json new file mode 100644 index 00000000..15e51047 --- /dev/null +++ b/needles/i3_windows_split.json @@ -0,0 +1,29 @@ +{ + "area": [ + { + "width": 679, + "height": 16, + "ypos": 0, + "type": "match", + "xpos": 0 + }, + { + "ypos": 535, + "height": 128, + "width": 373, + "type": "match", + "xpos": 328 + }, + { + "xpos": 728, + "ypos": 7, + "width": 132, + "height": 23, + "type": "match" + } + ], + "properties": [], + "tags": [ + "i3_windows_split" + ] +} \ No newline at end of file diff --git a/needles/i3_windows_split.png b/needles/i3_windows_split.png new file mode 100644 index 00000000..98ad86df Binary files /dev/null and b/needles/i3_windows_split.png differ diff --git a/needles/i3_windows_stacked.json b/needles/i3_windows_stacked.json new file mode 100644 index 00000000..a0fad2a3 --- /dev/null +++ b/needles/i3_windows_stacked.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 0, + "ypos": 0, + "width": 133, + "height": 52, + "type": "match" + } + ], + "properties": [], + "tags": [ + "i3_windows_stacked" + ] +} \ No newline at end of file diff --git a/needles/i3_windows_stacked.png b/needles/i3_windows_stacked.png new file mode 100644 index 00000000..bb4f2436 Binary files /dev/null and b/needles/i3_windows_stacked.png differ diff --git a/needles/i3_windows_tabbed.json b/needles/i3_windows_tabbed.json new file mode 100644 index 00000000..790f22ae --- /dev/null +++ b/needles/i3_windows_tabbed.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 0, + "ypos": 0, + "width": 824, + "height": 18, + "type": "match" + } + ], + "properties": [], + "tags": [ + "i3_windows_tabbed" + ] +} \ No newline at end of file diff --git a/needles/i3_windows_tabbed.png b/needles/i3_windows_tabbed.png new file mode 100644 index 00000000..2f5607f2 Binary files /dev/null and b/needles/i3_windows_tabbed.png differ diff --git a/needles/lightdm-login_jack.json b/needles/lightdm-login_jack.json new file mode 100644 index 00000000..422e9cf8 --- /dev/null +++ b/needles/lightdm-login_jack.json @@ -0,0 +1,19 @@ +{ + "area": [ + { + "xpos": 467, + "type": "match", + "ypos": 258, + "width": 89, + "height": 26, + "click_point": { + "xpos": 44.5, + "ypos": 13 + } + } + ], + "properties": [], + "tags": [ + "login_jack" + ] +} \ No newline at end of file diff --git a/needles/lightdm-login_jack.png b/needles/lightdm-login_jack.png new file mode 100644 index 00000000..59be243d Binary files /dev/null and b/needles/lightdm-login_jack.png differ diff --git a/needles/lightdm-login_jim.json b/needles/lightdm-login_jim.json new file mode 100644 index 00000000..c7803ee6 --- /dev/null +++ b/needles/lightdm-login_jim.json @@ -0,0 +1,19 @@ +{ + "area": [ + { + "xpos": 467, + "ypos": 347, + "width": 66, + "height": 23, + "type": "match", + "click_point": { + "xpos": 33, + "ypos": 11.5 + } + } + ], + "properties": [], + "tags": [ + "login_jim" + ] +} \ No newline at end of file diff --git a/needles/lightdm-login_jim.png b/needles/lightdm-login_jim.png new file mode 100644 index 00000000..002319b5 Binary files /dev/null and b/needles/lightdm-login_jim.png differ diff --git a/needles/lightdm-login_wrong_password.json b/needles/lightdm-login_wrong_password.json new file mode 100644 index 00000000..f36baced --- /dev/null +++ b/needles/lightdm-login_wrong_password.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 360, + "ypos": 407, + "width": 293, + "height": 22, + "type": "match" + } + ], + "properties": [], + "tags": [ + "login_wrong_password" + ] +} \ No newline at end of file diff --git a/needles/lightdm-login_wrong_password.png b/needles/lightdm-login_wrong_password.png new file mode 100644 index 00000000..4fbefa74 Binary files /dev/null and b/needles/lightdm-login_wrong_password.png differ diff --git a/needles/lightdm_power_menu-reboot-confirm.json b/needles/lightdm_power_menu-reboot-confirm.json new file mode 100644 index 00000000..fdb69773 --- /dev/null +++ b/needles/lightdm_power_menu-reboot-confirm.json @@ -0,0 +1,33 @@ +{ + "area": [ + { + "xpos": 278, + "ypos": 314, + "width": 53, + "height": 53, + "type": "match" + }, + { + "xpos": 345, + "ypos": 316, + "width": 53, + "height": 18, + "type": "match" + }, + { + "xpos": 682, + "ypos": 426, + "width": 54, + "height": 22, + "type": "match", + "click_point": { + "xpos": 27, + "ypos": 11 + } + } + ], + "properties": [], + "tags": [ + "lightdm_power_menu-reboot-confirm" + ] +} \ No newline at end of file diff --git a/needles/lightdm_power_menu-reboot-confirm.png b/needles/lightdm_power_menu-reboot-confirm.png new file mode 100644 index 00000000..9abeef25 Binary files /dev/null and b/needles/lightdm_power_menu-reboot-confirm.png differ diff --git a/needles/lightdm_power_menu-reboot.json b/needles/lightdm_power_menu-reboot.json new file mode 100644 index 00000000..83f4ceb7 --- /dev/null +++ b/needles/lightdm_power_menu-reboot.json @@ -0,0 +1,40 @@ +{ + "area": [ + { + "xpos": 366, + "ypos": 324, + "width": 76, + "height": 85, + "type": "match" + }, + { + "xpos": 599, + "ypos": 425, + "width": 54, + "height": 21, + "type": "match" + }, + { + "xpos": 855, + "ypos": 77, + "width": 82, + "height": 21, + "type": "match", + "click_point": { + "xpos": 41, + "ypos": 10.5 + } + }, + { + "xpos": 965, + "ypos": 0, + "width": 59, + "height": 25, + "type": "match" + } + ], + "properties": [], + "tags": [ + "lightdm_power_menu-reboot" + ] +} \ No newline at end of file diff --git a/needles/lightdm_power_menu-reboot.png b/needles/lightdm_power_menu-reboot.png new file mode 100644 index 00000000..477bea84 Binary files /dev/null and b/needles/lightdm_power_menu-reboot.png differ diff --git a/needles/lightdm_power_menu-shutdown-confirm.json b/needles/lightdm_power_menu-shutdown-confirm.json new file mode 100644 index 00000000..3465440a --- /dev/null +++ b/needles/lightdm_power_menu-shutdown-confirm.json @@ -0,0 +1,33 @@ +{ + "area": [ + { + "xpos": 333, + "ypos": 311, + "width": 76, + "height": 27, + "type": "match" + }, + { + "xpos": 263, + "ypos": 309, + "width": 63, + "height": 64, + "type": "match" + }, + { + "xpos": 675, + "ypos": 429, + "width": 70, + "height": 17, + "type": "match", + "click_point": { + "xpos": 35, + "ypos": 8.5 + } + } + ], + "properties": [], + "tags": [ + "lightdm_power_menu-shutdown-confirm" + ] +} \ No newline at end of file diff --git a/needles/lightdm_power_menu-shutdown-confirm.png b/needles/lightdm_power_menu-shutdown-confirm.png new file mode 100644 index 00000000..9e0b3565 Binary files /dev/null and b/needles/lightdm_power_menu-shutdown-confirm.png differ diff --git a/needles/lightdm_power_menu.json b/needles/lightdm_power_menu.json new file mode 100644 index 00000000..e0aa53ab --- /dev/null +++ b/needles/lightdm_power_menu.json @@ -0,0 +1,33 @@ +{ + "area": [ + { + "xpos": 966, + "ypos": 3, + "width": 54, + "height": 19, + "type": "match", + "click_point": { + "xpos": 42, + "ypos": 9.5 + } + }, + { + "xpos": 358, + "ypos": 323, + "width": 89, + "height": 91, + "type": "match" + }, + { + "xpos": 597, + "ypos": 423, + "width": 56, + "height": 25, + "type": "match" + } + ], + "properties": [], + "tags": [ + "lightdm_power_menu" + ] +} \ No newline at end of file diff --git a/needles/lightdm_power_menu.png b/needles/lightdm_power_menu.png new file mode 100644 index 00000000..3b583807 Binary files /dev/null and b/needles/lightdm_power_menu.png differ diff --git a/needles/lightdm_user_selection.json b/needles/lightdm_user_selection.json new file mode 100644 index 00000000..6565486a --- /dev/null +++ b/needles/lightdm_user_selection.json @@ -0,0 +1,33 @@ +{ + "area": [ + { + "xpos": 600, + "ypos": 442, + "width": 51, + "height": 21, + "type": "match" + }, + { + "xpos": 624, + "ypos": 303, + "width": 43, + "height": 47, + "type": "match", + "click_point": { + "xpos": 21.5, + "ypos": 23.5 + } + }, + { + "xpos": 364, + "ypos": 306, + "width": 81, + "height": 90, + "type": "match" + } + ], + "properties": [], + "tags": [ + "lightdm_user_selection" + ] +} \ No newline at end of file diff --git a/needles/lightdm_user_selection.png b/needles/lightdm_user_selection.png new file mode 100644 index 00000000..63cd0518 Binary files /dev/null and b/needles/lightdm_user_selection.png differ diff --git a/needles/mousepad_no_document_open.json b/needles/mousepad_no_document_open.json new file mode 100644 index 00000000..a0a3411c --- /dev/null +++ b/needles/mousepad_no_document_open.json @@ -0,0 +1,22 @@ +{ + "area": [ + { + "xpos": 422, + "ypos": 27, + "width": 182, + "height": 19, + "type": "match" + }, + { + "xpos": 684, + "ypos": 2, + "width": 129, + "height": 12, + "type": "match" + } + ], + "properties": [], + "tags": [ + "mousepad_no_document_open" + ] +} \ No newline at end of file diff --git a/needles/mousepad_no_document_open.png b/needles/mousepad_no_document_open.png new file mode 100644 index 00000000..3e356611 Binary files /dev/null and b/needles/mousepad_no_document_open.png differ diff --git a/needles/printing_select_pdfprinter-mousepad.json b/needles/printing_select_pdfprinter-mousepad.json new file mode 100644 index 00000000..30a1a5f5 --- /dev/null +++ b/needles/printing_select_pdfprinter-mousepad.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "ypos": 223, + "width": 99, + "type": "match", + "xpos": 231, + "height": 19 + } + ], + "properties": [], + "tags": [ + "printing_select_pdfprinter" + ] +} \ No newline at end of file diff --git a/needles/printing_select_pdfprinter-mousepad.png b/needles/printing_select_pdfprinter-mousepad.png new file mode 100644 index 00000000..ad183b7c Binary files /dev/null and b/needles/printing_select_pdfprinter-mousepad.png differ diff --git a/templates.fif.json b/templates.fif.json index 3ce79931..21916843 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -213,6 +213,20 @@ }, "version": "*" }, + "fedora-i3-live-x86_64*": { + "arch": "x86_64", + "distri": "fedora", + "flavor": "i3-live-iso", + "settings": { + "DESKTOP": "i3", + "DEPLOY_UPLOAD_TEST": "install_default_upload", + "LIVE": "1", + "PACKAGE_SET": "default", + "TEST_TARGET": "ISO", + "USER_LOGIN": "i3-user" + }, + "version": "*" + }, "fedora-Minimal-raw_xz-raw.xz-aarch64-*": { "arch": "aarch64", "distri": "fedora", @@ -368,7 +382,7 @@ "flavor": "Workstation-upgrade", "settings": { "DESKTOP": "gnome", - "DEPLOY_UPLOAD_TEST": "upgrade_desktop" , + "DEPLOY_UPLOAD_TEST": "upgrade_desktop", "HDDSIZEGB": "20", "PACKAGE_SET": "default", "TEST_TARGET": "COMPOSE" @@ -513,6 +527,14 @@ "machine": "bios", "product": "fedora-KDE-live-iso-x86_64-*" }, + "fedora-i3-live-x86_64-*-uefi": { + "machine": "uefi", + "product": "fedora-i3-live-x86_64*" + }, + "fedora-i3-live-x86_64-*-64bit": { + "machine": "64bit", + "product": "fedora-i3-live-x86_64*" + }, "fedora-Minimal-raw_xz-raw.xz-aarch64-*-aarch64": { "machine": "aarch64", "product": "fedora-Minimal-raw_xz-raw.xz-aarch64-*" @@ -631,7 +653,9 @@ "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 40, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-live-iso-x86_64-*-64bit": 40, - "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70 + "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, + "fedora-Workstation-live-iso-x86_64-*-64bit": 40, + "fedora-i3-live-x86_64-*-64bit": 40 }, "settings": { "BOOTFROM": "c", @@ -663,7 +687,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22, - "fedora-Workstation-upgrade-aarch64-*-aarch64": 40 + "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, + "fedora-i3-live-x86_64-*-64bit": 20 }, "settings": { "BOOTFROM": "c", @@ -696,7 +721,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22, + "fedora-i3-live-x86_64-*-64bit": 20 }, "settings": { "BOOTFROM": "c", @@ -724,7 +750,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22, + "fedora-i3-live-x86_64-*-64bit": 20 }, "settings": { "BOOTFROM": "c", @@ -752,7 +779,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42, + "fedora-i3-live-x86_64-*-64bit": 40 }, "settings": { "BOOTFROM": "c", @@ -786,7 +814,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42 + "fedora-Workstation-raw_xz-raw.xz-aarch65-*-aarch64": 42, + "fedora-i3-live-x86_64-*-64bit": 40 }, "settings": { "BOOTFROM": "c", @@ -819,7 +848,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42, + "fedora-i3-live-x86_64-*-64bit": 40 }, "settings": { "BOOTFROM": "c", @@ -852,7 +882,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42, + "fedora-i3-live-x86_64-*-64bit": 40 }, "settings": { "BOOTFROM": "c", @@ -912,7 +943,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22, + "fedora-i3-live-x86_64-*-64bit": 50 }, "settings": { "BOOTFROM": "c", @@ -927,7 +959,8 @@ "fedora-Workstation-live-iso-x86_64-*-64bit": 30, "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, - "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 30 + "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 30, + "fedora-i3-live-x86_64-*-64bit": 30 }, "settings": { "BOOTFROM": "c", @@ -960,7 +993,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22, + "fedora-i3-live-x86_64-*-64bit": 20 }, "settings": { "BOOTFROM": "c", @@ -974,7 +1008,8 @@ "fedora-KDE-live-iso-x86_64-*-64bit": 32, "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 30, "fedora-Workstation-live-iso-x86_64-*-64bit": 30, - "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70 + "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, + "fedora-i3-live-x86_64-*-64bit": 30 }, "settings": { "ENTRYPOINT": "desktop_notifications" @@ -986,7 +1021,9 @@ "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 30, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-live-iso-x86_64-*-64bit": 30, - "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70 + "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, + "fedora-Workstation-live-iso-x86_64-*-64bit": 30, + "fedora-i3-live-x86_64-*-64bit": 30 }, "settings": { "BOOTFROM": "c", @@ -1021,7 +1058,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22, + "fedora-i3-live-x86_64-*-64bit": 20 }, "settings": { "BOOTFROM": "c", @@ -1040,7 +1078,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22, + "fedora-i3-live-x86_64-*-64bit": 30 }, "settings": { "BOOTFROM": "c", @@ -1381,7 +1420,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 32 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 32, + "fedora-Workstation-live-iso-x86_64-*-64bit": 30 }, "settings": { "BOOTFROM": "c", @@ -1390,6 +1430,17 @@ "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" } }, + "i3_tilling": { + "profiles": { + "fedora-i3-live-x86_64-*-64bit": 30 + }, + "settings": { + "BOOTFROM": "c", + "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2", + "POSTINSTALL": "i3_tilling", + "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" + } + }, "install_anaconda_text": { "profiles": { "fedora-Server-dvd-iso-aarch64-*-aarch64": 20, @@ -1648,7 +1699,13 @@ "fedora-Server-boot-iso-x86_64-*-64bit": 11, "fedora-Server-dvd-iso-x86_64-*-bios": 11, "fedora-Silverblue-dvd_ostree-iso-x86_64-*-bios": 51, - "fedora-Workstation-live-iso-x86_64-*-bios": 11 + "fedora-Workstation-live-iso-x86_64-*-bios": 11, + "fedora-Server-boot-iso-x86_64-*-64bit": 10, + "fedora-Server-boot-iso-x86_64-*-uefi": 11, + "fedora-Server-dvd-iso-x86_64-*-uefi": 11, + "fedora-Silverblue-dvd_ostree-iso-x86_64-*-uefi": 51, + "fedora-Workstation-live-iso-x86_64-*-uefi": 11, + "fedora-i3-live-x86_64-*-64bit": 10 }, "settings": { "PACKAGE_SET": "default", @@ -1669,7 +1726,8 @@ "fedora-Silverblue-dvd_ostree-iso-x86_64-*-64bit": 50, "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 10, "fedora-Workstation-live-iso-x86_64-*-64bit": 10, - "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 60 + "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 60, + "fedora-i3-live-x86_64-*-64bit": 20 }, "settings": { "PACKAGE_SET": "default", @@ -2512,7 +2570,8 @@ "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 60, "fedora-Workstation-upgrade-x86_64-*-64bit": 40, "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, - "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42 + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42, + "fedora-i3-live-x86_64-*-64bit": 50 }, "settings": { "BOOTFROM": "c", diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index 6d258943..dd91236f 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -5,6 +5,7 @@ use testapi; use utils; use tapnet; use anaconda; +use i3; sub _handle_incomplete_hub { if (match_has_tag "anaconda_main_hub_keyboard_layout_incomplete") { @@ -147,28 +148,31 @@ sub run { # on lives, we have to explicitly launch anaconda my $launched = 0; my $count = 5; - while ($count > 0) { - $count -= 1; - assert_screen ["live_start_anaconda_icon", "apps_menu_button_active", "next_button"], 300; - if (match_has_tag "next_button") { - # we're looking at gnome-initial-setup - this - # is what we expect on images that use anaconda - # webui, though as of 2024-08 it's disabled due - # to maintenance difficulty - # completing g-i-s launches the installer - gnome_initial_setup(live => 1); - $launched = 1; - } - 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; + # i3 got no real desktop, so we need to launch liveinst via the launcher + if (get_var('DESKTOP') eq 'i3') { + firstlaunch_setup(timeout => 300); + x11_start_program("liveinst"); + } else { + while ($count > 0) { + $count -= 1; + assert_screen ["live_start_anaconda_icon", "apps_menu_button_active", "next_button"], 300; + if (match_has_tag "next_button") { + # we're on F39+ Workstation and looking at gnome-initial-setup + # completing g-i-s launches the installer + gnome_initial_setup(live => 1); + $launched = 1; + } + 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; + } } } # if we hit the g-i-s flow we already launched diff --git a/tests/_graphical_wait_login.pm b/tests/_graphical_wait_login.pm index 264150ed..7baa20d3 100644 --- a/tests/_graphical_wait_login.pm +++ b/tests/_graphical_wait_login.pm @@ -2,6 +2,7 @@ use base "installedtest"; use strict; use testapi; use utils; +use i3; sub _enter_password { my $password = shift; @@ -102,6 +103,10 @@ sub run { desktop_vt; } + if (get_var("DESKTOP") eq 'i3') { + firstlaunch_setup(); + } + # Move the mouse somewhere it won't highlight the match areas and # hopefully won't negatively interact with anything else later mouse_set(1023, 384); diff --git a/tests/desktop_background.pm b/tests/desktop_background.pm index 2e57329c..3469a146 100644 --- a/tests/desktop_background.pm +++ b/tests/desktop_background.pm @@ -2,9 +2,21 @@ use base "installedtest"; use strict; use testapi; use utils; +use i3; sub run { - check_desktop; + if (!get_var("BOOTFROM")) { + # If we are checking the desktop background on live, we will not get + # _graphical_wait_login scheduled and need to boot ourselves. + # On i3, we'll also get the firstlaunch wizard on auto-login and need to + # ignore it for check_desktop. We then run the firstlaunch setup so that + # the wizard window does not block the desktop background. + do_bootloader(postinstall=>0); + check_desktop(timeout => 120, no_firstlaunch_check => 1); + firstlaunch_setup() if (get_var("DESKTOP") eq "i3"); + } else { + check_desktop; + } # If we want to check that there is a correct background used, as a part # of self identification test, we will do it here. For now we don't do # this for Rawhide as Rawhide doesn't have its own backgrounds and we diff --git a/tests/desktop_browser.pm b/tests/desktop_browser.pm index 523ac84d..c77da9c5 100644 --- a/tests/desktop_browser.pm +++ b/tests/desktop_browser.pm @@ -32,10 +32,15 @@ sub run { $self->root_console(tty => 3); disable_firefox_studies; desktop_vt; - send_key 'super'; - # wait out animations - wait_still_screen(stilltime => 4, similarity_level => 45); - assert_and_click 'browser_launcher'; + if (get_var("DESKTOP") eq "i3") { + x11_start_program("firefox"); + } + else { + send_key 'super'; + # wait out animations + wait_still_screen(stilltime=>4, similarity_level=>45); + assert_and_click 'browser_launcher'; + } unless (check_screen 'browser', 45) { if (check_screen 'browser', 45) { record_soft_failure "Browser start up is very slow - probably https://bugzilla.redhat.com/show_bug.cgi?id=2312900"; diff --git a/tests/desktop_login.pm b/tests/desktop_login.pm index bd8a126e..65eb242a 100644 --- a/tests/desktop_login.pm +++ b/tests/desktop_login.pm @@ -2,12 +2,15 @@ use base "installedtest"; use strict; use testapi; use utils; +use i3; our $desktop = get_var("DESKTOP"); our $syspwd = get_var("USER_PASSWORD") || "weakpassword"; our $term = "terminal"; if ($desktop eq "kde") { $term = "konsole"; +} elsif ($desktop eq "i3") { + $term = "i3-sensible-terminal"; } sub type_password { @@ -21,12 +24,12 @@ sub type_password { sub adduser { # Add user to the system. my %args = @_; - $args{termstop} //= 1; my $name = $args{name}; my $login = $args{login}; my $password = $args{password}; assert_script_run "useradd -c '$name' $login"; + assert_script_run "usermod -a -G dialout $login"; if ($password ne "askuser") { # If we want to create a user with a defined password. assert_script_run "echo '$login:$password' | chpasswd"; @@ -39,16 +42,34 @@ sub adduser { assert_script_run "chage --lastday 0 $login"; } assert_script_run "grep $login /etc/passwd"; + # Disable Gnome initial setup on accounts when testing + # inside Gnome. + if ($desktop eq "gnome") { + assert_script_run "mkdir /home/$login/.config"; + # gnome-initial-setup-done is obsolete from F34 onwards, can be removed after F33 EOL + assert_script_run "echo 'yes' >> /home/$login/.config/gnome-initial-setup-done"; + } + elsif ($desktop eq "i3") { + create_user_i3_config(login => $login); + } + + if ($desktop eq "gnome") { + assert_script_run "chown -R $login.$login /home/$login/.config"; + assert_script_run "restorecon -vr /home/$login/.config"; + } } sub lock_screen { - # Click on buttons to lock the screen. - #my $desktop = get_var("DESKTOP"); - assert_and_click "system_menu_button"; - if ($desktop eq "kde") { - assert_and_click "leave_button"; + if ($desktop eq "i3") { + x11_start_program("i3lock"); + } else { + # Click on buttons to lock the screen. + assert_and_click "system_menu_button"; + if ($desktop eq "kde") { + assert_and_click "leave_button"; + } + assert_and_click "lock_button"; } - assert_and_click "lock_button"; wait_still_screen 10; } @@ -61,14 +82,20 @@ sub login_user { my $user = $args{user}; my $password = $args{password}; my $method = $args{method}; - if ($method ne "unlock" && !check_screen "login_$user") { + if (!check_screen "login_$user" || ($desktop eq 'i3')) { # Sometimes, especially in SDDM, we do not get the user list # but rather a "screensaver" screen for the DM. If this is the # case, hit Escape to bring back the user list. + # We do want to skip this with lightdm though, as we would then deselect + # the password entry field send_key "esc"; wait_still_screen(stilltime => 5, similarity_level => 45); } if ($method ne "unlock") { + # on lightdm we have to open the drop down menu to get to the user selection + if (check_screen('lightdm_login_screen')) { + assert_and_click('lightdm_user_selection'); + } # When we do not just want to unlock the screen, we need to select a user. if (check_screen "login_$user", 30) { click_lastmatch; @@ -84,12 +111,20 @@ sub login_user { # of password typing. type_very_safely "$password\n"; } - type_very_safely "$password\n"; - check_desktop(timeout => 60) if ($args{checklogin}); - wait_still_screen(stilltime => 5, similarity_level => 45); if ($desktop eq "kde") { click_lastmatch if (check_screen "getting_started"); } + if (get_var('DESKTOP') ne 'i3') { + type_very_safely "$password\n"; + } + else { + # use essentially type_very_safely, but without wait_screen_change being + # set, because the i3lock screen does not change enough when typing a + # character and that just causes huge delays to unlock the screen + type_string("$password\n", max_interval => 1); + } + check_desktop(timeout => 60) if ($args{checklogin}); + wait_still_screen(stilltime => 5, similarity_level => 45); } sub check_user_logged_in { @@ -104,6 +139,13 @@ sub check_user_logged_in { menu_launch_type $term; wait_still_screen 2; $exitkey = "alt-f4"; + } elsif ($desktop eq "i3") { + my $mod = get_i3_modifier(); + send_key("$mod-ret"); + assert_screen("apps_run_terminal"); + assert_script_run('[ $(whoami) = "' . "$user\" ]"); + wait_screen_change { send_key("$mod-shift-q"); }; + return; } # With KDE, the user is shown in the main menu, so let us just # open this and see. @@ -117,13 +159,20 @@ sub check_user_logged_in { } sub logout_user { - # Do steps to log out the user to reach the login screen. - assert_and_click "system_menu_button"; - assert_and_click "leave_button"; - assert_and_click "log_out_entry"; - assert_and_click "log_out_confirm"; - wait_still_screen 5; - sleep 10; + if ($desktop eq "i3") { + my $mod = get_i3_modifier(); + send_key("$mod-shift-e"); + assert_and_click("i3-logout-bar"); + assert_screen("graphical_login_input"); + } else { + # Do steps to log out the user to reach the login screen. + assert_and_click "system_menu_button"; + assert_and_click "leave_button"; + assert_and_click "log_out_entry"; + assert_and_click "log_out_confirm"; + wait_still_screen 5; + sleep 10; + } } sub switch_user { @@ -146,28 +195,62 @@ sub switch_user { } } +sub reboot_system_i3 { + # we are still in i3 if the bar is visible + if (check_screen('i3-bar')) { + logout_user(); + } + assert_and_click('lightdm_power_menu'); + assert_and_click('lightdm_power_menu-reboot'); + assert_and_click('lightdm_power_menu-reboot-confirm'); + boot_to_login_screen(); +} + sub reboot_system { - # Reboots the system and handles everything until the next login screen. - assert_and_click "system_menu_button"; - # In KDE the reboot entry is right here, on GNOME we need to - # enter some kind of power option submenu. - assert_screen ["power_entry", "reboot_entry"]; - click_lastmatch; - assert_and_click "reboot_entry" if (match_has_tag("power_entry")); - assert_and_click "restart_confirm"; + if ($desktop eq 'i3') { + reboot_system_i3(); + return; + } + + # Reboots the system and handles everything until the next GDM screen. + if (check_screen "system_menu_button") { + # In a logged in desktop, we access power options through system menu + assert_and_click "system_menu_button"; + # In KDE since F34, reboot entry is right here, otherwise we need to + # enter some kind of power option submenu + assert_screen ["power_entry", "reboot_entry"]; + click_lastmatch; + assert_and_click "reboot_entry" if (match_has_tag("power_entry")); + assert_and_click "restart_confirm"; + } + # When we are outside KDE (not logged in), the only way to reboot is to click + # the reboot icon. + else { + assert_and_click "reboot_icon"; + } boot_to_login_screen(); } sub power_off { # Powers-off the machine. - assert_and_click "system_menu_button"; - # in KDE, there's no submenu to access, the button is right here, - # in GNOME we need the submenu - assert_screen ["power_entry", "power_off_entry"]; - click_lastmatch; - assert_and_click "power_off_entry" if (match_has_tag("power_entry")); - assert_and_click "power_off_confirm"; - assert_shutdown 120; + if (get_var('DESKTOP') eq 'i3') { + # we are still in i3 if the bar is visible + if (check_screen('i3-bar')) { + logout_user(); + } + assert_screen('lightdm_login_screen'); + send_key('alt-f4'); + assert_and_click('lightdm_power_menu-shutdown-confirm'); + } + else { + assert_and_click "system_menu_button"; + # in KDE since F34, there's no submenu to access, the button is right here + assert_screen ["power_entry", "power_off_entry"]; + click_lastmatch; + assert_and_click "power_off_entry" if (match_has_tag("power_entry")); + assert_and_click "power_off_confirm"; + } + assert_shutdown; } sub run { @@ -237,8 +320,19 @@ sub run { reboot_system(); # Try to log in with either account, intentionally entering the wrong password. - login_user(user => "jack", password => "wrongpassword", checklogin => 0); - # get back to the login screen if necessary (dismiss an error message) + login_user(user=>"jack", password=>"wrongpassword", checklogin=>0); + my $relnum = get_release_number; + if (($desktop eq "gnome" && $relnum < 34) || $desktop eq 'i3') { + # In GDM before F34 or lightdm (used by i3), a message is shown about an + # unsuccessful login and it can be asserted, so let's do it. In SDDM and + # GDM F34+, there is also a message, but it is only displayed for a + # short moment and the assertion fails here, so we will skip the + # assertion. Not being able to login in with a wrong password is enough + # here. + assert_screen "login_wrong_password"; + # don't send escape in lightdm, it does nothing there + send_key 'esc' unless $desktop eq 'i3'; + } send_key 'esc' unless (check_screen "login_jim"); # Now, log into the system again using the correct password. This will diff --git a/tests/desktop_notifications.pm b/tests/desktop_notifications.pm index 012b22f4..4430ba10 100644 --- a/tests/desktop_notifications.pm +++ b/tests/desktop_notifications.pm @@ -3,6 +3,7 @@ use strict; use testapi; use utils; use packagetest; +use i3; # This test sort of covers QA:Testcase_desktop_update_notification # and QA:Testcase_desktop_error_checks . If it fails, probably *one* @@ -27,6 +28,7 @@ sub run { $self->root_console(tty => 1); # ensure we actually have some package updates available prepare_test_packages; + my $user = get_var('USER_LOGIN', 'test'); if ($desktop eq 'gnome') { # On GNOME, move the clock forward if needed, because it won't # check for updates before 6am(!) @@ -47,7 +49,7 @@ sub run { my $longago = $now - 14 * 24 * 60 * 60; # have to log in as the user to do this script_run 'exit', 0; - console_login(user => get_var('USER_LOGIN', 'test'), password => get_var('USER_PASSWORD', 'weakpassword')); + console_login(user=>$user, password=>get_var('USER_PASSWORD', 'weakpassword')); script_run "gsettings set org.gnome.software check-timestamp ${yyday}", 0; script_run "gsettings set org.gnome.software update-notification-timestamp ${longago}", 0; script_run "gsettings set org.gnome.software online-updates-timestamp ${longago}", 0; @@ -57,6 +59,14 @@ sub run { script_run 'exit', 0; console_login(user => 'root', password => get_var('ROOT_PASSWORD', 'weakpassword')); } + } elsif ($desktop eq 'i3') { + assert_script_run('dnf install -y libnotify'); + my $target_user = get_var("USER_LOGIN"); + if (!defined(get_var("BOOTFROM"))) { + $target_user = "liveuser"; + } + assert_script_run("usermod -a -G dialout $target_user"); + create_user_i3_config(login => $target_user); } if ($desktop eq 'kde' && get_var("BOOTFROM")) { # need to login as user for this @@ -121,6 +131,21 @@ sub run { click_lastmatch; } } + if ($desktop eq 'i3') { + # we launch a terminal so that the top of the screen is filled with + # something that we know and can check that it is not covered by a + # notification popup from dunst + send_key(get_i3_modifier() . '-ret'); + assert_screen("apps_run_terminal"); + assert_script_run('notify-send -t 5000 "foo"'); + assert_screen("i3_dunst_foo_notification", timeout => 5); + + sleep 6; + assert_screen("i3_dunst_no_notification"); + + # we quit at this point as the i3 spin has no desktop update notifier + return; + } if (get_var("BOOTFROM")) { # we should see an update notification and no others assert_screen "desktop_update_notification_only"; diff --git a/tests/desktop_printing.pm b/tests/desktop_printing.pm index a24fc9e1..f5130885 100644 --- a/tests/desktop_printing.pm +++ b/tests/desktop_printing.pm @@ -2,6 +2,7 @@ use base "installedtest"; use strict; use testapi; use utils; +use i3; sub run { my $self = shift; @@ -19,8 +20,13 @@ sub run { # If the test should be running with CUPS-PDF, we need to install it first. if ($usecups) { + my $pkgs = "cups-pdf"; + # On I3, we also need to install the PDF reader. + if ($desktop eq "i3") { + $pkgs = $pkgs . " mupdf"; + } # Install the Cups-PDF package to use the Cups-PDF printer - assert_script_run "dnf -y install cups-pdf", 180; + assert_script_run "dnf -y install $pkgs", 240; } # Here, we were doing a version logic. This is no longer needed, because @@ -32,6 +38,21 @@ sub run { # Verification commands need serial console to be writable and readable for # normal users, let's make it writable then. script_run("chmod 666 /dev/${serialdev}"); + # Check whether the cups-pdf printer is actually present on the system + # FIXME: If it is missing, add it manually by removing and installing + # cups-pdf again + my $cups_pdf_present = script_run('lpstat -t|grep -q -i cups-pdf'); + if ($cups_pdf_present != 0) { + record_soft_failure 'Cups-PDF printer is not present on the system (rhbz#1984295)'; + assert_script_run "dnf -y remove cups-pdf", 180; + assert_script_run "dnf -y install cups-pdf", 180; + } + # FIXME: log version of cups-pdf and check it for output location + # this is only necessary as long as the test may run on cups-pdf + # 3.0.1-11 or lower, as soon as that's not true we can cut it + my $cpdfver = script_output 'rpm -q cups-pdf --queryformat "%{VERSION}-%{RELEASE}\n"'; + assert_script_run "dnf -y install rpmdevtools", 180; + my $cpdfvercmp = script_run "rpmdev-vercmp $cpdfver 3.0.1-11.5"; # Leave the root terminal and switch back to desktop for the rest of the test. desktop_vt(); @@ -48,6 +69,11 @@ sub run { $maximize = "super-pgup"; $term = "konsole"; } + elsif ($desktop eq "i3") { + $editor = "mousepad"; + $viewer = "mupdf"; + $maximize = undef; + } # give the desktop a few seconds to settle, we seem to be getting # a lot of mis-types in KDE if we do not, as of 2024-02 @@ -58,18 +84,27 @@ sub run { } # Let's open the terminal. We will use it to start the applications # as well as to check for the name of the printed file. - menu_launch_type($term); - wait_still_screen(5); + unless ($desktop eq "i3") { + menu_launch_type($term); + wait_still_screen(5); + } + else { + launch_terminal; + # switch to tabbed mode + send_key(get_i3_modifier() . "-w"); + } # Open the text editor and maximize it. wait_screen_change { type_very_safely "$editor /home/test/testfile.txt &\n"; }; wait_still_screen(stilltime => 2, similarity_level => 45); - wait_screen_change { send_key($maximize); }; - wait_still_screen(stilltime => 2, similarity_level => 45); + unless ($desktop eq "i3") { + wait_screen_change { send_key($maximize); }; + wait_still_screen(stilltime => 2, similarity_level => 45); + } # Print the file using one of the available methods send_key "ctrl-p"; - wait_still_screen(stilltime => 3, similarity_level => 45); + wait_still_screen(stilltime => 5, similarity_level => 45); # We will select the printing method # In case of KDE, we will need to select the printer first. if ($desktop eq "kde") { @@ -95,7 +130,28 @@ sub run { } else { # Exit the application - send_key "alt-f4"; + send_key "alt-f4" unless $desktop eq "i3"; + } + + # Open the pdf file and check the print + if ($desktop eq "i3") { + launch_terminal; + } else { + send_key "alt-f2"; + wait_still_screen(stilltime=>5, similarity_level=>45); + } + # output location is different for cups-pdf 3.0.1-12 or later (we + # checked this above) + if ($cpdfvercmp eq "12") { + # older cups-pdf + type_safely "$viewer /home/$user/Desktop/testfile.pdf\n"; + } + elsif ($editor eq "mousepad") { + # mousepad creates relatively weird pdf names, so we use a wildcard here + type_safely "$viewer /home/$user/" . 'Mousepad*job_1.pdf' . "\n"; + } + else { + type_safely "$viewer /home/$user/Desktop/testfile-job_1.pdf\n"; } # Get the name of the printed file. The path location depends @@ -121,9 +177,9 @@ sub run { wait_still_screen(stilltime => 3, similarity_level => 45); # Resize the window, so that the size of the document fits the bigger space # and gets more readable. - send_key $maximize; - wait_still_screen(stilltime => 2, similarity_level => 45); - # in KDE, make sure we're at the start of the document + send_key $maximize unless !defined($maximize); + wait_still_screen(stilltime=>2, similarity_level=>45); + # make sure we're at the start of the document send_key "ctrl-home" if ($desktop eq "kde"); # Check the printed pdf. assert_screen "printing_check_sentence"; diff --git a/tests/i3_tilling.pm b/tests/i3_tilling.pm new file mode 100644 index 00000000..79a7c958 --- /dev/null +++ b/tests/i3_tilling.pm @@ -0,0 +1,46 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; +use i3; + + +sub run { + my $desktop = get_var("DESKTOP"); + my $mod = get_i3_modifier(); + die "This test is only for the i3 desktop" unless $desktop eq "i3"; + + # launch a terminal first + send_key("$mod-ret"); + assert_screen("apps_run_terminal"); + + # start pavucontrol, mousepad and check that they are split on the screen + x11_start_program("pavucontrol"); + x11_start_program("mousepad"); + assert_screen("i3_windows_split"); + + # switch to tabbed layout + send_key("$mod-w"); + assert_screen("i3_windows_tabbed"); + send_key_until_needlematch("apps_run_terminal", "$mod-j"); + + send_key("$mod-;"); + assert_screen("audio_mixer"); + + send_key("$mod-;"); + assert_screen("mousepad_no_document_open"); + + # switch to stacked layout + send_key("$mod-s"); + assert_screen("i3_windows_stacked"); + + send_key_until_needlematch("apps_run_terminal", "$mod-k"); + + send_key("$mod-l"); + assert_screen("mousepad_no_document_open"); + + send_key("$mod-l"); + assert_screen("audio_mixer"); +} + +1;