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

Create a test suite for Okular

This commit is contained in:
Lukáš Růžička 2024-04-02 12:03:53 +02:00
parent eab2732db4
commit ca376906ce
95 changed files with 1049 additions and 0 deletions

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 801,
"ypos": 614,
"width": 32,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"kde_button_open"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 378,
"ypos": 35,
"width": 34,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"kde_mainmenu_help"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 352,
"ypos": 216,
"width": 112,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_about_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 216,
"ypos": 113,
"width": 22,
"height": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_add_popup"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 18,
"ypos": 205,
"width": 147,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_annotation_added"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 681,
"ypos": 589,
"width": 35,
"height": 48,
"type": "match",
"match": 90
}
],
"properties": [],
"tags": [
"okular_annotation_placed"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 671,
"ypos": 582,
"width": 46,
"height": 51,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_annotation_removed"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 534,
"ypos": 272,
"width": 53,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_button_credits"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 781,
"ypos": 614,
"width": 50,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_button_save"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 125,
"ypos": 74,
"width": 76,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_change_zoom"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 205,
"ypos": 435,
"width": 105,
"height": 42,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_content_rotated_once"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 610,
"ypos": 583,
"width": 85,
"height": 33,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_content_rotated_twice"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 355,
"ypos": 339,
"width": 88,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_credits_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 678,
"ypos": 358,
"width": 159,
"height": 59,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_document_zoom_200"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 451,
"ypos": 709,
"width": 101,
"height": 26,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_dual_mode"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 244,
"ypos": 134,
"width": 102,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_facing_pages"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 448,
"ypos": 8,
"width": 127,
"height": 15,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_file_opened"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 262,
"ypos": 226,
"width": 65,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_file_select_pdf"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 388,
"ypos": 171,
"width": 167,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_help_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 416,
"ypos": 244,
"width": 89,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_menu_about"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 31,
"ypos": 336,
"width": 68,
"height": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_menu_properties"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 15,
"ypos": 204,
"width": 79,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_menu_saveas"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 47,
"ypos": 37,
"width": 35,
"height": 15,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_menu_view"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 359,
"ypos": 115,
"width": 73,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_navi_page_one"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 358,
"ypos": 320,
"width": 96,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_navi_page_two"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 311,
"ypos": 516,
"width": 101,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_open_file_dialog"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 443,
"ypos": 317,
"width": 120,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_presentation_dialogue"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 597,
"ypos": 472,
"width": 43,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_presentation_ok"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 427,
"ypos": 422,
"width": 110,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_properties_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 710,
"ypos": 673,
"width": 62,
"height": 15,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_remove_annotation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 335,
"ypos": 396,
"width": 46,
"height": 54,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_runs"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 553,
"ypos": 589,
"width": 53,
"height": 29,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_search_found"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 387,
"ypos": 114,
"width": 189,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_shortcuts_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 97,
"ypos": 321,
"width": 73,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_submenu_orientation"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 349,
"ypos": 322,
"width": 75,
"height": 17,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_submenu_rotate"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 435,
"ypos": 229,
"width": 133,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_submenu_shorcuts"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 238,
"ypos": 69,
"width": 87,
"height": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"okular_view_mode"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 801,
"ypos": 614,
"width": 32,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"kde_button_open"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 8,
"ypos": 36,
"width": 26,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"kde_mainmenu_file"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -2312,6 +2312,17 @@
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"okular": {
"profiles": {
"fedora-KDE-live-iso-x86_64-*-64bit": 42
},
"settings": {
"BOOTFROM": "c",
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
"POSTINSTALL_PATH": "tests/applications/okular",
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"mediakit_fileconflicts": {
"profiles": {
"fedora-Server-dvd-iso-aarch64-*-aarch64": 10,

View File

@ -0,0 +1,49 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This script will download the test data for Okular, start the application,
# and set a milestone as a starting point for the other Okular tests.
#
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("okular");
# Check that is started
assert_screen 'okular_runs';
# Open the test file to create a starting point for the other Okular tests.
# Click on Open button to open the File Open Dialog
assert_and_click("okular_open_file_dialog", button => "left", timeout => 30);
# Select the evince.pdf file.
assert_and_click("okular_file_select_pdf", button => "left", timeout => 30);
# Click the Open button to open the file
assert_and_click("kde_button_open", button => "left", timeout => 30);
# Fullsize the Evince window.
send_key("super-pgup");
# Check that the file has been successfully opened.
assert_screen("okular_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("kde_mainmenu_help", button => "left", timeout => 30);
wait_still_screen 2;
# In the menu, select the About item.
assert_and_click("okular_menu_about", button => "left", timeout => 30);
# Check that the About section has been displayed.
assert_screen("okular_about_shown");
# Click on Credits button to see the second part of the dialogue.
assert_and_click("okular_button_credits", button => "left", timeout => 30);
# Check that Credits are accessible and visible, too.
assert_screen("okular_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,61 @@
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;
# Press the F6 button to open the annotation menu.
send_key("f6");
wait_still_screen(2);
# Click on Note text.
assert_and_click("okular_add_popup", button => "left", timeout => 30);
# Select location to add annotation.
assert_and_click("okular_select_annotation_place", button => "left", timeout => 30);
# Enter some text to the annotation.
type_very_safely("This is an impotant note.");
# Check that the annotation window has appeared with that text.
assert_screen("okular_annotation_added");
# Close the annotation window
send_key("esc");
# Close the annotation mode.
assert_and_click("okular_close_annotation", button => "left", timeout => 30);
# Check that the annotation is still placed in the document.
assert_screen("okular_annotation_placed");
# Reopen the annotation.
assert_and_dclick("okular_annotation_placed", button => "left", timeout => 30);
# Check that the annotation still has that text.
assert_screen("okular_annotation_added");
# Close the window again
send_key("esc");
# Open the annotation's context menu.
assert_and_click("okular_annotation_placed", button => "right", timeout => 30);
# Remove the annotation.
assert_and_click("okular_remove_annotation", button => "left", timeout => 30);
# Check that the annotation has been removed.
assert_screen("okular_annotation_removed");
}
sub test_flags {
# Rollback to the starting point.
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,29 @@
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 and select the content.
assert_and_click("okular_change_zoom", button => "left", timeout => 30);
send_key("ctrl-a");
# Select 200%.
type_very_safely("200");
send_key("ret");
# Check that the document zoom was changed.
assert_screen("okular_document_zoom_200");
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,33 @@
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 and change a different zoom for next steps.
assert_and_click("okular_change_zoom", button => "left", timeout => 30);
send_key("ctrl-a");
# Select the Fit Width option to be able to see the whole layout.
type_very_safely("fit width");
send_key("ret");
# Enter the menu
assert_and_click("okular_view_mode", button => "left", timeout => 30);
# Select the Dual mode
assert_and_click("okular_facing_pages", button => "left", timeout => 30);
# Check that the content is displayed in dual mode.
assert_screen("okular_dual_mode", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,23 @@
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 Help.
send_key("f1");
wait_still_screen 2;
# Check that Help has been shown.
assert_screen("okular_help_shown", 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 can be switched into night mode.
sub run {
my $self = shift;
# Switch on Presentation mode.
send_key("ctrl-shift-p");
wait_still_screen(2);
# A dialogue should be shown, assert and dismiss.
assert_screen("okular_presentation_dialogue");
assert_and_click("okular_presentation_ok");
# Make sure that we are on the first page.
send_key("home");
# Each time, we move to a different page, a special
# navigation mark will be shown for a couple of seconds,
# so we check for it.
send_key("right"); # to move to a different page
assert_screen("okular_navi_page_one");
# Move to another page to see if presentation mode
# works correctly.
send_key("left"); # to move to a second page
assert_screen("okular_navi_page_two");
}
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("kde_mainmenu_file", button => "left", timeout => 30);
wait_still_screen 2;
# Select the Properties item.
assert_and_click("okular_menu_properties", button => "left", timeout => 30);
wait_still_screen 2;
# Check that Properties are shown.
assert_screen("okular_properties_shown", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,35 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests that Evince can rotate the content.
sub rotate_content {
# Send the key combo to rotate the content
assert_and_click("okular_menu_view");
assert_and_click("okular_submenu_orientation");
assert_and_click("okular_submenu_rotate");
}
sub run {
my $self = shift;
# Rotate the content once.
rotate_content();
# Check that the window content has been rotated.
assert_screen("okular_content_rotated_once", timeout => 30);
# Rotate the content again.
rotate_content();
# Check that the window content has been rotated.
assert_screen("okular_content_rotated_twice", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,41 @@
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("kde_mainmenu_file", button => "left", timeout => 30);
# Select Save As
assert_and_click("okular_menu_saveas", button => "left", timeout => 30);
wait_still_screen(2);
# Type a new name.
type_very_safely("alternative");
assert_and_click("okular_button_save", 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);
my $filename = "alternative.pdf";
if (script_run("ls /home/test/Documents/${filename}")) {
$filename = "alternativeevince.pdf";
assert_script_run("ls /home/test/Documents/${filename}");
record_soft_failure("File name was not pre-selected in Save As dialog: https://gitlab.gnome.org/GNOME/gtk/-/issues/4768");
}
# 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/${filename}");
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,26 @@
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;
# Send a key combo to invoke search
send_key("ctrl-f");
# Type *pages*.
type_very_safely("pages");
# Check that the typed text has been found.
assert_screen("okular_search_found", timeout => 30);
}
sub test_flags {
return {always_rollback => 1};
}
1;

View File

@ -0,0 +1,25 @@
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("kde_mainmenu_settings");
# Choose the shortcuts submenu
assert_and_click("okular_submenu_shorcuts");
# Check that Shortcuts has been shown
assert_screen("okular_shortcuts_shown");
}
sub test_flags {
return {always_rollback => 1};
}
1;