From aec74d89fae352ffa498fc42c555957ad78a99d3 Mon Sep 17 00:00:00 2001 From: Lukas Ruzicka Date: Thu, 23 Mar 2023 14:31:28 +0100 Subject: [PATCH] Kill Software to restart sync. --- tests/applications/software/list_installed.pm | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tests/applications/software/list_installed.pm diff --git a/tests/applications/software/list_installed.pm b/tests/applications/software/list_installed.pm new file mode 100644 index 00000000..bb6307ac --- /dev/null +++ b/tests/applications/software/list_installed.pm @@ -0,0 +1,58 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# With installation tests, we have already proven that Software +# can list applications installed with it. This test checks +# if applications installed using different methods (DNF) +# are also listed correctly. + +sub run { + my $self = shift; + + # We will switch to the console and perform the installation + # of the packages. + $self->root_console(tty=>3); + script_run("dnf install -y gnome-mahjongg", timeout => 240); + + # Sometimes, PackageKit does not know about the changed status + # until the computer is restared, or PackageKit is refreshed. + # Let us kill it so that when it gets restarted, it will + # be in sync. + script_run("pkill gnome-software"); + + # Return to the GUI + desktop_vt(); + + # Sometimes, Software crashes after the VM has been rolled back. + # If so, restart the application. + unless(check_screen("apps_run_software")) { + restart_application("software"); + } + + # Search for the application and confirm its status + assert_and_click("gnome_search_button"); + type_very_safely("mahjongg"); + send_key("ret"); + assert_screen("software_mahjongg_found_installed"); + + # Go to the Installed view to see the list of all installed + # applications and find the new application there. + assert_and_click("software_installed_button"); + wait_still_screen(2); + # We know that currently this part of the test will fail as there is + # a known and reported bug #1950037. + send_key_until_needlematch("software_mahjongg_listed", "tab", 100); + record_info("Known bug", "This is due to a long known bug.", result => "ok"); + +} + +sub test_flags { + return {always_rollback => 1}; +} + +1; + +# vim: set sw=4 et: +