1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-07-29 21:25:44 +00:00
os-autoinst-distri-fedora/tests/applications/navigation/navigation_details.pm
Lukáš Růžička 653fb2938f Enhance the menu_launch_type subroutine.
The previous version of menu_launch_type took the name of the
application as an argument and it started the application.
To maximize the application or to check that it has started indeed
we had to do it manually.

Now, the application also takes "maximize => 1" or "checkstart => 1"
to maximize the application or check that it has started as optional
arguments to avoid doing it manually, while it still accepts just
the name of the application and behaves like it did before.

Note that if you decide to use the checkstart argument, you
also need to update the check-needles.py script to whitelist
the application needle tag, see the example test scripts
attached to this PR.

Fixes: https://pagure.io/fedora-qa/os-autoinst-distri-fedora/issue/329
2025-03-05 19:59:40 +00:00

54 lines
1.4 KiB
Perl

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);
menu_launch_type("text editor", maximize => 1);
assert_screen("apps_run_texteditor");
menu_launch_type("files", maximize => 1);
assert_screen("apps_run_files");
# If we are at Nautilus switch to editor
if (check_screen("apps_run_files")) {
send_key("alt-tab");
assert_screen "apps_run_texteditor";
}
# 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("~");
# Sometimes, the details take a time to load,
# if that happens, fail softly.
unless (check_screen('navigation_details_shown', timeout => 30)) {
if (check_screen('navigation_details_notloaded')) {
record_soft_failure('Window details not loaded in time.');
}
}
else {
assert_screen("navigation_details_shown", timeout => 60);
}
release_key("alt");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et: