-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |