From c2f8309e270e889f4a69c581d5eb10c3285cc064 Mon Sep 17 00:00:00 2001 From: Lukas Ruzicka Date: Tue, 7 May 2019 12:54:09 +0200 Subject: [PATCH] Change test case to enable the test mode. --- lib/utils.pm | 6 +++--- tests/apps_startstop/kde/abrt.pm | 12 ++++++++++-- tests/apps_startstop/kde/akregator.pm | 13 ++++++++++--- tests/apps_startstop/kde/ark.pm | 11 +++++++++-- tests/apps_startstop/kde/cpteditor.pm | 12 +++++++++--- tests/apps_startstop/kde/csheets.pm | 12 +++++++++--- tests/apps_startstop/kde/cstage.pm | 12 +++++++++--- tests/apps_startstop/kde/cteditor.pm | 10 ++++++++-- tests/apps_startstop/kde/cwords.pm | 10 ++++++++-- 9 files changed, 75 insertions(+), 23 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 4391babf..56bbed7b 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -7,7 +7,7 @@ use Exporter; use lockapi; use testapi; -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 start_cockpit repo_setup gnome_initial_setup anaconda_create_user check_desktop_clean download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile bypass_1691487/; +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 start_cockpit repo_setup gnome_initial_setup anaconda_create_user check_desktop_clean download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher start_with_command quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile bypass_1691487/; sub run_with_error_check { my ($func, $error_screen) = @_; @@ -677,12 +677,12 @@ sub start_with_command { # Open the DE application launcher and type the name of application into it. # Hit enter to run this application. -my $command = $_; +my ($command) = @_; my $desktop = get_var('DESKTOP'); # Open the launching page or menu send_key 'alt-f1'; -wait_still_screen 2; +sleep 2; # Type the command name to run the application type_very_safely $command; diff --git a/tests/apps_startstop/kde/abrt.pm b/tests/apps_startstop/kde/abrt.pm index 4640959a..02243324 100644 --- a/tests/apps_startstop/kde/abrt.pm +++ b/tests/apps_startstop/kde/abrt.pm @@ -7,9 +7,17 @@ use utils; sub run { my $self = shift; + my $mode = get_var('MODE'); + + if ($mode eq 'fast') { - # Start the application - start_with_launcher('abrt_launch', 'menu_applications','menu_system'); + # Start the application + start_with_launcher('abrt_launch', 'menu_applications','menu_system'); + } + else { + # Start the application via command. + start_with_command('abrt'); + } # Check that it is started assert_screen 'abrt_runs'; # Close the application diff --git a/tests/apps_startstop/kde/akregator.pm b/tests/apps_startstop/kde/akregator.pm index 62d61595..af4003f3 100644 --- a/tests/apps_startstop/kde/akregator.pm +++ b/tests/apps_startstop/kde/akregator.pm @@ -7,9 +7,16 @@ use utils; sub run { my $self = shift; - - # Start the application - start_with_launcher('akregator_launch','menu_applications','menu_internet'); + my $mode = get_var('MODE'); + + if ($mode eq 'fast') { + # Start the application + start_with_command('akregator'); + } + else { + # Start with launcher + start_with_launcher('akregator_launch','menu_applications','menu_internet'); + } # Check that it is started assert_screen 'akregator_runs'; # Close the application diff --git a/tests/apps_startstop/kde/ark.pm b/tests/apps_startstop/kde/ark.pm index bdc8c2a4..d071bfcf 100644 --- a/tests/apps_startstop/kde/ark.pm +++ b/tests/apps_startstop/kde/ark.pm @@ -7,9 +7,16 @@ use utils; sub run { my $self = shift; + my $mode = get_var('MODE'); - # Start the application - start_with_launcher('ark_launch','menu_applications','menu_utilities'); + if ($mode eq 'fast') { + # Start the application with command + start_with_command 'ark'; + } + else { + # Start with launcher + start_with_launcher('ark_launch','menu_applications','menu_utilities'); + } # Check that it is started assert_screen 'ark_runs'; # Close the application diff --git a/tests/apps_startstop/kde/cpteditor.pm b/tests/apps_startstop/kde/cpteditor.pm index 5666f767..90c0271d 100644 --- a/tests/apps_startstop/kde/cpteditor.pm +++ b/tests/apps_startstop/kde/cpteditor.pm @@ -7,9 +7,15 @@ use utils; sub run { my $self = shift; - - # Start the application - start_with_launcher('cpteditor_launch','menu_applications','menu_internet'); + my $mode = get_var('MODE'); + + if ($mode eq 'fast') { + start_with_command 'printthemeeditor'; + } + else { + # Start the application + start_with_launcher('cpteditor_launch','menu_applications','menu_internet'); + } # Check that it is started assert_screen 'cpteditor_runs'; # Close the application diff --git a/tests/apps_startstop/kde/csheets.pm b/tests/apps_startstop/kde/csheets.pm index f4923285..dc75818b 100644 --- a/tests/apps_startstop/kde/csheets.pm +++ b/tests/apps_startstop/kde/csheets.pm @@ -7,9 +7,15 @@ use utils; sub run { my $self = shift; - - # Start the application - start_with_launcher('csheets_launch','menu_applications','menu_office'); + my $mode = get_var('MODE'); + + if ($mode eq 'fast') { + start_with_command 'calligra sheets'; + } + else { + # Start the application + start_with_launcher('csheets_launch','menu_applications','menu_office'); + } # Check that it is started assert_screen 'csheets_runs'; # Close the application diff --git a/tests/apps_startstop/kde/cstage.pm b/tests/apps_startstop/kde/cstage.pm index 3c4f5d07..c0eb0fb2 100644 --- a/tests/apps_startstop/kde/cstage.pm +++ b/tests/apps_startstop/kde/cstage.pm @@ -7,9 +7,15 @@ use utils; sub run { my $self = shift; - - # Start the application - start_with_launcher('cstage_launch','menu_applications','menu_office'); + my $mode = get_var('MODE'); + + if ($mode eq 'fast') { + start_with_command 'calligra stage'; + } + else { + # Start the application + start_with_launcher('cstage_launch','menu_applications','menu_office'); + } # Check that it is started assert_screen 'cstage_runs'; # Close the application diff --git a/tests/apps_startstop/kde/cteditor.pm b/tests/apps_startstop/kde/cteditor.pm index 95088bd8..d7d1bfee 100644 --- a/tests/apps_startstop/kde/cteditor.pm +++ b/tests/apps_startstop/kde/cteditor.pm @@ -7,9 +7,15 @@ use utils; sub run { my $self = shift; + my $mode = get_var('MODE'); - # Start the application - start_with_launcher('cteditor_launch','menu_applications','menu_internet'); + if ($mode eq 'fast') { + start_with_command 'contactthemeeditor'; + } + else { + # Start the application + start_with_launcher('cteditor_launch','menu_applications','menu_internet'); + } # Check that it is started assert_screen 'cteditor_runs'; # Close the application diff --git a/tests/apps_startstop/kde/cwords.pm b/tests/apps_startstop/kde/cwords.pm index 72bca294..efd54f01 100644 --- a/tests/apps_startstop/kde/cwords.pm +++ b/tests/apps_startstop/kde/cwords.pm @@ -7,9 +7,15 @@ use utils; sub run { my $self = shift; + my $mode = get_var('MODE'); - # Start the application - start_with_launcher('cwords_launch','menu_applications','menu_office'); + if ($mode eq 'fast') { + start_with_command 'calligra words'; + } + else { + # Start the application + start_with_launcher('cwords_launch','menu_applications','menu_office'); + } # Check that it is started assert_screen 'cwords_runs'; # Close the application