add a desktop notifications test

Summary:
this more or less covers desktop_error_checks and desktop_
update_notification, though it can't really distinguish
between them easily. All we know is that if both the live and
postinstall versions of this test pass, both of those tests
pass. Any fails will have to be investigated manually.

Test Plan:
Run the tests for both KDE and Workstation, see
what happens. Workstation will fail for F25 and Rawhide at
present, due to SELinux/abrt notifications.

Reviewers: jskladan, garretraziel

Reviewed By: garretraziel

Subscribers: tflink

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D1004
This commit is contained in:
Adam Williamson 2016-09-23 16:03:13 -07:00
parent e8b20ec73f
commit a067d0655f
15 changed files with 215 additions and 2 deletions

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 47,
"type": "match",
"width": 47,
"xpos": 345,
"ypos": 249
}
],
"tags": [
"desktop_no_notifications",
"DESKTOP-gnome"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 95,
"type": "match",
"width": 40,
"xpos": 170,
"ypos": 90
}
],
"tags": [
"desktop_update_notification_only",
"DESKTOP-gnome"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

View File

@ -10,7 +10,7 @@
], ],
"tags": [ "tags": [
"DESKTOP-kde", "DESKTOP-kde",
"desktop_expand_notifications" "desktop_expand_systray"
], ],
"properties": [] "properties": []
} }

View File

Before

Width:  |  Height:  |  Size: 499 KiB

After

Width:  |  Height:  |  Size: 499 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 651,
"ypos": 436,
"width": 198,
"height": 25,
"type": "match"
}
],
"tags": [
"desktop_no_notifications"
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 KiB

View File

@ -0,0 +1,16 @@
{
"properties": [],
"tags": [
"DESKTOP-kde",
"desktop_systray_notifications"
],
"area": [
{
"xpos": 641,
"ypos": 443,
"width": 83,
"height": 16,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 KiB

View File

@ -0,0 +1,22 @@
{
"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-kde"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 KiB

View File

@ -369,6 +369,50 @@
}, },
test_suite => { name => "desktop_browser" }, test_suite => { name => "desktop_browser" },
}, },
{
machine => { name => "64bit" },
prio => 30,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "Workstation-live-iso",
version => "*",
},
test_suite => { name => "desktop_notifications_live" },
},
{
machine => { name => "64bit" },
prio => 32,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "KDE-live-iso",
version => "*",
},
test_suite => { name => "desktop_notifications_live" },
},
{
machine => { name => "64bit" },
prio => 30,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "Workstation-live-iso",
version => "*",
},
test_suite => { name => "desktop_notifications_postinstall" },
},
{
machine => { name => "64bit" },
prio => 32,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "KDE-live-iso",
version => "*",
},
test_suite => { name => "desktop_notifications_postinstall" },
},
{ {
machine => { name => "64bit" }, machine => { name => "64bit" },
prio => 30, prio => 30,
@ -2127,6 +2171,21 @@
{ key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" }, { key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" },
], ],
}, },
{
name => "desktop_notifications_postinstall",
settings => [
{ key => "POSTINSTALL", value => "desktop_notifications" },
{ key => "START_AFTER_TEST", value => "install_default_upload" },
{ key => "BOOTFROM", value => "c" },
{ key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" },
],
},
{
name => "desktop_notifications_live",
settings => [
{ key => "ENTRYPOINT", value => "desktop_notifications_postinstall" },
],
},
{ {
name => "install_kickstart_nfs", name => "install_kickstart_nfs",
settings => [ settings => [

View File

@ -0,0 +1,71 @@
use base "installedtest";
use strict;
use testapi;
use main_common;
use packagetest;
# This test sort of covers QA:Testcase_desktop_update_notification
# and QA:Testcase_desktop_error_checks . If it fails, probably *one*
# of those failed, but we don't know which (deciphering which is
# tricky and involves likely-fragile needles to try and figure out
# what notifications we have).
sub run {
my $self = shift;
# for the live image case, handle bootloader here
unless (get_var("BOOTFROM")) {
$self->do_bootloader(postinstall=>0);
}
assert_screen "graphical_desktop_clean", 300;
# ensure we actually have some package updates available
# we're kinda theoretically racing with the update check here,
# but we have no great way to handle that especially live; let's
# just assume we're gonna win
$self->root_console(tty=>3);
prepare_test_packages;
$self->desktop_vt();
# 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.
for my $n (1..5) {
sleep 120;
mouse_set 10, 10;
mouse_hide;
}
my $desktop = get_var("DESKTOP");
if ($desktop eq 'gnome') {
# of course, we have no idea what'll be in the clock, so we just
# have to click where we know it is
mouse_set 512, 10;
mouse_click;
}
elsif ($desktop eq 'kde' && !get_var("BOOTFROM")) {
# the order and number of systray icons varies in KDE, so we
# can't really just use a systray 'no notifications' needle.
# instead open up the 'extended systray' thingy and click on
# the notifications bit
assert_and_click 'desktop_expand_systray';
assert_and_click 'desktop_systray_notifications';
}
if (get_var("BOOTFROM")) {
# we should see an update notification and no others
check_screen "desktop_update_notification_only";
}
else {
# for the live case there should be *no* notifications
assert_screen "desktop_no_notifications";
}
}
sub test_flags {
# without anything - rollback to 'lastgood' snapshot if failed
# 'fatal' - whole test suite is in danger if this fails
# 'milestone' - after this test succeeds, update 'lastgood'
# 'important' - if this fails, set the overall state to 'fail'
return { fatal => 1 };
}
1;
# vim: set sw=4 et:

View File

@ -16,7 +16,7 @@ sub run {
if ($desktop eq 'kde') { if ($desktop eq 'kde') {
# KDE team tells me the 'preferred' update method is the # KDE team tells me the 'preferred' update method is the
# systray applet # systray applet
assert_and_click 'desktop_expand_notifications'; assert_and_click 'desktop_expand_systray';
} }
else { else {
# this launches GNOME Software on GNOME, dunno for any other # this launches GNOME Software on GNOME, dunno for any other