From a4fdb47f52f53293fecb434e77ce378a1cd917fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 30 Jan 2018 16:02:24 +0100 Subject: [PATCH] Speed-up the click on 'New subgroup' if the 'No results' text is shown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- qa/qa/page/group/show.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qa/qa/page/group/show.rb b/qa/qa/page/group/show.rb index f24859f2b1d..00883bbe87b 100644 --- a/qa/qa/page/group/show.rb +++ b/qa/qa/page/group/show.rb @@ -13,6 +13,10 @@ module QA element :new_subgroup_button, /%input.*\.js-new-group-child/ end + view 'app/assets/javascripts/groups/constants.js' do + element :no_result_text, 'Sorry, no groups or projects matched your search' + end + def go_to_subgroup(name) click_link name end @@ -24,7 +28,11 @@ module QA def has_subgroup?(name) filter_by_name(name) - page.has_link?(name) + wait(reload: false) do + return false if page.has_content?('Sorry, no groups or projects matched your search') + + page.has_link?(name) + end end def go_to_new_subgroup