Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test to verify the latex2html #18968

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions schedule/qam/common/mau-extratests-desktop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ conditional_schedule:
VERSION:
15-SP5:
- texlive/latexdiff
- texlive/latex2html
15-SP4:
- texlive/latexdiff
- texlive/latex2html
15-SP3:
- texlive/latexdiff
- texlive/latex2html
15-SP2:
- texlive/latexdiff
15-SP1:
Expand Down
60 changes: 60 additions & 0 deletions tests/texlive/latex2html.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SUSE's openQA tests
#
# Copyright 2024 SUSE LLC
# SPDX-License-Identifier: FSFAP

# Package: latex2html
# Summary: Test the latex2html command with a simple example
# - Install latex2html
# - Run late2html command on LaTex document to convert it to HTML
# - Open created HTML and check
# - Cleanup
# Maintainer: QE Core <qe-core@suse.de>

use base 'x11test';
use x11utils 'ensure_unlocked_desktop';
use strict;
use warnings;
use testapi;
use utils;
use serial_terminal 'select_serial_terminal';

my $latex_data = <<EOF;
\\documentclass{article}
\\begin{document}
Hello, this is a LaTeX sample example page!
EOF
sub run {
my ($self) = @_;
select_serial_terminal;
# Install latex2html package
zypper_call('in latex2html', timeout => 1800);
script_output "echo '$latex_data' >> /tmp/latex_sample.tex";
# Convert the LaTeX document to HTML using latex2html
assert_script_run("latex2html /tmp/latex_sample.tex");

select_console('x11', await_console => 0);
ensure_unlocked_desktop();
$self->start_firefox_with_profile;
# HTML Page
$self->firefox_open_url('/tmp/latex_sample/index.html', assert_loaded_url => 'latex_sample_indexpage');
wait_still_screen 2;
assert_screen("latex_sample_indexpage", 60);
$self->cleanup();
}

sub cleanup {
my $self = shift;
$self->exit_firefox;
select_serial_terminal;
assert_script_run("rm /tmp/latex_sample.tex");
assert_script_run("rm -r /tmp/latex_sample");
select_console 'x11', await_console => 0;
}

sub post_fail_hook {
my $self = shift;
$self->cleanup();
$self->SUPER::post_fail_hook;
}
1;