2021-03-31 09:58:24 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
use testapi;
|
|
|
|
use utils;
|
|
|
|
|
|
|
|
# This test cases automates the Testcase_i18n_default_fonts, see
|
|
|
|
# https://fedoraproject.org/wiki/QA:Testcase_i18n_default_fonts.
|
|
|
|
|
|
|
|
sub run {
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# On the console, the fonts might differ than in GUI.
|
|
|
|
# We will perform the tests in the gnome-terminal.
|
|
|
|
# First, open it!
|
|
|
|
desktop_switch_layout 'ascii';
|
|
|
|
wait_still_screen(2);
|
|
|
|
|
|
|
|
menu_launch_type("terminal");
|
|
|
|
# Similarly to _graphical_input.pm, repeat running the command
|
|
|
|
# if it fails the first time (it often does).
|
|
|
|
unless (check_screen "apps_run_terminal", 30) {
|
|
|
|
check_desktop;
|
|
|
|
menu_launch_type("terminal");
|
|
|
|
}
|
|
|
|
assert_screen("apps_run_terminal");
|
2022-05-27 18:01:27 +00:00
|
|
|
wait_still_screen(stilltime=>5, similarity_level=>42);
|
2021-03-31 09:58:24 +00:00
|
|
|
|
|
|
|
# Run the test commands and record their output in the test file.
|
|
|
|
enter_cmd("fc-match sans > test.txt");
|
|
|
|
sleep(2);
|
|
|
|
enter_cmd("fc-match serif >> test.txt");
|
|
|
|
sleep(2);
|
|
|
|
enter_cmd("fc-match monospace >> test.txt");
|
|
|
|
sleep(2);
|
|
|
|
|
|
|
|
# Depending on the selected language (Japanese or Arabic), we
|
|
|
|
# will download a reference file and compare it with the test
|
|
|
|
# file obtained in the previous step.
|
|
|
|
|
|
|
|
my $language = get_var("LANGUAGE");
|
|
|
|
my @supported = qw(japanese arabic);
|
|
|
|
# If the language is among supported languages
|
|
|
|
if ($language ~~ @supported) {
|
|
|
|
# Go to root console for script assertions.
|
|
|
|
$self->root_console(tty=>3);
|
|
|
|
# Load us keys to be used on console
|
|
|
|
script_run("loadkeys us");
|
|
|
|
# Navigate to the home directory.
|
|
|
|
my $username = get_var("USER_LOGIN") // "test";
|
|
|
|
script_run("cd /home/$username/");
|
|
|
|
# Download the language reference file.
|
2022-06-02 21:36:33 +00:00
|
|
|
script_run("wget https://fedorapeople.org/groups/qa/openqa-fonts/$language-reference.txt");
|
|
|
|
# upload the log for debugging.
|
|
|
|
upload_logs "test.txt", failok=>1;
|
2021-03-31 09:58:24 +00:00
|
|
|
# Compare the test file and the reference file.
|
2022-06-02 21:36:33 +00:00
|
|
|
assert_script_run("diff -u test.txt $language-reference.txt");
|
2021-03-31 09:58:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# For the rest of languages that are not currently defined, do nothing.
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
|
|
|
return {fatal => 0};
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|