Skip to content

Commit

Permalink
Add a test to verify the latex2html
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepthiYV committed Mar 27, 2024
1 parent f934636 commit b0169cf
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
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;

my $latex_data = <<EOF;
\\documentclass{article}
\\begin{document}
Hello, this is a LaTeX sample example page!
EOF
sub run {
my ($self) = @_;
select_console('root-console');

zypper_call('in latex2html', timeout => 1800);
assert_script_run "echo '$latex_data' >> /tmp/latex_sample.tex";

assert_script_run("latex2html /tmp/latex_sample.tex");

select_console('x11', await_console => 0);
ensure_unlocked_desktop();

$self->start_firefox_with_profile;
$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_console('root-console');
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;

0 comments on commit b0169cf

Please sign in to comment.