#306 Create a test suite for Loupe (Image Viewer)
Merged 2 years ago by adamwill. Opened 2 years ago by lruzicka.

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 353,

+       "ypos": 610,

+       "width": 57,

+       "height": 21,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_about_credits"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 418,

+       "ypos": 207,

+       "width": 186,

+       "height": 101,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_about_shown"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -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"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 254,

+       "ypos": 379,

+       "width": 72,

+       "height": 22,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_file_select_jpg"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 147,

+       "ypos": 178,

+       "width": 239,

+       "height": 154,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_fullscreen_on"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 519,

+       "ypos": 481,

+       "width": 129,

+       "height": 22,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_help_image_view"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 10,

+       "ypos": 112,

+       "width": 274,

+       "height": 30,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_help_shown"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,16 @@ 

+ {

+   "area": [

+     {

+       "xpos": 6,

+       "ypos": 155,

+       "width": 260,

+       "height": 44,

+       "type": "match",

+       "match": 90

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_help_view_shown"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 7,

+       "ypos": 1,

+       "width": 81,

+       "height": 106,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_image_background"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 75,

+       "ypos": 167,

+       "width": 308,

+       "height": 211,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_image_default"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,16 @@ 

+ {

+   "area": [

+     {

+       "xpos": 483,

+       "ypos": 327,

+       "width": 261,

+       "height": 159,

+       "type": "match",

+       "match": 90

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_image_next"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 337,

+       "ypos": 525,

+       "width": 149,

+       "height": 111,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_image_rotated_left"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 438,

+       "ypos": 235,

+       "width": 212,

+       "height": 165,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_image_zoomed_in"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,16 @@ 

+ {

+   "area": [

+     {

+       "xpos": 794,

+       "ypos": 512,

+       "width": 57,

+       "height": 204,

+       "type": "match",

+       "match": 90

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_img_info"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 806,

+       "ypos": 409,

+       "width": 134,

+       "height": 16,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_menu_about"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 804,

+       "ypos": 296,

+       "width": 140,

+       "height": 24,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_menu_set_wallpaper"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 475,

+       "ypos": 46,

+       "width": 73,

+       "height": 22,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_picture_name"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 700,

+       "ypos": 263,

+       "width": 35,

+       "height": 20,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_set_wallpaper"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 525,

+       "ypos": 667,

+       "width": 18,

+       "height": 18,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_shortcuts_alt_page"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -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"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -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"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,16 @@ 

+ {

+   "area": [

+     {

+       "xpos": 794,

+       "ypos": 193,

+       "width": 79,

+       "height": 140,

+       "type": "match",

+       "match": 90

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "loupe_side_panel"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 696,

+       "ypos": 123,

+       "height": 21,

+       "width": 26,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "gnome_burger_menu"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 11,

+       "ypos": 283,

+       "width": 20,

+       "height": 17,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "gnome_dirs_pictures"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
file modified
+15
@@ -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,

@@ -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:

@@ -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:

@@ -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:

@@ -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:

@@ -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:

@@ -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:

@@ -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:

@@ -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:

@@ -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:

@@ -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:

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.

rebased onto 33f325e8be6d7d4784a47904896b7ec39d5254fa

2 years ago

rebased onto 014b5d4906e168a4fefd9e5aec63d7803f570371

2 years ago

rebased onto 9e0d744

2 years ago

I think the loupe_set_wallpaper needle should be deleted and loupe_set_wallpaper-20230918 renamed to loupe_set_wallpaper. The current loupe_set_wallpaper needle seems to be a dupe of the loupe_menu_set_wallpaper needle and will never actually match, because when we look for the loupe_set_wallpaper tag we're looking for the final dialog, not the menu entry.

Other than that I think this looks good...seems weird that we need new variants of some common needles here, but I guess if the existing variants matched then you wouldn't have added them. Do we know why we need three different image_rotated_left needles?

Thanks!

1 new commit added

  • Replace an incorrect needle with a correct one.
2 years ago

1 new commit added

  • Only choose one rotated_left needle.
2 years ago

I tried to delete the extra needle versions for the left rotation and it seems to be ok with just one needle. I also renamed the mentioned needle to make it right.

OK, looks great. Let's merge it and if it turns out we needed the extra rotation needles for any reason we can easily add them back.

Pull-Request has been merged by adamwill

2 years ago
Metadata
Changes Summary 59
+15
file added
needles/gnome/apps/loupe/loupe_about_credits.json
+0
file added
needles/gnome/apps/loupe/loupe_about_credits.png
+15
file added
needles/gnome/apps/loupe/loupe_about_shown.json
+0
file added
needles/gnome/apps/loupe/loupe_about_shown.png
+22
file added
needles/gnome/apps/loupe/loupe_credits_shown.json
+0
file added
needles/gnome/apps/loupe/loupe_credits_shown.png
+15
file added
needles/gnome/apps/loupe/loupe_file_select_jpg.json
+0
file added
needles/gnome/apps/loupe/loupe_file_select_jpg.png
+15
file added
needles/gnome/apps/loupe/loupe_fullscreen_on.json
+0
file added
needles/gnome/apps/loupe/loupe_fullscreen_on.png
+15
file added
needles/gnome/apps/loupe/loupe_help_image_view.json
+0
file added
needles/gnome/apps/loupe/loupe_help_image_view.png
+15
file added
needles/gnome/apps/loupe/loupe_help_shown.json
+0
file added
needles/gnome/apps/loupe/loupe_help_shown.png
+16
file added
needles/gnome/apps/loupe/loupe_help_view_shown.json
+0
file added
needles/gnome/apps/loupe/loupe_help_view_shown.png
+15
file added
needles/gnome/apps/loupe/loupe_image_background.json
+0
file added
needles/gnome/apps/loupe/loupe_image_background.png
+15
file added
needles/gnome/apps/loupe/loupe_image_default.json
+0
file added
needles/gnome/apps/loupe/loupe_image_default.png
+16
file added
needles/gnome/apps/loupe/loupe_image_next.json
+0
file added
needles/gnome/apps/loupe/loupe_image_next.png
+15
file added
needles/gnome/apps/loupe/loupe_image_rotated_left.json
+0
file added
needles/gnome/apps/loupe/loupe_image_rotated_left.png
+15
file added
needles/gnome/apps/loupe/loupe_image_zoomed_in.json
+0
file added
needles/gnome/apps/loupe/loupe_image_zoomed_in.png
+16
file added
needles/gnome/apps/loupe/loupe_img_info.json
+0
file added
needles/gnome/apps/loupe/loupe_img_info.png
+15
file added
needles/gnome/apps/loupe/loupe_menu_about.json
+0
file added
needles/gnome/apps/loupe/loupe_menu_about.png
+15
file added
needles/gnome/apps/loupe/loupe_menu_set_wallpaper.json
+0
file added
needles/gnome/apps/loupe/loupe_menu_set_wallpaper.png
+15
file added
needles/gnome/apps/loupe/loupe_picture_name.json
+0
file added
needles/gnome/apps/loupe/loupe_picture_name.png
+15
file added
needles/gnome/apps/loupe/loupe_set_wallpaper.json
+0
file added
needles/gnome/apps/loupe/loupe_set_wallpaper.png
+15
file added
needles/gnome/apps/loupe/loupe_shortcuts_alt_page.json
+0
file added
needles/gnome/apps/loupe/loupe_shortcuts_alt_page.png
+22
file added
needles/gnome/apps/loupe/loupe_shortcuts_alt_shown.json
+0
file added
needles/gnome/apps/loupe/loupe_shortcuts_alt_shown.png
+22
file added
needles/gnome/apps/loupe/loupe_shortcuts_shown.json
+0
file added
needles/gnome/apps/loupe/loupe_shortcuts_shown.png
+16
file added
needles/gnome/apps/loupe/loupe_side_panel.json
+0
file added
needles/gnome/apps/loupe/loupe_side_panel.png
+15
file added
needles/gnome/gnome_burger_menu_dark.json
+0
file added
needles/gnome/gnome_burger_menu_dark.png
+15
file added
needles/gnome/gnome_dirs_pictures.json
+0
file added
needles/gnome/gnome_dirs_pictures.png
+15 -0
file changed
templates.fif.json
+50
file added
tests/applications/loupe/aaa_setup.pm
+27
file added
tests/applications/loupe/about.pm
+30
file added
tests/applications/loupe/basic_view.pm
+25
file added
tests/applications/loupe/browse.pm
+28
file added
tests/applications/loupe/fullscreen.pm
+26
file added
tests/applications/loupe/help.pm
+31
file added
tests/applications/loupe/pic_to_wallpaper.pm
+27
file added
tests/applications/loupe/rotate.pm
+26
file added
tests/applications/loupe/shortcuts.pm
+27
file added
tests/applications/loupe/zoom.pm