From baa7ac4e3956ce02752e499ca94ec86e6da90def Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 28 Mar 2018 19:42:31 -0700 Subject: [PATCH] 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 --- lib/packagetest.pm | 4 ++++ tests/desktop_update_graphical.pm | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/packagetest.pm b/lib/packagetest.pm index a0a3e05d..7892bdfe 100644 --- a/lib/packagetest.pm +++ b/lib/packagetest.pm @@ -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'; # install the test packages from repo1 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 diff --git a/tests/desktop_update_graphical.pm b/tests/desktop_update_graphical.pm index e436b68a..2ddbf945 100644 --- a/tests/desktop_update_graphical.pm +++ b/tests/desktop_update_graphical.pm @@ -39,8 +39,12 @@ sub run { } } assert_and_click 'desktop_package_tool_update'; - # refresh updates - assert_and_click 'desktop_package_tool_update_refresh', '', 120; + # 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 + assert_and_click 'desktop_package_tool_update_refresh', '', 120; + } # wait for refresh, then apply updates, using a C-style loop so we # can reset it if needed due to RHBZ #1314991 for (my $n = 1; $n < 6; $n++) {