Add screen checking
All checks were successful
CI via Tox and perl / tox (pull_request) Successful in 1m55s
CI via Tox and perl / perl (pull_request) Successful in 4m22s
CI via Tox and perl / checkwiki (pull_request) Successful in 37s
AI Code Review / ai-review (pull_request_target) Successful in 29s

This commit is contained in:
Lukáš Růžička 2026-04-27 14:10:28 +02:00
commit b60b5ba570
29 changed files with 284 additions and 22 deletions

View file

@ -373,7 +373,7 @@ sub console_loadkeys_us {
elsif (get_var('LANGUAGE') eq 'japanese' || get_var('LANGUAGE') eq 'turkish') {
script_run "loadkeys us", 0;
}
elsif (get_var('LANGUAGE') eq 'czech' || get_var('LAYOUT') eq 'czech')) {
elsif (get_var('LANGUAGE') eq 'czech' || get_var('LAYOUT') eq 'czech') {
script_run('loadkezs us', 0);
}
wait_still_screen(3);

View file

@ -0,0 +1,19 @@
{
"area": [
{
"width": 234,
"type": "match",
"height": 21,
"ypos": 291,
"xpos": 395,
"click_point": {
"xpos": 117,
"ypos": 10.5
}
}
],
"properties": [],
"tags": [
"gis_button_enable_thirdparty"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 423,
"ypos": 547,
"width": 182,
"type": "match",
"height": 20
}
],
"properties": [],
"tags": [
"gis_button_start_fedora"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,19 @@
{
"area": [
{
"xpos": 460,
"ypos": 667,
"width": 106,
"height": 27,
"type": "match",
"click_point": {
"xpos": 53,
"ypos": 13.5
}
}
],
"properties": [],
"tags": [
"gis_button_start_setup"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View file

@ -0,0 +1,15 @@
{
"area": [
{
"type": "match",
"height": 26,
"width": 136,
"xpos": 235,
"ypos": 365
}
],
"properties": [],
"tags": [
"gis_field_confirm_password"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -0,0 +1,19 @@
{
"area": [
{
"xpos": 229,
"ypos": 215,
"click_point": {
"ypos": 18.5,
"xpos": 281
},
"width": 562,
"height": 37,
"type": "match"
}
],
"properties": [],
"tags": [
"gis_geoservice_enabled"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -0,0 +1,19 @@
{
"area": [
{
"width": 559,
"type": "match",
"height": 36,
"xpos": 233,
"ypos": 337,
"click_point": {
"xpos": 524,
"ypos": 13
}
}
],
"properties": [],
"tags": [
"gis_radio_reporting_disable"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -0,0 +1,19 @@
{
"area": [
{
"width": 558,
"height": 31,
"type": "match",
"ypos": 338,
"xpos": 234,
"click_point": {
"xpos": 523,
"ypos": 13.5
}
}
],
"properties": [],
"tags": [
"gis_reporting_enabled"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -0,0 +1,15 @@
{
"area": [
{
"type": "match",
"height": 22,
"width": 80,
"xpos": 471,
"ypos": 45
}
],
"properties": [],
"tags": [
"gis_screen_credentials"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 43,
"xpos": 474,
"type": "match",
"height": 21,
"width": 77
}
],
"properties": [],
"tags": [
"gis_screen_password"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -0,0 +1,15 @@
{
"area": [
{
"width": 73,
"height": 24,
"type": "match",
"ypos": 44,
"xpos": 475
}
],
"properties": [],
"tags": [
"gis_screen_privacy"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 44,
"xpos": 422,
"height": 25,
"type": "match",
"width": 181
}
],
"properties": [],
"tags": [
"gis_screen_software"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -0,0 +1,15 @@
{
"area": [
{
"width": 111,
"height": 25,
"type": "match",
"xpos": 459,
"ypos": 44
}
],
"properties": [],
"tags": [
"gis_screen_timezone"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View file

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 240,
"ypos": 507,
"width": 251,
"height": 25,
"type": "match"
}
],
"properties": [],
"tags": [
"gis_screen_welcome"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View file

@ -29,11 +29,17 @@ sub get_screen {
}
sub handle_welcome {
# Select a non-default language explicitely.
type_string('Czech');
wait_still_screen(2);
assert_and_click('gis_lang_czech_select');
assert_and_click('next_button');
my $welcome_type = shift;
if ($welcome_type eq "langselect") {
# Select a non-default language explicitely.
type_string('Czech');
wait_still_screen(2);
assert_and_click('gis_lang_czech_select');
assert_and_click('next_button');
}
else {
assert_and_click('gis_button_start_setup');
}
}
sub handle_keyboard {
@ -102,18 +108,39 @@ sub run {
assert_screen('gis_screen_welcome', timeout => 120);
# Keep running through screens until we reach the final screen
# Keep running through screens until we reach the final screen.
# Also track which screens were visited already.
my $iterations = 0;
my %visited_screens;
my @required_screens = qw(
welcome
privacy
timezone
software
credentials
password
);
while (1) {
die("GNOME Initial Setup appears stuck") if ++$iterations > 20;
my $current_screen = get_screen();
$visited_screens{$current_screen} = 1;
record_info("GNOME Initial Setup", "Testing screen: $current_screen");
last if $current_screen eq 'final';
if ($current_screen eq 'welcome') {
handle_welcome();
# Welcome can have two types, either it is a language
# setting screen, or it is just a real welcom page.
# Check if we see the "Start Setup" button and in
# that case, click on it, otherwise do the language
# selection.
if (check_screen('gis_button_start_setup', timeout => 10)) {
handle_welcome('welcome');
}
else {
handle_welcome('langselect');
}
}
elsif ($current_screen eq 'keyboard') {
handle_keyboard();
@ -137,6 +164,10 @@ sub run {
wait_still_screen(2);
}
for my $screen (@required_screens) {
die("GNOME Initial Setup skipped this required screen: $screen") unless $visited_screens{$screen};
}
# When we have reached the final screen
assert_and_click("gis_button_start_fedora");
# When we have reached the system, dismiss the tour

View file

@ -45,18 +45,26 @@ sub run {
my $user = get_var("TESTLOGIN", "rhood");
my $password = get_var("TESTPASSWORD", "nottingham");
my $locale_check = 0;
# Switch to the serial console. To run commands successfully,
# we need to load english keyboard layout. Otherwise, we cannot
# run commands correctly. Note, that the loadkeys command must
# be presented in the foreign layout.
$self->root_console(tty => 3);
console_loadkeys_us();
assert_script_run("chmod 666 /dev/${serialdev}");
# Check that system locale are set to Czech (cs_CZ.UTF-8)
assert_script_run("grep -x 'LANG=cs_CZ.UTF-8' /etc/locale.conf");
assert_script_run("localectl status | grep -E 'System Locale:.*LANG=cs_CZ\.UTF-8'");
assert_script_run('localectl status | grep -E "VC Keymap: cz"');
# If locale_check is off, only record info and skip checking.
if ($locale_check == 0) {
record_info("Lang settings", "Language and keyboard layout checks are switched off!");
}
else {
console_loadkeys_us();
# Check that system locale are set to Czech (cs_CZ.UTF-8)
assert_script_run("grep -x 'LANG=cs_CZ.UTF-8' /etc/locale.conf");
assert_script_run("localectl status | grep -E 'System Locale:.*LANG=cs_CZ\.UTF-8'");
assert_script_run('localectl status | grep -E "VC Keymap: cz"');
}
# Check that the time zone has been set to Bratislave, Europe
assert_cmd_output_eq(q{timedatectl show -p Timezone --value}, 'Europe/Bratislava');
@ -80,15 +88,23 @@ sub run {
'true'
);
# Check that keyboard layout and the locales are correct in user space
assert_as_user_matches($user,
q{gsettings get org.gnome.desktop.input-sources sources},
qr/\('xkb',\s*'cz'\)/
);
assert_as_user_matches($user,
q{locale},
qr/^LANG=cs_CZ\.UTF-8$/m
);
# Do not check for keyboard layout and locales because
# this type of setting is currently disabled in G-I-S.
if ($locale_check == 0) {
record_info("Lang settings", "Language and keyboard layout checks are switched off!");
}
else {
# Check that keyboard layout and the locales are correct in user space
assert_as_user_matches($user,
q{gsettings get org.gnome.desktop.input-sources sources},
qr/\('xkb',\s*'cz'\)/
);
assert_as_user_matches($user,
q{locale},
qr/^LANG=cs_CZ\.UTF-8$/m
);
}
# Check that automatic reporting is disabled.
assert_as_user_eq($user,