diff --git a/main.pm b/main.pm index 71cc9c3b..00387e9e 100644 --- a/main.pm +++ b/main.pm @@ -251,6 +251,12 @@ sub _load_early_postinstall_tests { if (get_var("SWITCHED_LAYOUT") || get_var("INPUT_METHOD")) { _load_instance("tests/_graphical_input", $instance); } + + if (get_var("LANGUAGE") eq "japanese" || get_var("LANGUAGE") eq "arabic") { + _load_instance("tests/check_default_fonts", $instance); + } + + # We do not want to run this on Desktop installations or when # the installation is interrupted on purpose. unless (get_var("DESKTOP") || get_var("CRASH_REPORT")) { diff --git a/needles/gnome/apps/apps_run_terminal-20220519.json b/needles/gnome/apps/apps_run_terminal-20220519.json new file mode 100644 index 00000000..a878becf --- /dev/null +++ b/needles/gnome/apps/apps_run_terminal-20220519.json @@ -0,0 +1,23 @@ +{ + "area": [ + { + "xpos": 151, + "ypos": 6, + "width": 65, + "height": 23, + "type": "match" + }, + { + "type": "match", + "ypos": 112, + "xpos": 194, + "width": 25, + "height": 20 + } + ], + "properties": [], + "tags": [ + "apps_run_terminal", + "LANGUAGE-japanese" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/apps_run_terminal-20220519.png b/needles/gnome/apps/apps_run_terminal-20220519.png new file mode 100644 index 00000000..1faccfe5 Binary files /dev/null and b/needles/gnome/apps/apps_run_terminal-20220519.png differ diff --git a/needles/gnome/japanese/layout_ascii_japanese-20220518.json b/needles/gnome/japanese/layout_ascii_japanese-20220518.json new file mode 100644 index 00000000..32377b3b --- /dev/null +++ b/needles/gnome/japanese/layout_ascii_japanese-20220518.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "height": 17, + "ypos": 9, + "xpos": 885, + "width": 18, + "type": "match" + } + ], + "properties": [], + "tags": [ + "gnome_layout_ascii", + "LANGUAGE-japanese" + ] +} \ No newline at end of file diff --git a/needles/gnome/japanese/layout_ascii_japanese-20220518.png b/needles/gnome/japanese/layout_ascii_japanese-20220518.png new file mode 100644 index 00000000..7d690a6e Binary files /dev/null and b/needles/gnome/japanese/layout_ascii_japanese-20220518.png differ diff --git a/tests/_graphical_input.pm b/tests/_graphical_input.pm index 44bd26bb..0a8b7ff3 100644 --- a/tests/_graphical_input.pm +++ b/tests/_graphical_input.pm @@ -56,7 +56,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return { fatal => 1, always_rollback => 1 }; } 1; diff --git a/tests/check_default_fonts.pm b/tests/check_default_fonts.pm new file mode 100644 index 00000000..e85e12bf --- /dev/null +++ b/tests/check_default_fonts.pm @@ -0,0 +1,65 @@ +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"); + + # 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. + script_run("wget https://lruzicka.fedorapeople.org/$language-reference.txt"); + # Compare the test file and the reference file. + assert_script_run("diff test.txt $language-reference.txt"); + } + + # For the rest of languages that are not currently defined, do nothing. +} + +sub test_flags { + return {fatal => 0}; +} + +1; + +# vim: set sw=4 et: