Simplify desktop notification checks (#195)

This is the best option I can come up with to deal with #195.
Update notifications seem to have become transient in KDE lately
(even in F31 and F32, if I'm looking at these screenshots right).
This actually simplifies things a lot to do more or less the
same in the KDE and GNOME paths: open the 'permanent' store of
notifications (in GNOME you get to it by clicking on the clock,
in KDE via the systray) and then look for no notifications (live
path) or only an update notification (post-install path). We
only run this test for composes so we shouldn't need to worry
about anything older than F32, and I believe this should work
for KDE in F32 and F33. I left out click_unwanted_notifications
for now as I'm hoping it should be unnecessary, but we can add
it back in if necessary.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2020-10-14 15:31:59 -07:00
parent 656e1f6856
commit a008ffb8be
14 changed files with 109 additions and 81 deletions

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 750,
"ypos": 741,
"width": 18,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"DESKTOP-kde",
"desktop_icon_notifications"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"height": 18,
"width": 18,
"ypos": 741,
"type": "match",
"xpos": 748
}
],
"properties": [],
"tags": [
"DESKTOP-kde",
"desktop_icon_notifications"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -1,15 +0,0 @@
{
"properties": [],
"tags": [
"desktop_update_notification"
],
"area": [
{
"xpos": 775,
"ypos": 740,
"width": 23,
"height": 22,
"type": "match"
}
]
}

View File

@ -0,0 +1,23 @@
{
"area": [
{
"height": 95,
"type": "match",
"width": 38,
"xpos": 973,
"ypos": 458
},
{
"height": 16,
"type": "match",
"width": 206,
"xpos": 628,
"ypos": 457
}
],
"properties": [],
"tags": [
"DESKTOP-kde",
"desktop_update_notification_only"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 KiB

View File

@ -1,23 +0,0 @@
{
"area": [
{
"height": 18,
"type": "match",
"width": 18,
"xpos": 663,
"ypos": 743
},
{
"height": 18,
"type": "match",
"width": 18,
"xpos": 767,
"ypos": 743
}
],
"tags": [
"desktop_update_notification_only",
"desktop_update_notification",
"DESKTOP-kde"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 18,
"type": "match",
"width": 18,
"xpos": 776,
"ypos": 741
}
],
"properties": [],
"tags": [
"desktop_update_notification_systray"
]
}

View File

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 18,
"xpos": 778,
"type": "match",
"ypos": 741,
"width": 18
}
],
"properties": [],
"tags": [
"desktop_update_notification_systray"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 KiB

View File

@ -78,59 +78,40 @@ sub run {
mouse_hide; mouse_hide;
} }
if ($desktop eq 'gnome') { if ($desktop eq 'gnome') {
# of course, we have no idea what'll be in the clock, so we just # click the clock to show notifications. of course, we have no
# have to click where we know it is # idea what'll be in the clock, so we just have to click where
# we know it is
mouse_set 512, 10; mouse_set 512, 10;
mouse_click; mouse_click;
if (get_var("BOOTFROM")) {
# 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";
}
} }
elsif ($desktop eq 'kde') { if ($desktop eq 'kde') {
if (get_var("BOOTFROM")) { if (get_var("BOOTFROM")) {
assert_screen "desktop_update_notification"; # first check the systray update notification is there
# this is the case from F30 and earlier where we know this assert_screen "desktop_update_notification_systray";
# was the *only* notification; at this point we've passed
return if match_has_tag "desktop_update_notification_only";
# otherwise, we need to close the update notification(s)
# then check there are no others; see
# https://bugzilla.redhat.com/show_bug.cgi?id=1730482 for
# KDE showing multiple notifications
my @closed = click_unwanted_notifications;
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 popup - RHBZ #1716005";
}
my @upnotes = grep {$_ eq 'update'} @closed;
if (scalar @upnotes > 1) {
# Also not a hard failure, but worth noting
record_soft_failure "multiple update notifications - RHBZ #1730482";
}
} }
# the order and number of systray icons varies in KDE, so we # now open the notifications view in the systray
# can't really just use a systray 'no notifications' needle. if (check_screen 'desktop_icon_notifications') {
# instead open up the 'extended systray' thingy and click on # this is the little bell thing KDE sometimes shows if
# the notifications bit # there's been a notification recently...
assert_and_click 'desktop_expand_systray';
assert_and_click 'desktop_systray_notifications';
# In F28+ we seem to get a network connection notification
# here. Let's dismiss it.
if (check_screen 'desktop_network_notification', 5) {
click_lastmatch; click_lastmatch;
} }
# In F32+ we may also get an 'akonadi did something' message else {
# ...otherwise you have to expand the systray and click
# "Notifications"
assert_and_click 'desktop_expand_systray';
assert_and_click 'desktop_systray_notifications';
}
# In F32+ we may get an 'akonadi did something' message
if (check_screen 'akonadi_migration_notification', 5) { if (check_screen 'akonadi_migration_notification', 5) {
click_lastmatch; click_lastmatch;
} }
# on live path, we should not have got any other notification; }
# on installed path, we saw an update notification and closed if (get_var("BOOTFROM")) {
# it, and now there should be no *other* notifications # 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"; assert_screen "desktop_no_notifications";
} }
} }