1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-11 09:24:21 +00:00

Initial anaconda webUI support

This is tailored to the initial deployment of webUI in
Workstation live images only; we may need to tweak flows and
approaches as webUI goes further.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2023-08-21 15:32:08 -07:00
parent 8a03a9b546
commit ec5bab0176
27 changed files with 291 additions and 32 deletions

View File

@ -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,35 @@ 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 modify this to drop the pages on F39+ live installs
# once the anaconda PR is merged or addressed some other way
if ($relnum < 40) {
@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 +785,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 +827,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";

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 177,
"height": 28,
"ypos": 92,
"type": "match",
"xpos": 14
}
],
"properties": [],
"tags": [
"version_39_ident"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 280,
"ypos": 309,
"width": 30,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_install_destination_select_disk_1"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 270,
"ypos": 472,
"width": 154,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_confirm_installation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"type": "match",
"xpos": 266,
"ypos": 463,
"height": 17,
"width": 154
}
],
"properties": [],
"tags": [
"anaconda_webui_confirm_installation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 602,
"ypos": 258,
"width": 21,
"height": 37,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_disk_select"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 363,
"ypos": 724,
"width": 40,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_next"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 264,
"ypos": 158,
"width": 311,
"height": 25,
"type": "match"
}
],
"properties": [],
"tags": [
"anaconda_webui_welcome"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"ypos": 43,
"height": 25,
"xpos": 958,
"type": "match",
"width": 55
}
],
"properties": [],
"tags": [
"LANGUAGE-english",
"next_button_inactive"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View File

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

View File

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

View File

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

View File

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