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 Loupe (Image Viewer)

This PR adds a test for a new Image Viewer called Loupe.
It is based on the old Image Viewer test, newly reneedled
with some of the tests shortened, deleted or edited
as the new Image Viewer has a little bit less functions
compared to the previous one.

Add needles.
This commit is contained in:
Lukáš Růžička 2021-08-10 13:50:19 +02:00 committed by Lukas Ruzicka
parent 413dba4c95
commit 9e0d74453c
65 changed files with 743 additions and 0 deletions

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 353,
"ypos": 610,
"width": 57,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_about_credits"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 418,
"ypos": 207,
"width": 186,
"height": 101,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_about_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

View File

@ -0,0 +1,22 @@
{
"area": [
{
"xpos": 358,
"ypos": 202,
"width": 116,
"height": 21,
"type": "match"
},
{
"xpos": 355,
"ypos": 425,
"width": 92,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_credits_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 254,
"ypos": 379,
"width": 72,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_file_select_jpg"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 147,
"ypos": 178,
"width": 239,
"height": 154,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_fullscreen_on"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 519,
"ypos": 481,
"width": 129,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_help_image_view"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 10,
"ypos": 112,
"width": 274,
"height": 30,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_help_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 6,
"ypos": 155,
"width": 260,
"height": 44,
"type": "match",
"match": 90
}
],
"properties": [],
"tags": [
"loupe_help_view_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 7,
"ypos": 1,
"width": 81,
"height": 106,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_image_background"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 75,
"ypos": 167,
"width": 308,
"height": 211,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_image_default"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 483,
"ypos": 327,
"width": 261,
"height": 159,
"type": "match",
"match": 90
}
],
"properties": [],
"tags": [
"loupe_image_next"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 149,
"height": 93,
"type": "match",
"ypos": 648,
"xpos": 330
}
],
"properties": [],
"tags": [
"loupe_image_rotated_left"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 393,
"xpos": 551,
"width": 149,
"type": "match",
"height": 93
}
],
"properties": [],
"tags": [
"loupe_image_rotated_left"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 354,
"ypos": 544,
"width": 149,
"height": 93,
"type": "match",
"match": 90
}
],
"properties": [],
"tags": [
"loupe_image_rotated_left"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 438,
"ypos": 235,
"width": 212,
"height": 165,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_image_zoomed_in"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 794,
"ypos": 512,
"width": 57,
"height": 204,
"type": "match",
"match": 90
}
],
"properties": [],
"tags": [
"loupe_img_info"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 804,
"ypos": 296,
"width": 140,
"height": 24,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_menu_set_wallpaper"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 263,
"width": 43,
"type": "match",
"height": 19,
"xpos": 695
}
],
"properties": [],
"tags": [
"loupe_set_wallpaper"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 810,
"ypos": 299,
"width": 119,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_set_wallpaper"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 525,
"ypos": 667,
"width": 18,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_shortcuts_alt_page"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

View File

@ -0,0 +1,22 @@
{
"area": [
{
"xpos": 206,
"ypos": 151,
"width": 88,
"height": 18,
"type": "match"
},
{
"xpos": 486,
"ypos": 151,
"width": 125,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_shortcuts_alt_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

View File

@ -0,0 +1,22 @@
{
"area": [
{
"xpos": 210,
"ypos": 152,
"width": 113,
"height": 19,
"type": "match"
},
{
"xpos": 577,
"ypos": 151,
"width": 65,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"loupe_shortcuts_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 794,
"ypos": 193,
"width": 79,
"height": 140,
"type": "match",
"match": 90
}
],
"properties": [],
"tags": [
"loupe_side_panel"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1286,6 +1286,21 @@
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"loupe": {
"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/loupe",
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"desktop_update_graphical": {
"profiles": {
"fedora-KDE-live-iso-x86_64-*-64bit": 32,

View File

@ -0,0 +1,50 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This script will download the test data for EoG, start the application,
# and set a milestone as a starting point for the other Loupe 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("eog", "Pictures");
# Exit the terminal
desktop_vt;
# Start the application
menu_launch_type("image viewer");
# Check that is started
assert_screen 'apps_run_imageviewer';
# Fullsize the Loupe window.
send_key("super-up");
# Open the test file to create a starting point for the other EoG tests.
send_key("ctrl-o");
# Open the Pictures folder.
assert_and_click("gnome_dirs_pictures", button => "left", timeout => 30);
# Select the image.jpg file.
assert_and_click("loupe_file_select_jpg", button => "left", timeout => 30);
# Hit enter to open it.
send_key("ret");
# Check that the file has been successfully opened.
assert_screen("loupe_image_default");
}
sub test_flags {
return {fatal => 1, milestone => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,27 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part tests if EoG can show the About window.
sub run {
my $self = shift;
# Open the menu
send_key("f10");
# Click on the About item
assert_and_click("loupe_menu_about");
assert_screen("loupe_about_shown");
# Click on Credits
assert_and_click("loupe_about_credits");
assert_screen("loupe_credits_shown");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,30 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part tests if the application basic layout shows basic info.
sub run {
my $self = shift;
# Check that the picture name is shown
assert_screen "loupe_picture_name";
# Check that the Side panel is visible, try to make it visible if it is not.
if (!check_screen("loupe_side_panel")) {
send_key("f9");
}
assert_screen("loupe_side_panel");
# Check that info on side panel is correct
assert_screen("loupe_img_info");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,25 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part tests if the application can navigate through the current folder.
sub run {
my $self = shift;
# Go to next picture.
send_key("right");
assert_screen("loupe_image_next", timeout => 90);
# Go to previous picture
send_key("left");
assert_and_click("loupe_image_default", timeout => 90);
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,28 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part tests if the application can be switched to full screen.
sub run {
my $self = shift;
# Toggle full screen
send_key("f11");
wait_still_screen 2;
assert_screen("loupe_fullscreen_on");
# Return to normal mode
send_key("f11");
wait_still_screen 2;
assert_screen("loupe_image_default");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,26 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part tests if the application can show help.
sub run {
my $self = shift;
sleep 2;
# Open the shortcuts
send_key("f1");
assert_screen("loupe_help_shown", timeout => 120);
# Try another screen
assert_and_click("loupe_help_image_view", timeout => 60);
assert_screen("loupe_help_view_shown");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,31 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part tests if the application can put an image as a wallpaper.
sub run {
my $self = shift;
sleep 2;
# Go to the menu
send_key("f10");
# Set as background
assert_and_click("loupe_menu_set_wallpaper");
# Confirm
assert_and_click("loupe_set_wallpaper");
# Close the application
send_key("alt-f4");
# Check that the wallpaper was set
assert_screen("loupe_image_background");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,27 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part tests if the application can rotate the displayed picture.
sub run {
my $self = shift;
# Rotate left
send_key("shift-ctrl-r");
wait_still_screen(3);
assert_screen("loupe_image_rotated_left");
# Rotate right
send_key("ctrl-r");
wait_still_screen(3);
assert_and_click("loupe_image_default");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,26 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part tests if the application can show the shortcuts.
sub run {
my $self = shift;
sleep 2;
# Open the shortcuts
send_key("ctrl-?");
assert_screen("loupe_shortcuts_shown");
# Try another screen
assert_and_click("loupe_shortcuts_alt_page");
assert_screen("loupe_shortcuts_alt_shown");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,27 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This part tests if the application can change the zoom for the displayed picture.
sub run {
my $self = shift;
sleep 2;
assert_screen("loupe_image_default");
# Let us increase the image using the plus key
mouse_set("500", "350");
send_key("+");
send_key("+");
wait_still_screen(2);
assert_screen("loupe_image_zoomed_in");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et: