1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-24 23:03:08 +00:00

Create a test suite for Evince.

This PR fixes issue #188. It adds a test suite to test basic
functionality of Evince and brings the following features:

* test scripts for various Evince functions.
* needles to support the Evince test scripts
* new template variables `TESTPATH` and `POSTINSTALL_LOAD_ALL` (see
  below)
* new logic in `main.py` (see below)

The new variables and the new logic make it easier to create test
suites for post-installation tests. If TESTPATH is used, OpenQA
will take all tests mentioned in POSTINSTALL from that specified
TESTPATH. If both TESTPATH and POSTINSTALL_LOAD_ALL are used, then
OpenQA will run all tests it can find at the TESTPATH location.
If POSTINSTALL and POSTINSTALL_LOAD_ALL are set simultaneously,
then only POSTINSTALL will be taken into account and OpenQA will
only load tests mentioned there.
This commit is contained in:
Lukáš Růžička 2021-07-14 18:04:16 +02:00
parent 420205bd5e
commit e0d9409c74
99 changed files with 1120 additions and 8 deletions

View File

@ -74,7 +74,8 @@ it also means that `B` conflicts `A` even if not shown in the table).
| `USER_PASSWORD` | string | not set | should be used with `USER_LOGIN` | when set, user password is set to this value. If not set, default value `weakpassword` is used for console installs, no login is done for graphical installs |
| `TEST_UPDATES` | boolean | `false`/not set | set to indicate that this test checks updates.img loading, so we should check for the expected effect of the updates image used for this testing |
| `PREINSTALL` | string | not set | nothing | If set, specified module will be loaded before reboot and install; module supposed to be starting as rescue mode |
| `POSTINSTALL` | string | not set | nothing | If set, `tests/(value)_postinstall.pm` will be loaded after install, boot, login, and other postinstall tests
| `POSTINSTALL` | string | not set | `POSTINSTALL_PATH` | If set, `tests/(value)_postinstall.pm` will be loaded after install, boot, login, and other postinstall tests
| `POSTINSTALL_PATH` | boolean | not set | `POSTINSTALL` | If set, `all tests on `TESTPATH` location will be loaded as postinstall tests after install, boot, login, and other postinstall tests |
| `UEFI` | boolean | `false`/not set | nothing | whether to use UEFI, this variable isn't usually set in test suites but in machine definition |
| `ANACONDA_TEXT` | boolean | `false`/not set | all | when specified, anaconda will run in text mode |
| `HELPCHECK` | boolean | `false`/not set | all | when specified, Anaconda Help will be called on each available pane. |
@ -85,6 +86,7 @@ it also means that `B` conflicts `A` even if not shown in the table).
| `BUGZILLA_LOGIN` | string | not set | used with `_SECRET_BUGZILLA_PASSWORD` | This is used to store a login string which does not get exposed in log files. |
| `_SECRET_BUGZILLA_PASSWORD` | string | not set | used with `BUGZILLA_LOGIN` | This is used to store a password string which does not get exposed in log files. |
| `_SECRET_BUGZILLA_APIKEY` | string | not set | used with other secrets | This is used to store an API key which does not get exposed in log files. |
| `TESTPATH` | string | not set | can be used to set path for postinstall tests, if they are placed in subdirectories
Run variables
-------------

34
main.pm
View File

@ -323,13 +323,33 @@ sub load_postinstall_tests() {
autotest::loadtest "tests/_console_avc_crash.pm";
}
# generic post-install test load
if (get_var("POSTINSTALL")) {
my @pis = split(/ /, get_var("POSTINSTALL"));
foreach my $pi (@pis) {
autotest::loadtest "tests/${pi}.pm";
}
}
# generic post-install test will load if POSTINSTALL or POSTINSTALL_PATH
# are set. If POSTINSTALL is set, then only tests provided in that list will
# be run, with POSTINSTALL_PATH all tests on that path will be run without any
# possibility to limit them.
# These variables are mutually exclusive.
# If POSTINSTALL is set, it means that we want to run selected tests,
# specified in the POSTINSTALL variable.
if (get_var("POSTINSTALL")) {
my @pis = split(/ /, get_var("POSTINSTALL"));
# For each test in POSTINSTALL, load the test
foreach my $pi (@pis) {
autotest::loadtest "tests/${pi}.pm";
}
}
# If POSTINSTALL_PATH is set, we will load all available test files from that location
# as postinstall tests.
elsif (get_var("POSTINSTALL_PATH")) {
my $casedir = get_var("CASEDIR");
my $path = get_var("POSTINSTALL_PATH");
# Read the list of files on that path,
my @pis = glob "${casedir}/${path}/*.pm";
# and load each of them.
foreach my $pi (@pis) {
$pi = basename($pi);
autotest::loadtest "$path/$pi";
}
}
# load the ADVISORY / KOJITASK post-install test - this records which
# update or task packages were actually installed during the test. Don't

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 546,
"ypos": 224,
"width": 53,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_about_credits"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"tags": [
"evince_about_shown"
],
"area": [
{
"xpos": 445,
"ypos": 286,
"width": 133,
"height": 146,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 150,
"ypos": 43,
"width": 25,
"height": 26,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_add_annotation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 18,
"ypos": 90,
"width": 67,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_add_annotation_text"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 607,
"type": "match",
"height": 22,
"width": 40,
"xpos": 372
}
],
"properties": [],
"tags": [
"evince_annotation_added"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 600,
"type": "match",
"height": 32,
"width": 30,
"xpos": 373
}
],
"properties": [],
"tags": [
"evince_annotation_placed"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 584,
"type": "match",
"height": 45,
"xpos": 345,
"width": 161
}
],
"properties": [],
"tags": [
"evince_annotation_removed"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 43,
"xpos": 860,
"height": 27,
"width": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_change_zoom"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 626,
"ypos": 578,
"width": 24,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_close_annotation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 819,
"ypos": 259,
"width": 27,
"height": 70,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_content_rotated_once"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 423,
"ypos": 411,
"width": 73,
"height": 56,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_credits_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 630,
"ypos": 550,
"width": 349,
"height": 56,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_document_zoom_200"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,22 @@
{
"properties": [],
"tags": [
"evince_dual_mode"
],
"area": [
{
"xpos": 322,
"ypos": 383,
"width": 88,
"height": 16,
"type": "match"
},
{
"xpos": 703,
"ypos": 428,
"width": 99,
"height": 16,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 411,
"ypos": 317,
"width": 338,
"height": 34,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_file_opened"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 187,
"ypos": 155,
"width": 76,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_file_select_pdf"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 68,
"ypos": 109,
"width": 371,
"height": 42,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_help_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 783,
"ypos": 596,
"width": 163,
"height": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_menu_about"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 785,
"ypos": 335,
"width": 40,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_menu_dual"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 783,
"ypos": 571,
"width": 40,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_menu_help"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 784,
"ypos": 486,
"width": 73,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_menu_properties"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 784,
"ypos": 421,
"width": 61,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_menu_rotate"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 784,
"ypos": 243,
"width": 68,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_menu_saveas"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 784,
"ypos": 544,
"width": 132,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_menu_shortcuts"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"tags": [
"evince_night_mode"
],
"area": [
{
"xpos": 430,
"ypos": 315,
"width": 332,
"height": 35,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 397,
"ypos": 91,
"width": 55,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_open_file_dialog"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"tags": [
"evince_properties_shown"
],
"area": [
{
"xpos": 396,
"ypos": 349,
"width": 110,
"height": 44,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"tags": [
"evince_remove_annotation"
],
"area": [
{
"xpos": 414,
"ypos": 543,
"width": 131,
"height": 18,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 897,
"ypos": 42,
"width": 31,
"height": 28,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_search_button"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 638,
"ypos": 540,
"width": 38,
"height": 14,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_search_found"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 585,
"type": "match",
"height": 30,
"width": 43,
"xpos": 352
}
],
"properties": [],
"tags": [
"evince_select_annotation_place"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 822,
"ypos": 358,
"width": 44,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_select_zoom_200"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 821,
"ypos": 118,
"width": 65,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_select_zoom_fitwidth"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 495,
"ypos": 702,
"width": 36,
"height": 33,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_shortcuts_second"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"tags": [
"evince_shortcuts_second_shown"
],
"area": [
{
"xpos": 510,
"ypos": 111,
"width": 206,
"height": 25,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"tags": [
"evince_shortcuts_shown"
],
"area": [
{
"xpos": 450,
"ypos": 114,
"width": 183,
"height": 21,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 541,
"ypos": 700,
"width": 36,
"height": 36,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_shortcuts_third"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 570,
"ypos": 114,
"width": 141,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_shortcuts_third_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 781,
"ypos": 450,
"width": 88,
"height": 25,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_toggle_night_mode"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 675,
"ypos": 703,
"width": 186,
"height": 31,
"type": "match"
}
],
"properties": [],
"tags": [
"evince_content_rotated_twice"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 941,
"ypos": 46,
"width": 26,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"gnome_burger_menu"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 959,
"ypos": 48,
"width": 42,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"gnome_button_open"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -0,0 +1,15 @@
{
"properties": [],
"tags": [
"gnome_button_save_blue"
],
"area": [
{
"xpos": 959,
"ypos": 46,
"width": 40,
"height": 20,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -951,6 +951,21 @@
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"evince": {
"profiles": {
"fedora-Silverblue-dvd_ostree-iso-ppc64le-*-ppc64le": 50,
"fedora-Silverblue-dvd_ostree-iso-x86_64-*-64bit": 50,
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 20,
"fedora-Workstation-live-iso-x86_64-*-64bit": 20,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
},
"settings": {
"BOOTFROM": "c",
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
"POSTINSTALL_PATH": "tests/applications/evince",
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"desktop_update_graphical": {
"profiles": {
"fedora-KDE-live-iso-x86_64-*-64bit": 32,

View File

@ -0,0 +1,68 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This script will download the test data for evince, start the application,
# and set a milestone as a starting point for the other Evince tests.
#
sub check_and_install_git {
# Let's see if Git is installed and install it, if it isn't.
if (script_run("rpm -q git")) {
assert_script_run("dnf install -y git");
}
}
sub download_testdata {
# Navigate to the test's home directory
assert_script_run("cd /home/test/");
# Clone the test repository
assert_script_run("git clone https://pagure.io/fedora-qa/openqa_testdata.git");
# Change ownership and attributes
assert_script_run("chown -R test:test openqa_testdata");
# Move the test file into a correct location.
assert_script_run("cp openqa_testdata/evince/evince.pdf Documents")
}
sub run {
my $self = shift;
# Switch to console
$self->root_console(tty=>3);
# Perform git test
check_and_install_git();
# Download the test data
download_testdata();
# Exit the terminal
desktop_vt;
# Start the application
menu_launch_type("evince");
# Check that is started
assert_screen 'apps_run_dviewer';
# Open the test file to create a starting point for the other Evince tests.
# Click on Open button to open the File Open Dialog
assert_and_click("evince_open_file_dialog", button => "left", timeout => 30);
# Select the evince.pdf file.
assert_and_click("evince_file_select_pdf", button => "left", timeout => 30);
# Click the Open button to open the file
assert_and_click("gnome_button_open", button => "left", timeout => 30);
# Fullsize the Evince window.
send_key("super-up");
# Check that the file has been successfully opened.
assert_screen("evince_file_opened");
}
sub test_flags {
return {fatal => 1, milestone => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,34 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests if About works.
sub run {
my $self = shift;
# Open the menu by clicking on the Burger icon
assert_and_click("gnome_burger_menu", button => "left", timeout => 30);
wait_still_screen 2;
# In the menu, select the About item.
assert_and_click("evince_menu_about", button => "left", timeout => 30);
# Check that the About section has been displayed.
assert_screen("evince_about_shown");
# Click on Credits button to see the second part of the dialogue.
assert_and_click("evince_about_credits", button => "left", timeout => 30);
# Check that Credits are accessible and visible, too.
assert_screen("evince_credits_shown");
}
sub test_flags {
# Rollback to the previous state to make space for other parts.
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,48 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests an annotation can be added to the displayed content.
sub run {
my $self = shift;
# Click on the Pencil button.
assert_and_click("evince_add_annotation", button => "left", timeout => 30);
# Click on Note text.
assert_and_click("evince_add_annotation_text", button => "left", timeout => 30);
# Select location to add annotation.
assert_and_click("evince_select_annotation_place", button => "left", timeout => 30);
# Enter some text to the annotation.
type_very_safely("Add note");
# Check that the annotation window has appeared with that text.
assert_screen("evince_annotation_added");
# Close the annotation.
assert_and_click("evince_close_annotation", button => "left", timeout => 30);
# Check that the annotation is still placed in the document.
assert_screen("evince_annotation_placed");
# Open the annotation's context menu.
assert_and_click("evince_annotation_placed", button => "right", timeout => 30);
# Remove the annotation.
assert_and_click("evince_remove_annotation", button => "left", timeout => 30);
# Check that the annotation has been removed.
assert_screen("evince_annotation_removed");
}
sub test_flags {
# Rollback to the starting point.
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,27 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests that Evince can change the zoom of the document.
sub run {
my $self = shift;
# Click on zoom menu to open choices.
assert_and_click("evince_change_zoom", button => "left", timeout => 30);
# Select 200%.
assert_and_click("evince_select_zoom_200", button => "left", timeout => 30);
# Check that the document zoom was changed.
assert_screen("evince_document_zoom_200");
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,37 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests that Evince is able to display content in a two-page mode.
sub run {
my $self = shift;
# Click on the Zoom menu to change a different zoom for next steps.
assert_and_click("evince_change_zoom", button => "left", timeout => 30);
# Select the Fit Width option to be able to see the whole layout.
assert_and_click("evince_select_zoom_fitwidth", button => "left", timeout => 30);
#Dismiss the dialogue
send_key("esc");
# Enter the menu
assert_and_click("gnome_burger_menu", button => "left", timeout => 30);
# Select the Dual mode
assert_and_click("evince_menu_dual", button => "left", timeout => 30);
# Dismiss the menu
send_key("esc");
# Check that the content is displayed in dual mode.
assert_screen("evince_dual_mode", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,27 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests that Evince can display the Help pages.
sub run {
my $self = shift;
# Open menu with Burger icon.
assert_and_click("gnome_burger_menu", button => "left", timeout => 30);
wait_still_screen 2;
# Select the Help item in the menu.
assert_and_click("evince_menu_help", button => "left", timeout => 30);
wait_still_screen 2;
# Check that Help has been shown.
assert_screen("evince_help_shown", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,30 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests that Evince can be switched into night mode.
sub run {
my $self = shift;
# Click on the Menu button.
assert_and_click("gnome_burger_menu", timeout => 30, button => "left");
# Click on the Night mode to select it.
assert_and_click("evince_toggle_night_mode", button => "left", timeout => 30);
# The menu stays opened, so hit Esc to dismiss it.
send_key("esc");
wait_still_screen 2;
# Check that night mode has been activated.
assert_screen("evince_night_mode", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,27 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests that Evince can show Document Properties.
sub run {
my $self = shift;
# Open the menu.
assert_and_click("gnome_burger_menu", button => "left", timeout => 30);
wait_still_screen 2;
# Select the Properties item.
assert_and_click("evince_menu_properties", button => "left", timeout => 30);
wait_still_screen 2;
# Check that Properties are shown.
assert_screen("evince_properties_shown", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,37 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests that Evince can rotate the content.
sub rotate_content {
# Open the application menu
assert_and_click("gnome_burger_menu", button => "left", timeout => 30);
# Click with the *left* button (needle click area might need some correction)
assert_and_click("evince_menu_rotate", button => "left", timeout => 30);
}
sub run {
my $self = shift;
# Rotate the content once.
rotate_content();
# Check that the window content has been rotated.
assert_screen("evince_content_rotated_once", timeout => 30);
# Rotate the content again.
rotate_content();
# Check that the window content has been rotated.
assert_screen("evince_content_rotated_twice", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,36 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests tests that Evince can Save the document As another document.
sub run {
my $self = shift;
# Open the menu.
assert_and_click("gnome_burger_menu", button => "left", timeout => 30);
# Select Save As
assert_and_click("evince_menu_saveas", button => "left", timeout => 30);
# Type a new name.
type_very_safely("alternative");
# Click on the Save button
assert_and_click("gnome_button_save_blue", button => "left", timeout => 30);
# Now the document is saved under a different name. We will switch to the
# terminal console to check that it has been created.
$self->root_console(tty=>3);
assert_script_run("ls /home/test/Documents/alternative.pdf");
# Now, check that the new file does not differ from the original one.
assert_script_run("diff /home/test/Documents/evince.pdf /home/test/Documents/alternative.pdf");
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,28 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests the ability to search string in the text.
sub run {
my $self = shift;
# Click on the Search button to search for text
assert_and_click("evince_search_button", button => "left", timeout => 30);
# Type *pages*.
type_very_safely("pages");
# Press Enter.
send_key("ret");
# Check that the typed text has been found.
assert_screen("evince_search_found", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,39 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests that Evince displays shortcuts.
sub run {
my $self = shift;
# Open the menu
assert_and_click("gnome_burger_menu", button => "left", timeout => 30);
wait_still_screen 2;
# Select the Keyboard Shortcuts item
assert_and_click("evince_menu_shortcuts", button => "left", timeout => 30);
wait_still_screen 2;
# Check that Shortcuts has been shown
assert_screen("evince_shortcuts_shown");
# Click on number 2 to arrive to the second page
assert_and_click("evince_shortcuts_second", button => "left", timeout => 30);
# Check that Shortcuts 2 has been shown
assert_screen("evince_shortcuts_second_shown");
# Click on number 3 to arrive to the second page
assert_and_click("evince_shortcuts_third", button => "left", timeout => 30);
# Check that Shortcuts 3 has been shown
assert_screen("evince_shortcuts_third_shown");
}
sub test_flags {
return {always_rollback => 1};
}
1;