Tweak previous commit to avoid some bugs

The previous commit would lead to the 'workaround' getting hit
incorrectly, and might have had some other issues...tweak it a
bit.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-10-31 12:45:11 -07:00
parent fd753b2e3a
commit 70ef3404f0
1 changed files with 6 additions and 7 deletions

View File

@ -52,19 +52,18 @@ sub run {
# will retry a max of two times if we hit refresh and wind up
# being told the system is up to date.
my $retries = 2;
my $dlhit = 0;
my $tags = ['desktop_package_tool_update_download', 'desktop_package_tool_update_apply', 'desktop_package_tool_update_refresh'];
for (my $n = 1; $n < 6; $n++) {
if (check_screen ['desktop_package_tool_update_download', 'desktop_package_tool_update_apply', 'desktop_package_tool_update_refresh'], 120) {
if (check_screen $tags, 120) {
# if we see 'apply', we're done here, quit out of the loop
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
# two-step process - let's hit it, and continue waiting for
# for apply (only), we now 'deactivate' the #1638563 workaround
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;
$n -= 1 if ($n > 1);
$tags = ['desktop_package_tool_update_apply'];
next;
}
# otherwise, the refresh button came back - that's the bug