| |
@@ -6,7 +6,7 @@
|
| |
use Exporter;
|
| |
use lockapi;
|
| |
use testapi qw(is_serial_terminal :DEFAULT);
|
| |
- our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type setup_repos repo_setup get_workarounds disable_updates_repos cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop quit_firefox advisory_get_installed_packages acnp_handle_output advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications desktop_launch_terminal solidify_wallpaper check_and_install_git download_testdata make_serial_writable set_update_notification_timestamp kde_doublek_workaround dm_perform_login/;
|
| |
+ our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type setup_repos repo_setup get_workarounds disable_updates_repos cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop quit_firefox advisory_get_installed_packages acnp_handle_output advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications desktop_launch_terminal solidify_wallpaper check_and_install_git download_testdata make_serial_writable set_update_notification_timestamp kde_doublek_workaround dm_perform_login check_software_start/;
|
| |
|
| |
|
| |
# We introduce this global variable to hold the list of applications that have
|
| |
@@ -1370,27 +1370,43 @@
|
| |
# Launch an application in a graphical environment, by opening a
|
| |
# launcher, typing the specified string and hitting enter. Pass
|
| |
# the string to be typed to launch whatever it is you want.
|
| |
- my ($app, $maximize) = @_;
|
| |
+ # Use maximize => 1 to maximize the application after it
|
| |
+ # is started.
|
| |
+ # Use checkstart => 1 to check that the application has started
|
| |
+ my ($application, %args) = @_;
|
| |
my $desktop = get_var("DESKTOP");
|
| |
+
|
| |
+ # The standard combo key is the "super" key, just in I3
|
| |
+ # it is different.
|
| |
my $key = 'super';
|
| |
$key = 'alt-d' if ($desktop eq "i3");
|
| |
+
|
| |
+ # In KDE, we have been experiencing BZ2097208.
|
| |
+ # To overcome this let's move the mouse out of the way
|
| |
+ # and give the launcher some time to take the correct focus.
|
| |
if ($desktop eq "kde") {
|
| |
- # To overcome BZ2097208, let's move the mouse out of the way
|
| |
- # and give the launcher some time to take the correct focus.
|
| |
diag("Moving the mouse away from the launcher.");
|
| |
mouse_set(1, 1);
|
| |
}
|
| |
+ # Open the launching mode
|
| |
wait_screen_change { send_key $key; };
|
| |
- # srsly KDE y u so slo
|
| |
+ # Give enough wait time for the everything to settle,
|
| |
+ # especially KDE is quite slow in responses.
|
| |
wait_still_screen 3;
|
| |
- type_very_safely $app;
|
| |
- # Wait for KDE to place focus correctly.
|
| |
+ type_very_safely($application);
|
| |
+ # Wait to place focus correctly.
|
| |
wait_still_screen 2;
|
| |
send_key 'ret';
|
| |
wait_still_screen 3;
|
| |
- diag("Launcher: The application $app should have been launched.");
|
| |
- # If we should maximize the application
|
| |
- if ($maximize) {
|
| |
+
|
| |
+ # If check that app is running was requested
|
| |
+ # with checkstart => 1
|
| |
+ if ($args{checkstart}) {
|
| |
+ assert_screen("apps_run_$application");
|
| |
+ }
|
| |
+ # If maximizing the application was requested
|
| |
+ # with maximize => 1
|
| |
+ if ($args{maximize}) {
|
| |
if ($desktop eq "kde") {
|
| |
send_key('super-pgup');
|
| |
}
|
| |
@@ -1398,10 +1414,9 @@
|
| |
send_key('super-up');
|
| |
}
|
| |
else {
|
| |
- diag('Maximizing in this desktop is not supported at the moment!');
|
| |
+ record_soft_failure('Maximizing in this desktop is not supported at the moment!');
|
| |
}
|
| |
wait_still_screen 3;
|
| |
- diag("Maximizer: The application should have been maximized.");
|
| |
}
|
| |
}
|
| |
|
| |
@@ -1618,6 +1633,7 @@
|
| |
# launch a terminal from a desktop, using the most efficient/reliable
|
| |
# approach (not appropriate if we really need to test launching it a
|
| |
# specific way)
|
| |
+ # Check, that the application has started.
|
| |
sub desktop_launch_terminal {
|
| |
my $desktop = get_var("DESKTOP");
|
| |
if ($desktop eq "i3") {
|
| |
@@ -1627,7 +1643,7 @@
|
| |
send_key "ctrl-alt-t";
|
| |
}
|
| |
else {
|
| |
- menu_launch_type "terminal";
|
| |
+ menu_launch_type("terminal", checkstart => 1);
|
| |
}
|
| |
}
|
| |
|
| |
@@ -1846,4 +1862,19 @@
|
| |
send_key "ret";
|
| |
}
|
| |
|
| |
+ # With Gnome Software it is a bit more complicated to check
|
| |
+ # that the application has started correctly, because on first
|
| |
+ # runs (most of the tests), it keeps asking about third party
|
| |
+ # repositories.
|
| |
+ # This subroutine handles it, so we can use it on multiple
|
| |
+ # places around the test cases.
|
| |
+ sub check_software_start {
|
| |
+ if (check_screen("gnome_software_ignore", 10)) {
|
| |
+ wait_still_screen(3);
|
| |
+ # match again as the dialog might have moved a bit
|
| |
+ assert_and_click("gnome_software_ignore");
|
| |
+ }
|
| |
+ assert_screen("desktop_package_tool_update");
|
| |
+ }
|
| |
+
|
| |
1;
|
| |
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