diff --git a/lib/utils.pm b/lib/utils.pm index 5bb599f9..6c9c31d4 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -715,6 +715,7 @@ sub gnome_initial_setup { # mode (when user was created during install) my %args = ( prelogin => 0, + live => 0, timeout => 120, @_ ); @@ -729,18 +730,38 @@ sub gnome_initial_setup { my @nexts = ('language', 'keyboard', 'privacy', 'timezone', 'software'); # now, we're going to figure out how many of them this test will # *actually* see... + if ($args{live}) { + # this is the flow we see when booting an F39+ Workstation live + # we only get language and keyboard + @nexts = ('language', 'keyboard') + } if ($args{prelogin}) { - # 'language', 'keyboard' and 'timezone' are skipped on F28+ in - # the 'new user' mode by + # 'language', 'keyboard' and 'timezone' were skipped between F28 + # and F38 in the 'new user' mode by # https://fedoraproject.org//wiki/Changes/ReduceInitialSetupRedundancy # https://bugzilla.redhat.com/show_bug.cgi?id=1474787 , - # except 'language' is never *really* skipped (see above) - @nexts = grep { $_ ne 'keyboard' } @nexts; - @nexts = grep { $_ ne 'timezone' } @nexts; + # except 'language' was never *really* skipped (see above) + # From gnome-initial-setup 45~beta-3 on, these screens aren't + # skipped in vendor.conf. They should be skipped for live + # installs because they were shown preinstall on the new webUI + # workflow, but this is broken till + # https://github.com/rhinstaller/anaconda/pull/5056 is merged. + # network installs and disk image deployments will show these + # screens (which is good for disk image deployments, but + # redundant for network installs) + # FIXME make this conditional version-based after the anaconda + # updates land and g-i-s is tagged again. modify it to drop + # the pages on F39+ live installs once the anaconda PR is + # merged or addressed some other way + my $advortask = get_var("ADVISORY_OR_TASK"); + unless ($advortask eq "FEDORA-2023-80c0846ede" || $advortask eq "FEDORA-2023-3172dea90a") { + @nexts = grep { $_ ne 'keyboard' } @nexts; + @nexts = grep { $_ ne 'timezone' } @nexts; + } } else { # 'timezone' and 'software' are suppressed for the 'existing user' - # form of g-i-s + # form of g-i-s (upstream, not in vendor.conf) @nexts = grep { $_ ne 'software' } @nexts; @nexts = grep { $_ ne 'timezone' } @nexts; } @@ -767,23 +788,35 @@ sub gnome_initial_setup { } # GDM 3.24.1 dumps a cursor in the middle of the screen here... mouse_hide if ($args{prelogin}); - for my $n (1 .. scalar(@nexts)) { + foreach my $next (@nexts) { # click 'Next' $nexts times, moving the mouse to avoid # highlight problems, sleeping to give it time to get # to the next screen between clicks mouse_set(100, 100); - if ($n == 1) { + if ($next eq 'language') { # only accept start_setup one time, to avoid matching # on it during transition to next screen. also accept # next_button as in per-user mode, first screen has that # not start_setup wait_screen_change { assert_and_click ["next_button", "start_setup"]; }; } + elsif ($next eq 'timezone') { + assert_screen ["next_button", "next_button_inactive"]; + if (match_has_tag "next_button_inactive") { + record_soft_failure "geolocation failed!"; + send_key "tab"; + wait_still_screen 3; + type_very_safely "washington-d"; + send_key "down"; + send_key "ret"; + } + wait_screen_change { assert_and_click "next_button"; }; + } else { wait_screen_change { assert_and_click "next_button"; }; } } - unless (get_var("VNC_CLIENT")) { + unless (get_var("VNC_CLIENT") || $args{live}) { # We should be at the GOA screen, except on VNC_CLIENT case # where network isn't working yet. click 'Skip' one time. If # it's not visible we may have hit @@ -797,7 +830,10 @@ sub gnome_initial_setup { record_soft_failure "GOA screen not seen! Likely RHBZ #1997310"; } } + # on the 'live' flow, this will launch the installer send_key "ret"; + # we don't want to do anything further on the 'live' flow + return if ($args{live}); if ($args{prelogin}) { # create user my $user_login = get_var("USER_LOGIN") || "test"; diff --git a/needles/anaconda/identification/version_39-webui-20230821.json b/needles/anaconda/identification/version_39-webui-20230821.json new file mode 100644 index 00000000..c63ead27 --- /dev/null +++ b/needles/anaconda/identification/version_39-webui-20230821.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "width": 177, + "height": 28, + "ypos": 92, + "type": "match", + "xpos": 14 + } + ], + "properties": [], + "tags": [ + "version_39_ident" + ] +} \ No newline at end of file diff --git a/needles/anaconda/identification/version_39-webui-20230821.png b/needles/anaconda/identification/version_39-webui-20230821.png new file mode 100644 index 00000000..a91953d0 Binary files /dev/null and b/needles/anaconda/identification/version_39-webui-20230821.png differ diff --git a/needles/anaconda/webui/install_done-webui-quit-20230821.json b/needles/anaconda/webui/install_done-webui-quit-20230821.json new file mode 100644 index 00000000..ba79b308 --- /dev/null +++ b/needles/anaconda/webui/install_done-webui-quit-20230821.json @@ -0,0 +1,24 @@ +{ + "area": [ + { + "type": "match", + "xpos": 483, + "width": 58, + "height": 58, + "ypos": 186 + }, + { + "xpos": 496, + "type": "match", + "height": 17, + "ypos": 378, + "width": 35 + } + ], + "properties": [], + "tags": [ + "anaconda_install_done", + "ENV-DISTRI-fedora", + "LANGUAGE-english" + ] +} \ No newline at end of file diff --git a/needles/anaconda/webui/install_done-webui-quit-20230821.png b/needles/anaconda/webui/install_done-webui-quit-20230821.png new file mode 100644 index 00000000..640034de Binary files /dev/null and b/needles/anaconda/webui/install_done-webui-quit-20230821.png differ diff --git a/needles/anaconda/webui/install_done-webui-quit-small-20230822.json b/needles/anaconda/webui/install_done-webui-quit-small-20230822.json new file mode 100644 index 00000000..dc58f03f --- /dev/null +++ b/needles/anaconda/webui/install_done-webui-quit-small-20230822.json @@ -0,0 +1,24 @@ +{ + "area": [ + { + "height": 58, + "ypos": 198, + "width": 58, + "xpos": 480, + "type": "match" + }, + { + "xpos": 492, + "type": "match", + "width": 35, + "height": 17, + "ypos": 390 + } + ], + "properties": [], + "tags": [ + "anaconda_install_done", + "ENV-DISTRI-fedora", + "LANGUAGE-english" + ] +} \ No newline at end of file diff --git a/needles/anaconda/webui/install_done-webui-quit-small-20230822.png b/needles/anaconda/webui/install_done-webui-quit-small-20230822.png new file mode 100644 index 00000000..63583abf Binary files /dev/null and b/needles/anaconda/webui/install_done-webui-quit-small-20230822.png differ diff --git a/needles/anaconda/webui/select_disk_1-webui-20230821.json b/needles/anaconda/webui/select_disk_1-webui-20230821.json new file mode 100644 index 00000000..490fbd24 --- /dev/null +++ b/needles/anaconda/webui/select_disk_1-webui-20230821.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 280, + "ypos": 309, + "width": 30, + "height": 17, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_install_destination_select_disk_1" + ] +} \ No newline at end of file diff --git a/needles/anaconda/webui/select_disk_1-webui-20230821.png b/needles/anaconda/webui/select_disk_1-webui-20230821.png new file mode 100644 index 00000000..93217e16 Binary files /dev/null and b/needles/anaconda/webui/select_disk_1-webui-20230821.png differ diff --git a/needles/anaconda/webui/webui_begin_installation-20230821.json b/needles/anaconda/webui/webui_begin_installation-20230821.json new file mode 100644 index 00000000..0b2fc952 --- /dev/null +++ b/needles/anaconda/webui/webui_begin_installation-20230821.json @@ -0,0 +1,17 @@ +{ + "area": [ + { + "height": 17, + "ypos": 727, + "width": 154, + "type": "match", + "xpos": 363 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-fedora", + "LANGUAGE-english", + "anaconda_webui_begin_installation" + ] +} \ No newline at end of file diff --git a/needles/anaconda/webui/webui_begin_installation-20230821.png b/needles/anaconda/webui/webui_begin_installation-20230821.png new file mode 100644 index 00000000..c843fc97 Binary files /dev/null and b/needles/anaconda/webui/webui_begin_installation-20230821.png differ diff --git a/needles/anaconda/webui/webui_confirm_installation-20230821.json b/needles/anaconda/webui/webui_confirm_installation-20230821.json new file mode 100644 index 00000000..3b2c13ab --- /dev/null +++ b/needles/anaconda/webui/webui_confirm_installation-20230821.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 270, + "ypos": 472, + "width": 154, + "height": 17, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_webui_confirm_installation" + ] +} \ No newline at end of file diff --git a/needles/anaconda/webui/webui_confirm_installation-20230821.png b/needles/anaconda/webui/webui_confirm_installation-20230821.png new file mode 100644 index 00000000..71f3a31b Binary files /dev/null and b/needles/anaconda/webui/webui_confirm_installation-20230821.png differ diff --git a/needles/anaconda/webui/webui_confirm_installation-alt-20230821.json b/needles/anaconda/webui/webui_confirm_installation-alt-20230821.json new file mode 100644 index 00000000..7b382cd3 --- /dev/null +++ b/needles/anaconda/webui/webui_confirm_installation-alt-20230821.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "type": "match", + "xpos": 266, + "ypos": 463, + "height": 17, + "width": 154 + } + ], + "properties": [], + "tags": [ + "anaconda_webui_confirm_installation" + ] +} \ No newline at end of file diff --git a/needles/anaconda/webui/webui_confirm_installation-alt-20230821.png b/needles/anaconda/webui/webui_confirm_installation-alt-20230821.png new file mode 100644 index 00000000..e1564ee7 Binary files /dev/null and b/needles/anaconda/webui/webui_confirm_installation-alt-20230821.png differ diff --git a/needles/anaconda/webui/webui_disk_select-20230821.json b/needles/anaconda/webui/webui_disk_select-20230821.json new file mode 100644 index 00000000..7b7438a1 --- /dev/null +++ b/needles/anaconda/webui/webui_disk_select-20230821.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 602, + "ypos": 258, + "width": 21, + "height": 37, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_webui_disk_select" + ] +} \ No newline at end of file diff --git a/needles/anaconda/webui/webui_disk_select-20230821.png b/needles/anaconda/webui/webui_disk_select-20230821.png new file mode 100644 index 00000000..84d87ac0 Binary files /dev/null and b/needles/anaconda/webui/webui_disk_select-20230821.png differ diff --git a/needles/anaconda/webui/webui_next-20230821.json b/needles/anaconda/webui/webui_next-20230821.json new file mode 100644 index 00000000..2b7c3ad0 --- /dev/null +++ b/needles/anaconda/webui/webui_next-20230821.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 363, + "ypos": 724, + "width": 40, + "height": 20, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_webui_next" + ] +} \ No newline at end of file diff --git a/needles/anaconda/webui/webui_next-20230821.png b/needles/anaconda/webui/webui_next-20230821.png new file mode 100644 index 00000000..135606ca Binary files /dev/null and b/needles/anaconda/webui/webui_next-20230821.png differ diff --git a/needles/anaconda/webui/webui_welcome-20230821.json b/needles/anaconda/webui/webui_welcome-20230821.json new file mode 100644 index 00000000..80836dda --- /dev/null +++ b/needles/anaconda/webui/webui_welcome-20230821.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 264, + "ypos": 158, + "width": 311, + "height": 25, + "type": "match" + } + ], + "properties": [], + "tags": [ + "anaconda_webui_welcome" + ] +} \ No newline at end of file diff --git a/needles/anaconda/webui/webui_welcome-20230821.png b/needles/anaconda/webui/webui_welcome-20230821.png new file mode 100644 index 00000000..84d87ac0 Binary files /dev/null and b/needles/anaconda/webui/webui_welcome-20230821.png differ diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index e481eb26..351d212f 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -117,10 +117,17 @@ sub run { send_key "ret"; } # 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"], 300; + 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 @@ -133,20 +140,31 @@ sub run { last; } } - # for KDE we need to double-click - my $relnum = get_release_number; - my $dclick = 0; - $dclick = 1 if (get_var("DESKTOP") eq "kde"); - assert_and_click("live_start_anaconda_icon", dclick => $dclick); - unless (check_screen "anaconda_select_install_lang", 180) { - # click it again - on KDE since 2019-10 or so it seems - # like the first attempt sometimes just doesn't work - assert_and_click("live_start_anaconda_icon", dclick => $dclick, timeout => 300); + # if we hit the g-i-s flow we already launched + unless ($launched) { + # for KDE we need to double-click + my $relnum = get_release_number; + my $dclick = 0; + $dclick = 1 if (get_var("DESKTOP") eq "kde"); + assert_and_click("live_start_anaconda_icon", dclick => $dclick); + unless (check_screen "anaconda_select_install_lang", 180) { + # click it again - on KDE since 2019-10 or so it seems + # like the first attempt sometimes just doesn't work + assert_and_click("live_start_anaconda_icon", dclick => $dclick, timeout => 300); + } } } + # wait for anaconda to appear + assert_screen ["anaconda_select_install_lang", "anaconda_webui_welcome"], 300; + # on webUI path we are done now, also set a var so later + # tests know if we're on the webUI path + if (match_has_tag "anaconda_webui_welcome") { + set_var("_ANACONDA_WEBUI", 1); + return; + } + # we click to work around RHBZ #1566066 if it happens + click_lastmatch; my $language = get_var('LANGUAGE') || 'english'; - # wait for anaconda to appear; we click to work around - # RHBZ #1566066 if it happens assert_and_click("anaconda_select_install_lang", timeout => 300); # Select install language diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index 9af2d50f..39e0cf96 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -55,6 +55,7 @@ sub _do_root_and_user { sub run { my $self = shift; + my $webui = 0; # From F31 onwards (after Fedora-Rawhide-20190722.n.1), user and # root password spokes are moved to main hub, so we must do those # before we run the install. @@ -63,9 +64,13 @@ sub run { # Sometimes, the 'slide in from the top' animation messes with # this - by the time we click the button isn't where it was any # more. So wait for screen to stop moving before we click. - assert_screen "anaconda_main_hub_begin_installation", 90; + assert_screen ["anaconda_main_hub_begin_installation", "anaconda_webui_begin_installation"], 90; wait_still_screen 5; - assert_and_click "anaconda_main_hub_begin_installation"; + assert_and_click ["anaconda_main_hub_begin_installation", "anaconda_webui_begin_installation"]; + if (match_has_tag "anaconda_webui_begin_installation") { + $webui = 1; + assert_and_click "anaconda_webui_confirm_installation"; + } # If we want to test identification we will do it # on several places in this procedure, such as @@ -74,7 +79,7 @@ sub run { my $identification = get_var('IDENTIFICATION'); my $branched = get_var('VERSION'); if ($identification eq 'true' or ($branched ne "Rawhide" && $branched ne "ELN")) { - check_left_bar(); + check_left_bar() unless ($webui); check_prerelease(); check_version(); } @@ -105,7 +110,8 @@ sub run { wait_still_screen 3; # if this is a live install, let's go ahead and quit the installer # in all cases, just to make sure quitting doesn't crash etc. - assert_and_click "anaconda_install_done" if (get_var('LIVE')); + # not on web UI, as it immediately reboots + assert_and_click "anaconda_install_done" if (get_var('LIVE') && !$webui); # there are various things we might have to do at a console here # before we actually reboot. let's figure them all out first... my @actions; @@ -120,9 +126,10 @@ sub run { } } # memcheck test doesn't need to reboot at all. Rebooting from GUI - # for lives is unreliable. And if we're already doing something + # for no-webUI lives is unreliable (webUI lives reboot on "Quit" + # just like non-lives). And if we're already doing something # else at a console, we may as well reboot from there too - push(@actions, 'reboot') if (!get_var("MEMCHECK") && (get_var("LIVE") || @actions)); + push(@actions, 'reboot') if (!get_var("MEMCHECK") && ((get_var("LIVE") && !$webui) || @actions)); # our approach for taking all these actions doesn't work on VNC # installs, fortunately we don't need any of them in that case # yet, so for now let's just flush the list here if we're VNC diff --git a/tests/_software_selection.pm b/tests/_software_selection.pm index 53d032f6..22a9c94a 100644 --- a/tests/_software_selection.pm +++ b/tests/_software_selection.pm @@ -4,8 +4,6 @@ use testapi; sub run { my $self = shift; - # Anaconda hub - assert_screen "anaconda_main_hub", 300; # Select package set. Minimal is the default, if 'default' is specified, skip selection, # but verify correct default in some cases diff --git a/tests/disk_guided_empty.pm b/tests/disk_guided_empty.pm index 8b60fb70..a374418a 100644 --- a/tests/disk_guided_empty.pm +++ b/tests/disk_guided_empty.pm @@ -9,9 +9,26 @@ sub run { # If we want to test graphics during installation, we need to # call the test suite with an "IDENTIFICATION=true" variable. my $identification = get_var('IDENTIFICATION'); - # Anaconda hub - # Go to INSTALLATION DESTINATION and ensure one disk is selected. - select_disks(); + assert_screen ["anaconda_main_hub", "anaconda_webui_welcome"]; + if (match_has_tag "anaconda_webui_welcome") { + # long term we'll want two paths through select_disks or + # a webui_select_disks, but for now, just throw it in here + # as it's simple on this single path + assert_and_click "anaconda_webui_disk_select"; + assert_and_click "anaconda_install_destination_select_disk_1"; + # assume default selection is the appropriate one; if it + # isn't, we'll fail soon enough + wait_screen_change { assert_and_click "anaconda_webui_next"; }; + wait_still_screen 3; + # click through the 'encrypt my data' screen + assert_and_click "anaconda_webui_next"; + # for now, skip the self-identification checks + return; + } + else { + # Go to INSTALLATION DESTINATION and ensure one disk is selected. + select_disks(); + } # updates.img tests work by changing the appearance of the INSTALLATION # DESTINATION screen, so check that if needed.