From 6d2031dbfd7eb034c732e0d91336960082326353 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 13 Feb 2019 09:51:34 -0800 Subject: [PATCH] desktop_browser: fix wait_still_screen, drop wait_idle wait_idle was deprecated and effectively it just sleeps, so replace these wait_idles with explicit sleeps - I can't think of a better choice here as we just need to wait for Firefox to calm down after various operations. The wait_still_screens were always hitting the 30 second time out because of the flashing cursor; setting the similarity level required to lower than the default 47 should fix this. Signed-off-by: Adam Williamson --- tests/desktop_browser.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/desktop_browser.pm b/tests/desktop_browser.pm index b5204790..cd5771c5 100644 --- a/tests/desktop_browser.pm +++ b/tests/desktop_browser.pm @@ -17,21 +17,23 @@ sub run { check_desktop_clean; send_key 'alt-f1'; # wait out animations - wait_still_screen 2; + wait_still_screen(stilltime=>2, similarity_level=>45); assert_and_click 'browser_launcher'; assert_screen 'browser'; - wait_idle 5; + # wait_idle was deprecated, so we just have sleeps throughout + # this test, as firefox is very grind-y :( + sleep 5; # open a new tab so we don't race with the default page load # (also focuses the location bar for us) assert_and_click 'browser_new_tab'; - wait_still_screen 2; - wait_idle 3; + wait_still_screen(stilltime=>2, similarity_level=>45); + sleep 3; # check FAS, typing slowly to avoid errors type_very_safely "https://admin.fedoraproject.org/accounts/\n"; assert_screen "browser_fas_home"; assert_and_click 'browser_new_tab'; - wait_still_screen 2; - wait_idle 2; + wait_still_screen(stilltime=>2, similarity_level=>45); + sleep 2; type_very_safely "https://kernel.org\n"; assert_and_click "browser_kernelorg_patch"; assert_and_click "browser_download_save"; @@ -46,8 +48,8 @@ sub run { # may need to conditionalize it if we ever test desktops whose # default browser doesn't support add-ons or uses different ones assert_and_click 'browser_new_tab'; - wait_still_screen 2; - wait_idle 2; + wait_still_screen(stilltime=>2, similarity_level=>45); + sleep 2; type_very_safely "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/\n"; assert_and_click "firefox_addon_add"; assert_and_click "firefox_addon_install";