From 090fcb54085cfb78e30cee754583d76b7d3c10b0 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Wed, 29 Jan 2020 16:42:12 +0100 Subject: [PATCH] Maintenance: Make browser tests more robust by waiting for search to stop loading. --- test/browser_test_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index e490d6dd1..80d2e48cd 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -2891,6 +2891,12 @@ wait untill text in selector disabppears element.clear element.send_keys(params[:value]) sleep 2 + + watch_for_disappear( + browser: instance, + css: '.navigation .search.loading' + ) + #instance.find_element(partial_link_text: params[:value] } ).click instance.execute_script("$(\".js-global-search-result a:contains('#{params[:value]}') .nav-tab-name\").first().click()") watch_for(