os-autoinst-distri-rocky/tests/anaconda_help.pm
Trevor Cooper 049f5f4ba2
Add needles and code to complete anaconda_help test suite ()
* remove conflicting/incorrect needles

* mods for ananonda_help test suite
- support Rocky help content in anaconda.pm

* workaround software_selection failure

* add needles for anaconda_help
2022-02-03 18:25:03 -06:00

87 lines
3.2 KiB
Perl

use base "anacondatest";
use strict;
use lockapi;
use testapi;
use utils;
use anaconda;
sub run {
# This test tests that Anaconda is able to show help for particular Anaconda screens.
# It opens various Anaconda panes, clicks on Help button, and checks that correct
# Help content is shown for that pane.
#
# Although this test performs Anaconda routines and it only partly performs the installation,
# therefore it is NOT to be considered an *installation test*.
#
# This tests should run after the _boot_to_anaconda test. Which should take us to Anaconda
# main hub.
# Now, we should be on Anaconda Main hub, but the hub differs for various
# installation media. For each such media (ServerDVD, WS Live, KDE Live),
# we create a tailored test plan.
#
# At first, we check for the main hub help.
check_help_on_pane("main");
# Create test plans
my @testplan;
# For Rocky ISO
if ((get_var('DISTRI') eq "Rocky")) {
@testplan = qw/keyboard_layout language_support time_date installation_source select_packages install_destination network_host_name root_password create_user/;
}
# While technically we don't need any of these Fedora test plans it's worth
# leaving them here for now as examples.
# For LIVE KDE:
elsif ((get_var('LIVE')) && (get_var('DESKTOP') eq "kde")) {
@testplan = qw/keyboard_layout time_date install_destination network_host_name root_password create_user/;
}
# For LIVE Workstation
elsif ((get_var('LIVE')) && (get_var('DESKTOP') eq "gnome")) {
@testplan = qw/keyboard_layout install_destination time_date/;
}
# For Silverblue
elsif (get_var('DESKTOP') eq "gnome") {
@testplan = qw/keyboard_layout language_support install_destination time_date/;
}
# For ServerDVD
else {
@testplan = qw/keyboard_layout language_support time_date installation_source select_packages install_destination network_host_name root_password create_user/;
}
# Iterate over test plan and do the tests.
foreach (@testplan) {
check_help_on_pane($_);
}
# Now, we will start the installation.
# on GNOME installs (Workstation Live and Silverblue) we don't
# need to set a root password or create a user; on other flavors
# we must
unless (get_var("DESKTOP") eq "gnome" ) {
# In Rocky ISO you will finish testplan on Create User and need to shift-tab to select
# Root password
if ((get_var("DISTRI") eq "rocky" )) {
send_key_until_needlematch("anaconda_main_hub_root_password", "shift-tab");
}
assert_and_click "anaconda_main_hub_root_password";
type_safely "weakrootpassword";
send_key "tab";
type_safely "weakrootpassword";
wait_screen_change { assert_and_click "anaconda_spoke_done"; };
}
# Begin installation after waiting out animation
wait_still_screen 5;
wait_screen_change { assert_and_click "anaconda_main_hub_begin_installation"; };
# Check the last Help screen
unless (get_var("DISTRI") eq "rocky") {
check_help_on_pane("installation_progress");
}
# As there is no need to proceed with the installation,
# the test ends here and the VM will be destroyed
# after some short time.
}
1;