From ff06925ec095e99a0a5cea6fe2cc689513ed0c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20R=C5=AF=C5=BEi=C4=8Dka?= Date: Mon, 19 Sep 2022 16:11:42 +0200 Subject: [PATCH] Add working scripts. --- tests/applications/bugreporter/aaa_setup.pm | 22 +++++++++++++-- tests/applications/bugreporter/about.pm | 28 +++++++++++++++++++ .../applications/bugreporter/delete_report.pm | 28 +++++++++++++++++++ .../applications/bugreporter/display_crash.pm | 28 +++++++++++++++++++ 4 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 tests/applications/bugreporter/about.pm create mode 100644 tests/applications/bugreporter/delete_report.pm create mode 100644 tests/applications/bugreporter/display_crash.pm diff --git a/tests/applications/bugreporter/aaa_setup.pm b/tests/applications/bugreporter/aaa_setup.pm index ac75f261..20d93f68 100644 --- a/tests/applications/bugreporter/aaa_setup.pm +++ b/tests/applications/bugreporter/aaa_setup.pm @@ -12,14 +12,30 @@ sub run { $self->root_console(tty => 3); # Install will-crash -> we will use this to generate some Abrt problems. - assert_script_run("dnf install -y will-crash"); - + assert_script_run("dnf install -y will-crash", timeout => 120); # Return to Desktop desktop_vt(); + + # Open Terminal and use will-crash to generate a simulated crash. + menu_launch_type("terminal"); + # Check that the application has started. + assert_screen("apps_run_terminal"); + # Type the command. + enter_cmd("will_segfault"); + # Wait one minute if a notification is displayed, otherwise softfail. + unless (check_screen("bugreporter_notification_displayed", timeout => '60')) { + record_soft_failure("The crash notification has not been shown in one minute time frame."); + } + # Exit the terminal. + enter_cmd("exit"); + wait_still_screen(2); + # Start Abrt for further testing. + menu_launch_type("abrt"); + assert_screen("apps_run_abrt"); } sub test_flags { - return {fatal => 1}; + return {fatal => 1, milestone => 1}; } 1; diff --git a/tests/applications/bugreporter/about.pm b/tests/applications/bugreporter/about.pm new file mode 100644 index 00000000..132c66ed --- /dev/null +++ b/tests/applications/bugreporter/about.pm @@ -0,0 +1,28 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# This script tests if the About dialogue can be shown. + +sub run { + my $self = shift; + + # Open the About dialogue using the menu. + assert_and_click("gnome_burger_menu"); + assert_and_click("bugreporter_menu_about"); + assert_screen("bugreporter_about_shown"); + assert_and_click("bugreporter_button_credits"); + assert_screen("bugreporter_credits_shown"); + assert_and_click("bugreporter_button_license"); + assert_screen("bugreporter_license_shown"); +} + +sub test_flags { + return {always_rollback => 1}; +} + +1; + +# vim: set sw=4 et: + diff --git a/tests/applications/bugreporter/delete_report.pm b/tests/applications/bugreporter/delete_report.pm new file mode 100644 index 00000000..298e4aa6 --- /dev/null +++ b/tests/applications/bugreporter/delete_report.pm @@ -0,0 +1,28 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# This script tests if a crash report can be deleted. + +sub run { + my $self = shift; + + # Check that the crash is shown in the left bar. + assert_screen("bugreporter_leftbar_crash_shown"); + # Click on the Delete button. + assert_and_click("bugreporter_button_delete"); + # Check that the crash has disappeared from the left bar. + if (check_screen("bugreporter_leftbar_crash_shown")) { + die("It seems that the crash report could not be deleted."); + } +} + +sub test_flags { + return {always_rollback => 1}; +} + +1; + +# vim: set sw=4 et: + diff --git a/tests/applications/bugreporter/display_crash.pm b/tests/applications/bugreporter/display_crash.pm new file mode 100644 index 00000000..95d15744 --- /dev/null +++ b/tests/applications/bugreporter/display_crash.pm @@ -0,0 +1,28 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# This script tests if a crash can be displayed. + +sub run { + my $self = shift; + + # Check that the crash is shown in the left bar. + assert_screen("bugreporter_leftbar_crash_shown"); + # Check that the main screen shows the crash, too. + assert_screen("bugreporter_main_crash_shown"); + # Click on the Details button to see more info. + assert_and_click("bugreporter_button_details"); + # Check that Details are shown. + assert_screen("bugreporter_details_shown"); +} + +sub test_flags { + return {always_rollback => 1}; +} + +1; + +# vim: set sw=4 et: +