diff --git a/tests/applications/okular/change_zoom.pm b/tests/applications/okular/change_zoom.pm index 587863a8..bf53749b 100644 --- a/tests/applications/okular/change_zoom.pm +++ b/tests/applications/okular/change_zoom.pm @@ -9,11 +9,13 @@ sub run { my $self = shift; - # Click on zoom menu to open choices. + # Click on zoom menu and select the content. assert_and_click("okular_change_zoom", button => "left", timeout => 30); + send_key("ctrl-a"); # Select 200%. - assert_and_click("okular_select_zoom_200", button => "left", timeout => 30); + type_very_safely("200"); + send_key("ret"); # Check that the document zoom was changed. assert_screen("okular_document_zoom_200"); diff --git a/tests/applications/okular/dual_mode.pm b/tests/applications/okular/dual_mode.pm index e8685406..0bf743fb 100644 --- a/tests/applications/okular/dual_mode.pm +++ b/tests/applications/okular/dual_mode.pm @@ -8,11 +8,13 @@ use utils; sub run { my $self = shift; - # Click on the Zoom menu to change a different zoom for next steps. + # 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. - assert_and_click("okular_select_zoom_fitwidth", button => "left", timeout => 30); + type_very_safely("fit width"); + send_key("ret"); # Enter the menu assert_and_click("okular_view_mode", button => "left", timeout => 30); diff --git a/tests/applications/okular/help.pm b/tests/applications/okular/help.pm index 25e8df9b..6305c28d 100644 --- a/tests/applications/okular/help.pm +++ b/tests/applications/okular/help.pm @@ -8,16 +8,12 @@ use utils; 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); + # Open Help. + send_key("f1"); wait_still_screen 2; # Check that Help has been shown. - assert_screen("evince_help_shown", timeout => 30); + assert_screen("okular_help_shown", timeout => 30); } sub test_flags { diff --git a/tests/applications/okular/night_mode.pm b/tests/applications/okular/night_mode.pm deleted file mode 100644 index 5a69d5b5..00000000 --- a/tests/applications/okular/night_mode.pm +++ /dev/null @@ -1,30 +0,0 @@ -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; diff --git a/tests/applications/okular/presentation.pm b/tests/applications/okular/presentation.pm new file mode 100644 index 00000000..c45ead0d --- /dev/null +++ b/tests/applications/okular/presentation.pm @@ -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; diff --git a/tests/applications/okular/properties.pm b/tests/applications/okular/properties.pm index ab16679b..6aa4cf3d 100644 --- a/tests/applications/okular/properties.pm +++ b/tests/applications/okular/properties.pm @@ -9,15 +9,15 @@ sub run { my $self = shift; # Open the menu. - assert_and_click("gnome_burger_menu", button => "left", timeout => 30); + assert_and_click("kde_mainmenu_file", button => "left", timeout => 30); wait_still_screen 2; # Select the Properties item. - assert_and_click("evince_menu_properties", button => "left", timeout => 30); + assert_and_click("okular_menu_properties", button => "left", timeout => 30); wait_still_screen 2; # Check that Properties are shown. - assert_screen("evince_properties_shown", timeout => 30); + assert_screen("okular_properties_shown", timeout => 30); } sub test_flags { diff --git a/tests/applications/okular/rotate.pm b/tests/applications/okular/rotate.pm index f9e73588..47ed18c9 100644 --- a/tests/applications/okular/rotate.pm +++ b/tests/applications/okular/rotate.pm @@ -8,7 +8,9 @@ use utils; sub rotate_content { # Send the key combo to rotate the content - send_key("ctrl-right"); + assert_and_click("okular_menu_view"); + assert_and_click("okular_submenu_orientation"); + assert_and_click("okular_submenu_rotate"); } sub run { @@ -18,13 +20,13 @@ sub run { rotate_content(); # Check that the window content has been rotated. - assert_screen("evince_content_rotated_once", timeout => 30); + assert_screen("okular_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); + assert_screen("okular_content_rotated_twice", timeout => 30); } sub test_flags {