Handle split of 'download' and 'apply' phases in gnome-software

GNOME Software 3.30.5 split the offline update process into two
separate 'download' and 'apply' phases. So we need to handle
clicking 'download' before 'apply', if that happens.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-10-31 11:43:00 -07:00
parent e6c8c5f0ff
commit fd753b2e3a
3 changed files with 29 additions and 2 deletions

View File

@ -0,0 +1,16 @@
{
"properties": [],
"area": [
{
"xpos": 823,
"height": 17,
"width": 68,
"type": "match",
"ypos": 114
}
],
"tags": [
"DESKTOP-gnome",
"desktop_package_tool_update_download"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -52,10 +52,21 @@ sub run {
# will retry a max of two times if we hit refresh and wind up # will retry a max of two times if we hit refresh and wind up
# being told the system is up to date. # being told the system is up to date.
my $retries = 2; my $retries = 2;
my $dlhit = 0;
for (my $n = 1; $n < 6; $n++) { for (my $n = 1; $n < 6; $n++) {
if (check_screen ['desktop_package_tool_update_apply', 'desktop_package_tool_update_refresh'], 120) { if (check_screen ['desktop_package_tool_update_download', 'desktop_package_tool_update_apply', 'desktop_package_tool_update_refresh'], 120) {
# if we see 'apply', we're done here, quit out of the loop # if we see 'apply', we're done here, quit out of the loop
last if (check_screen 'desktop_package_tool_update_apply', 1); last if (match_has_tag 'desktop_package_tool_update_apply');
# if we see 'download', we're in the GNOME Software 3.30.5+
# two-step process - let's hit it, and go back to waiting
# for apply. If we hit it *twice*, that's unexpected, fail
if (match_has_tag 'desktop_package_tool_update_download') {
die "Update Download button showed up more than once!" if ($dlhit);
$dlhit = 1;
wait_screen_change { assert_and_click 'desktop_package_tool_update_download'; };
$n = 1;
next;
}
# otherwise, the refresh button came back - that's the bug # otherwise, the refresh button came back - that's the bug
if ($retries == 2) { if ($retries == 2) {
# only record the soft fail on the *first* retry # only record the soft fail on the *first* retry