From efec7010cb242a267abf6ab127c1e2c9bb55e377 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Oct 30 2019 16:05:06 +0000 Subject: Handle an 'akonadi did something' notification in KDE, etc. This handles a case where KDE shows a notification saying 'PIM Maintenance (Finished)', like this: https://openqa.fedoraproject.org/tests/477345#step/desktop_notifications/34 we need to click it away for the desktop_notification test to pass. It also clarifies the difference between this notification and the eternal 'akonadi_migration_agent is doing something' popup in the needle names and comments. It also replaces the 'check_screen then assert_and_click if found' pattern in several notifications-related places with the better 'check_screen then click_lastmatch if found' pattern now available upstream. Signed-off-by: Adam Williamson --- diff --git a/lib/utils.pm b/lib/utils.pm index dddf3c5..a9d6037 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -1078,7 +1078,7 @@ sub click_unwanted_notifications { # on all visible 'update available' notifications (there can be # more than one, thanks to # https://bugzilla.redhat.com/show_bug.cgi?id=1730482 ) and the - # buggy 'akonadi_migration_agent' notification if it's showing - + # buggy 'akonadi_migration_agent_running' popup if it's showing - # https://bugzilla.redhat.com/show_bug.cgi?id=1716005 # Returns an array indicating which notifications it closed wait_still_screen 5; @@ -1087,10 +1087,10 @@ sub click_unwanted_notifications { while ($count > 0 && check_screen "desktop_update_notification_popup", 5) { $count -= 1; push (@closed, 'update'); - assert_and_click "desktop_update_notification_popup"; + click_lastmatch; } - if (check_screen "akonadi_migration_agent", 5) { - assert_and_click "akonadi_migration_agent"; + if (check_screen "akonadi_migration_agent_running", 5) { + click_lastmatch; push (@closed, 'akonadi'); } return @closed; diff --git a/needles/kde/akonadi_migration_agent-20190716.json b/needles/kde/akonadi_migration_agent-20190716.json index 4940c03..a8fe790 100644 --- a/needles/kde/akonadi_migration_agent-20190716.json +++ b/needles/kde/akonadi_migration_agent-20190716.json @@ -17,6 +17,6 @@ ], "properties": [], "tags": [ - "akonadi_migration_agent" + "akonadi_migration_agent_running" ] -} \ No newline at end of file +} diff --git a/needles/kde/akonadi_migration_agent-31-20190926.json b/needles/kde/akonadi_migration_agent-31-20190926.json index d6d169e..c0cdf63 100644 --- a/needles/kde/akonadi_migration_agent-31-20190926.json +++ b/needles/kde/akonadi_migration_agent-31-20190926.json @@ -17,6 +17,6 @@ ], "properties": [], "tags": [ - "akonadi_migration_agent" + "akonadi_migration_agent_running" ] -} \ No newline at end of file +} diff --git a/tests/desktop_notifications.pm b/tests/desktop_notifications.pm index 7981a6c..9faa2ae 100644 --- a/tests/desktop_notifications.pm +++ b/tests/desktop_notifications.pm @@ -102,7 +102,7 @@ sub run { if (grep {$_ eq 'akonadi'} @closed) { # this isn't an SELinux denial or a crash, so it's not # a hard failure... - record_soft_failure "stuck akonadi_migration_agent notification - RHBZ #1716005"; + record_soft_failure "stuck akonadi_migration_agent popup - RHBZ #1716005"; } my @upnotes = grep {$_ eq 'update'} @closed; if (scalar @upnotes > 1) { @@ -119,7 +119,11 @@ sub run { # In F28+ we seem to get a network connection notification # here. Let's dismiss it. if (check_screen 'desktop_network_notification', 5) { - assert_and_click 'desktop_notification_dismiss'; + click_lastmatch; + } + # In F32+ we may also get an 'akonadi did something' message + if (check_screen 'akonadi_migration_notification', 5) { + click_lastmatch; } # on live path, we should not have got any other notification; # on installed path, we saw an update notification and closed