Handle KDE update test when KDE has aleady found updates

We do the 'desktop update' test for KDE via the notification
icon thingy, and it behaves differently depending on whether it
has already detected there are updates or not. The test only
works at present in the case where it *hasn't* - it expects the
notification icon to be in the extended panel and it expects to
see a 'refresh' button, neither of which is the case if it's
already noticed there are updates to install.

We should also force PackageKit to update its list of available
updates after we set up our 'special' update, otherwise on this
path KDE will only install the updates it found *before* we did
our stuff, and the test will fail as our special update won't be
there.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-03-28 19:42:31 -07:00
parent de3f4a873c
commit baa7ac4e39
2 changed files with 10 additions and 2 deletions

View File

@ -21,6 +21,10 @@ sub prepare_test_packages {
assert_script_run 'curl -o /etc/yum.repos.d/openqa-testrepo-1.repo https://fedorapeople.org/groups/qa/openqa-repos/openqa-testrepo-1.repo'; assert_script_run 'curl -o /etc/yum.repos.d/openqa-testrepo-1.repo https://fedorapeople.org/groups/qa/openqa-repos/openqa-testrepo-1.repo';
# install the test packages from repo1 # install the test packages from repo1
assert_script_run 'dnf -y --disablerepo=* --enablerepo=openqa-testrepo-1 install python3-kickstart'; assert_script_run 'dnf -y --disablerepo=* --enablerepo=openqa-testrepo-1 install python3-kickstart';
if (get_var("DESKTOP") eq 'kde' && get_var("TEST") eq 'desktop_update_graphical') {
# kick pkcon so our special update will definitely get installed
assert_script_run 'pkcon refresh force';
}
} }
# check our test packages installed correctly (this is a test that dnf # check our test packages installed correctly (this is a test that dnf

View File

@ -39,8 +39,12 @@ sub run {
} }
} }
assert_and_click 'desktop_package_tool_update'; assert_and_click 'desktop_package_tool_update';
# if this is KDE and it had already noticed the notification, we
# will already have the apply button at this point
unless (check_screen 'desktop_package_tool_update_apply', 5) {
# refresh updates # refresh updates
assert_and_click 'desktop_package_tool_update_refresh', '', 120; assert_and_click 'desktop_package_tool_update_refresh', '', 120;
}
# wait for refresh, then apply updates, using a C-style loop so we # wait for refresh, then apply updates, using a C-style loop so we
# can reset it if needed due to RHBZ #1314991 # can reset it if needed due to RHBZ #1314991
for (my $n = 1; $n < 6; $n++) { for (my $n = 1; $n < 6; $n++) {