From c7173ef0e28f0b719127cfcea5e430bf08abff2e Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Apr 03 2021 00:23:53 +0000 Subject: Tweak KDE update notification handling again On current F34 we get no permanent update notification in the notifications view, we only get a *transient* one plus the systray icon. This tweaks things so on F34 we check both of those things correctly, behaviour on --- diff --git a/needles/kde/desktop_update_notification-kde-20210403.json b/needles/kde/desktop_update_notification-kde-20210403.json new file mode 100644 index 0000000..056aad3 --- /dev/null +++ b/needles/kde/desktop_update_notification-kde-20210403.json @@ -0,0 +1,24 @@ +{ + "area": [ + { + "type": "match", + "xpos": 660, + "width": 133, + "height": 17, + "ypos": 596 + }, + { + "ypos": 323, + "height": 13, + "xpos": 199, + "width": 13, + "type": "match" + } + ], + "properties": [], + "tags": [ + "DESKTOP-kde", + "desktop_update_notification_popup", + "desktop_update_notification" + ] +} \ No newline at end of file diff --git a/needles/kde/desktop_update_notification-kde-20210403.png b/needles/kde/desktop_update_notification-kde-20210403.png new file mode 100644 index 0000000..536cc6f Binary files /dev/null and b/needles/kde/desktop_update_notification-kde-20210403.png differ diff --git a/tests/desktop_notifications.pm b/tests/desktop_notifications.pm index da20ae9..74b7690 100644 --- a/tests/desktop_notifications.pm +++ b/tests/desktop_notifications.pm @@ -13,6 +13,7 @@ use packagetest; sub run { my $self = shift; my $desktop = get_var("DESKTOP"); + my $relnum = get_release_number; # for the live image case, handle bootloader here if (get_var("BOOTFROM")) { do_bootloader(postinstall=>1, params=>'3'); @@ -75,12 +76,15 @@ sub run { send_key 'ret'; } check_desktop(timeout=>90); - # now, WE WAIT. this is just an unconditional wait - rather than - # breaking if we see an update notification appear - so we catch - # things that crash a few minutes after startup, etc. + # now, WE WAIT. Because KDE on F34+ shows a notification only + # briefly we will keep an eye out and record if we saw it (logic + # around this comes later). But we wait the whole ten minutes even + # if we see it so we catch any unwanted notifications that appear + # shortly after boot + my $seen = 0; for my $n (1..16) { - sleep 30; - mouse_set 10, 10; + $seen = 1 if (check_screen "desktop_update_notification", 30); + mouse_set 20, 20; send_key "spc"; mouse_hide; } @@ -114,12 +118,25 @@ sub run { } } if (get_var("BOOTFROM")) { - # we should see an update notification and no others - assert_screen "desktop_update_notification_only"; + if ($desktop eq 'kde' && $relnum > 33) { + # there is no permanent notification in F34+, check we saw + # the transient one earlier and we see no others now + assert_screen "desktop_no_notifications"; + die "No update notification was shown!" unless $seen; + } + else { + # we should see an update notification and no others + assert_screen "desktop_update_notification_only"; + } } else { # for the live case there should be *no* notifications assert_screen "desktop_no_notifications"; + if ($desktop eq 'kde' && $relnum > 33) { + # and no tray icon either + die "Systray update notification should not be present on live!" if (check_screen "desktop_update_notification_systray"); + die "Transient notification should not be shown on live!" if $seen; + } } }