diff --git a/check-needles.py b/check-needles.py index e9821131..615204d1 100755 --- a/check-needles.py +++ b/check-needles.py @@ -218,7 +218,10 @@ testtags.extend(f"anaconda_help_{fsys}" for fsys in ('install_destination', 'installation_progress', 'keyboard_layout', 'language_support', 'network_host_name', 'root_password', 'select_packages', 'installation_source', 'time_date', 'user_creation', 'language_selection', 'language', 'summary_link')) - +# for Gnome navigation test +for app in ("clocks", "firefox", "fonts", "terminal", "editor"): + testtags.append(f"navigation_navibar_{app}") +testtags.append("navigation_terminal_fullscreen") testtags.extend(f"anaconda_main_hub_{fsys}" for fsys in ('language_support', 'selec_packages', 'time_date', 'create_user','keyboard_layout')) diff --git a/lib/utils.pm b/lib/utils.pm index 2806290b..972db9aa 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -1709,4 +1709,23 @@ sub set_update_notification_timestamp { type_very_safely("gsettings set org.gnome.software update-notification-timestamp $ep_time\n"); } +# This routine takes a list of applications. It will then use the terminal +# to start all these applications in the background and then it will exit the +# terminal. This is useful when we want to start multiple applications quickly. +sub start_applications { + my @applications = @_; + # Open the terminal + menu_launch_type("terminal"); + wait_still_screen(2); + # Iterate over the application list + # and start each application from it. + foreach (@applications) { + assert_script_run("$_ &"); + # Take some time for things to settle. + wait_still_screen(1); + } + # Exit the terminal. + enter_cmd("exit"); +} + 1; diff --git a/needles/firefox/firefox-20210607.json b/needles/firefox/firefox-20210607.json index 3ba5ce06..d247182d 100644 --- a/needles/firefox/firefox-20210607.json +++ b/needles/firefox/firefox-20210607.json @@ -25,6 +25,7 @@ "properties": [], "tags": [ "firefox", - "browser" + "browser", + "apps_run_firefox" ] -} \ No newline at end of file +} diff --git a/needles/gnome/apps/apps_run_clocks-20220818.json b/needles/gnome/apps/apps_run_clocks-20220818.json index 2ad48441..a84da1d0 100644 --- a/needles/gnome/apps/apps_run_clocks-20220818.json +++ b/needles/gnome/apps/apps_run_clocks-20220818.json @@ -12,4 +12,4 @@ "tags": [ "apps_run_clocks" ] -} \ No newline at end of file +} diff --git a/needles/gnome/apps/apps_run_texteditor-20220818.json b/needles/gnome/apps/apps_run_texteditor-20220818.json index 7cf4f152..f776e166 100644 --- a/needles/gnome/apps/apps_run_texteditor-20220818.json +++ b/needles/gnome/apps/apps_run_texteditor-20220818.json @@ -10,6 +10,7 @@ ], "properties": [], "tags": [ - "apps_run_texteditor" + "apps_run_texteditor", + "apps_run_editor" ] -} \ No newline at end of file +} diff --git a/needles/gnome/apps/apps_run_texteditor-20230703.json b/needles/gnome/apps/apps_run_texteditor-20230703.json index fc5fb9e3..e452a314 100644 --- a/needles/gnome/apps/apps_run_texteditor-20230703.json +++ b/needles/gnome/apps/apps_run_texteditor-20230703.json @@ -10,6 +10,7 @@ ], "properties": [], "tags": [ - "apps_run_texteditor" + "apps_run_texteditor", + "apps_run_editor" ] -} \ No newline at end of file +} diff --git a/needles/gnome/apps/gnome-panel/panel_ctrl_networks_inactive-20240110.json b/needles/gnome/apps/gnome-panel/panel_ctrl_networks_inactive-20240110.json index 6a6950fe..c6559e25 100644 --- a/needles/gnome/apps/gnome-panel/panel_ctrl_networks_inactive-20240110.json +++ b/needles/gnome/apps/gnome-panel/panel_ctrl_networks_inactive-20240110.json @@ -12,4 +12,4 @@ "tags": [ "panel_ctrl_networks" ] -} \ No newline at end of file +} diff --git a/needles/gnome/apps/navigation/navigation_details_shown.json b/needles/gnome/apps/navigation/navigation_details_shown.json new file mode 100644 index 00000000..82009d72 --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_details_shown.json @@ -0,0 +1,22 @@ +{ + "area": [ + { + "xpos": 480, + "ypos": 561, + "width": 103, + "height": 138, + "type": "match" + }, + { + "xpos": 557, + "ypos": 424, + "width": 51, + "height": 34, + "type": "match" + } + ], + "properties": [], + "tags": [ + "navigation_details_shown" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_details_shown.png b/needles/gnome/apps/navigation/navigation_details_shown.png new file mode 100644 index 00000000..e92d3183 Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_details_shown.png differ diff --git a/needles/gnome/apps/navigation/navigation_editor_fullscreen-20230929.json b/needles/gnome/apps/navigation/navigation_editor_fullscreen-20230929.json new file mode 100644 index 00000000..b40d47db --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_editor_fullscreen-20230929.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "ypos": 1, + "type": "match", + "xpos": 6, + "height": 67, + "width": 82 + } + ], + "properties": [], + "tags": [ + "navigation_editor_fullscreen" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_editor_fullscreen-20230929.png b/needles/gnome/apps/navigation/navigation_editor_fullscreen-20230929.png new file mode 100644 index 00000000..f9d8a12a Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_editor_fullscreen-20230929.png differ diff --git a/needles/gnome/apps/navigation/navigation_editor_fullscreen-silverblue-20230929.json b/needles/gnome/apps/navigation/navigation_editor_fullscreen-silverblue-20230929.json new file mode 100644 index 00000000..c4fd5be3 --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_editor_fullscreen-silverblue-20230929.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 6, + "height": 67, + "width": 82, + "type": "match", + "ypos": 1 + } + ], + "properties": [], + "tags": [ + "navigation_editor_fullscreen" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_editor_fullscreen-silverblue-20230929.png b/needles/gnome/apps/navigation/navigation_editor_fullscreen-silverblue-20230929.png new file mode 100644 index 00000000..c963d9f0 Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_editor_fullscreen-silverblue-20230929.png differ diff --git a/needles/gnome/apps/navigation/navigation_editor_fullscreen.json b/needles/gnome/apps/navigation/navigation_editor_fullscreen.json new file mode 100644 index 00000000..24816715 --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_editor_fullscreen.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "navigation_editor_fullscreen" + ], + "area": [ + { + "xpos": 6, + "ypos": 1, + "width": 82, + "height": 67, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_editor_fullscreen.png b/needles/gnome/apps/navigation/navigation_editor_fullscreen.png new file mode 100644 index 00000000..ca2e2859 Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_editor_fullscreen.png differ diff --git a/needles/gnome/apps/navigation/navigation_firefox_fullscreen.json b/needles/gnome/apps/navigation/navigation_firefox_fullscreen.json new file mode 100644 index 00000000..48fd434d --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_firefox_fullscreen.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "navigation_firefox_fullscreen" + ], + "area": [ + { + "xpos": 101, + "ypos": 11, + "width": 108, + "height": 56, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_firefox_fullscreen.png b/needles/gnome/apps/navigation/navigation_firefox_fullscreen.png new file mode 100644 index 00000000..3787f199 Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_firefox_fullscreen.png differ diff --git a/needles/gnome/apps/navigation/navigation_navibar_clocks.json b/needles/gnome/apps/navigation/navigation_navibar_clocks.json new file mode 100644 index 00000000..6a983fc5 --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_navibar_clocks.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 449, + "ypos": 352, + "width": 125, + "height": 32, + "type": "match" + } + ], + "properties": [], + "tags": [ + "navigation_navibar_clocks" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_navibar_clocks.png b/needles/gnome/apps/navigation/navigation_navibar_clocks.png new file mode 100644 index 00000000..6459fcec Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_navibar_clocks.png differ diff --git a/needles/gnome/apps/navigation/navigation_navibar_editor.json b/needles/gnome/apps/navigation/navigation_navibar_editor.json new file mode 100644 index 00000000..074ca8e5 --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_navibar_editor.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 736, + "ypos": 353, + "width": 121, + "height": 50, + "type": "match" + } + ], + "properties": [], + "tags": [ + "navigation_navibar_editor" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_navibar_editor.png b/needles/gnome/apps/navigation/navigation_navibar_editor.png new file mode 100644 index 00000000..db355986 Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_navibar_editor.png differ diff --git a/needles/gnome/apps/navigation/navigation_navibar_firefox.json b/needles/gnome/apps/navigation/navigation_navibar_firefox.json new file mode 100644 index 00000000..2012cf7e --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_navibar_firefox.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 737, + "ypos": 341, + "width": 121, + "height": 34, + "type": "match" + } + ], + "properties": [], + "tags": [ + "navigation_navibar_firefox" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_navibar_firefox.png b/needles/gnome/apps/navigation/navigation_navibar_firefox.png new file mode 100644 index 00000000..a97e126b Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_navibar_firefox.png differ diff --git a/needles/gnome/apps/navigation/navigation_navibar_terminal.json b/needles/gnome/apps/navigation/navigation_navibar_terminal.json new file mode 100644 index 00000000..e22d4034 --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_navibar_terminal.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 594, + "ypos": 341, + "width": 122, + "height": 34, + "type": "match" + } + ], + "properties": [], + "tags": [ + "navigation_navibar_terminal" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_navibar_terminal.png b/needles/gnome/apps/navigation/navigation_navibar_terminal.png new file mode 100644 index 00000000..1bf8febc Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_navibar_terminal.png differ diff --git a/needles/gnome/apps/navigation/navigation_terminal_fullscreen-20230929.json b/needles/gnome/apps/navigation/navigation_terminal_fullscreen-20230929.json new file mode 100644 index 00000000..c901b949 --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_terminal_fullscreen-20230929.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "width": 77, + "ypos": 0, + "height": 22, + "xpos": 36, + "type": "match" + } + ], + "properties": [], + "tags": [ + "navigation_terminal_fullscreen" + ] +} diff --git a/needles/gnome/apps/navigation/navigation_terminal_fullscreen-20230929.png b/needles/gnome/apps/navigation/navigation_terminal_fullscreen-20230929.png new file mode 100644 index 00000000..4eac788e Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_terminal_fullscreen-20230929.png differ diff --git a/needles/gnome/apps/navigation/navigation_three_workspaces.json b/needles/gnome/apps/navigation/navigation_three_workspaces.json new file mode 100644 index 00000000..5542ce11 --- /dev/null +++ b/needles/gnome/apps/navigation/navigation_three_workspaces.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 448, + "ypos": 99, + "width": 127, + "height": 38, + "type": "match" + } + ], + "properties": [], + "tags": [ + "navigation_three_workspaces" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/navigation/navigation_three_workspaces.png b/needles/gnome/apps/navigation/navigation_three_workspaces.png new file mode 100644 index 00000000..10d2eb29 Binary files /dev/null and b/needles/gnome/apps/navigation/navigation_three_workspaces.png differ diff --git a/templates.fif.json b/templates.fif.json index 3fdcd02a..8986ed77 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -1257,6 +1257,23 @@ "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" } }, + "navigation": { + "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-upgrade-x86_64-*-64bit": 40, + "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22 + }, + "settings": { + "BOOTFROM": "c", + "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2", + "POSTINSTALL_PATH": "tests/applications/navigation", + "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" + } + }, "gnome_text_editor": { "profiles": { "fedora-Silverblue-dvd_ostree-iso-ppc64le-*-ppc64le": 50, diff --git a/tests/applications/navigation/aaa_setup.pm b/tests/applications/navigation/aaa_setup.pm new file mode 100644 index 00000000..7bc50bc1 --- /dev/null +++ b/tests/applications/navigation/aaa_setup.pm @@ -0,0 +1,38 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# We will start two applications and save the progress. + +sub run { + my $self = shift; + # Let us wait here for a couple of seconds to give the VM time to settle. + # Starting right over might result in erroneous behavior. + sleep(5); + # Start Firefox + menu_launch_type("firefox"); + assert_screen "apps_run_firefox", 45; + # firefox is quite grindy on startup, let it settle + wait_still_screen(stilltime => 5, similarity_level => 45); + send_key("super-up"); + assert_screen("navigation_firefox_fullscreen"); + + # Start Gnome Text Editor + menu_launch_type("text-editor"); + assert_screen("apps_run_editor"); + wait_still_screen(2); + send_key("super-up"); + assert_screen("navigation_editor_fullscreen"); +} + +sub test_flags { + return {fatal => 1, milestone => 1}; +} + +1; + +# vim: set sw=4 et: + + + diff --git a/tests/applications/navigation/navigation_details.pm b/tests/applications/navigation/navigation_details.pm new file mode 100644 index 00000000..e4190e10 --- /dev/null +++ b/tests/applications/navigation/navigation_details.pm @@ -0,0 +1,40 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# This will test that user can trigger a detailed view of the +# navigation icons using the ~ key. + +sub run { + my $self = shift; + # Let us wait here for a couple of seconds to give the VM time to settle. + # Starting right over might result in erroneous behavior. + sleep(5); + + # If we are at Firefox switch to editor + if (check_screen("apps_run_firefox")) { + send_key("alt-tab"); + assert_screen "apps_run_editor"; + } + + # Use alt-tab to navigate to the other + # application, but trigger the overview + # page as well and make sure it is shown. + hold_key("alt"); + send_key("tab"); + send_key("~"); + assert_screen("navigation_details_shown"); + release_key("alt"); +} + +sub test_flags { + return {always_rollback => 1}; +} + +1; + +# vim: set sw=4 et: + + + diff --git a/tests/applications/navigation/switch_application.pm b/tests/applications/navigation/switch_application.pm new file mode 100644 index 00000000..41eb7e57 --- /dev/null +++ b/tests/applications/navigation/switch_application.pm @@ -0,0 +1,136 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# This will test that user can switch between two applications +# using the navigation combo Alt-tab. + +sub start_maxed { + my $app = shift; + menu_launch_type($app); + assert_screen ["apps_run_$app", "grant_access"]; + # give access rights if asked + if (match_has_tag "grant_access") { + click_lastmatch; + assert_screen "apps_run_$app"; + } + wait_still_screen(3); + wait_screen_change { send_key("super-up"); }; + wait_still_screen(2); +} + +sub switch_to_app { + # This will use Alt-tab to switch to the desired application. + # Use the name of the application and the direction in which + # the search should be performed, either forward or backward. + my ($application, $dir, $fullscreen) = @_; + # If we want to search backwards, we will hold the shift key. + if ($dir eq "backward") { + hold_key("shift"); + } + # Then we hold the alt key to either form shift-alt or just alt + # key combo. + hold_key("alt"); + # We will send tab, until we have arrived at the correct icon + send_key_until_needlematch("navigation_navibar_$application", "tab", 10); + # We will release the alt key. + release_key("alt"); + # + if ($dir eq "backward") { + release_key("shift"); + } + my $needle = $fullscreen ? "navigation_${application}_fullscreen" : "apps_run_${application}"; + assert_screen($needle); + if ($fullscreen) { + die "Not fullscreen!" if (check_screen("apps_menu_button")); + } +} + +sub check_hidden { + # This function checks that the application + # is no longer fully displayed on the screen, + # because it has been hidden (minimized). + my $app = shift; + # First, let us wait until the screen settles. + wait_still_screen(3); + # If the application is still shown, let's die. + die("The application seems not to have been minimized.") if (check_screen("apps_run_$app")); +} + +sub run { + my $self = shift; + + ### Switch between two applications + # From the setup script, we should be seeing the editor + # window. + # Switch to the other application. + send_key("alt-tab"); + assert_screen("apps_run_firefox"); + + # Switch back + send_key("alt-tab"); + assert_screen("apps_run_editor"); + + ### Switch between more applications + + # Start more applications. + start_maxed("clocks"); + start_maxed("calculator"); + start_maxed("terminal"); + + ## Going forwards + # Switch to Calculator using alt-tab + switch_to_app("calculator", "forward"); + # Switch to Clocks using alt-tab + switch_to_app("clocks", "forward"); + + ## Going backwards + # Switch to Firefox using shift-alt-tab + switch_to_app("firefox", "backward"); + # Switch to Terminal using shift-alt-tab + switch_to_app("terminal", "backward"); + + ### Switch to and from a full screen application + # We will make Terminal to full screen + send_key("f11"); + + # Switch to Editor + switch_to_app("editor", "forward"); + + # Switch to Terminal (fullscreen) + switch_to_app("terminal", "backward", 1); + + # Switch to Editor + switch_to_app("editor", "forward"); + + ### Switch between minimised apps. + # Minimise Editor + send_key("super-h"); + # Check that the application has minimised. + check_hidden("editor"); + + # Switch to Clocks + switch_to_app("clocks", "forward"); + # Minimise Clocks + send_key("super-h"); + # Check that the application has minimised. + check_hidden("clocks"); + + # Switch to Editor + switch_to_app("editor", "forward"); + + # Switch to Clocks + switch_to_app("clocks", "forward"); +} + +sub test_flags { + return {always_rollback => 1}; +} + +1; + +# vim: set sw=4 et: + + + diff --git a/tests/applications/navigation/switch_workplaces.pm b/tests/applications/navigation/switch_workplaces.pm new file mode 100644 index 00000000..7c6e83c4 --- /dev/null +++ b/tests/applications/navigation/switch_workplaces.pm @@ -0,0 +1,65 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# This will test that user can switch between two workspaces, +# that we can move an application to another workspace. + +sub move_to_workspace { + # This will use Shift-Ctrl-Alt to move the focused app to + # the $direction (left or right). + my $direction = shift; + wait_screen_change { send_key("shift-ctrl-alt-$direction"); }; + wait_still_screen 5; +} + +sub switch_to_workspace { + # This will use Ctrl-Alt to switch to another workspace + # using the $direction (left, right) + my $direction = shift; + wait_screen_change { send_key("ctrl-alt-$direction"); }; + wait_still_screen 5; +} + +sub run { + my $self = shift; + # Let us wait here for a couple of seconds to give the VM time to settle. + # Starting right over might result in erroneous behavior. + sleep(5); + + # The focused application should be the Editor, so let's check it is + # visible on the beginning screen. Then switch to another workplace. + # This one should be empty, therefore checking for the Editor should fail. + # The opposite will be true, when we switch back + assert_screen("apps_run_editor"); + switch_to_workspace("right"); + die("The workspaces were not switched!") if (check_screen("apps_run_editor")); + + switch_to_workspace("left"); + die("The workspaces were not switched") unless (check_screen("apps_run_editor")); + + # Now, we will move the focused application (Editor) to the second workspace. + # The application will be still visible there. When we switch back, the application + # will no longer be visible on the first workspace and will uncover Firefox and + # we check that it is there. We will also enter the Activitities mode and will check + # that currently three workspaces can be used (top bar of the screen). + move_to_workspace("right"); + die("The application was not moved!") unless (check_screen("apps_run_editor")); + switch_to_workspace("left"); + die("The workspaces were not switched") unless (check_screen("apps_run_firefox")); + send_key("super"); + wait_still_screen(2); + assert_screen("navigation_three_workspaces"); +} + +sub test_flags { + return {always_rollback => 1}; +} + +1; + +# vim: set sw=4 et: + + +