X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3566686444d84498031b8fdef9cbe78bcbf54b9a..c188a8aaf65602dafac8b431c33dfbc641790dd6:/apps/workbench/test/integration/search_box_test.rb diff --git a/apps/workbench/test/integration/search_box_test.rb b/apps/workbench/test/integration/search_box_test.rb index 05c7f25185..1eed15882a 100644 --- a/apps/workbench/test/integration/search_box_test.rb +++ b/apps/workbench/test/integration/search_box_test.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'integration_helper' class SearchBoxTest < ActionDispatch::IntegrationTest @@ -8,21 +12,24 @@ class SearchBoxTest < ActionDispatch::IntegrationTest # test the search box def verify_search_box user if user && user['is_active'] - # let's search for a valid uuid + aproject_uuid = api_fixture('groups')['aproject']['uuid'] + # let's search for aproject by uuid within('.navbar-fixed-top') do - page.has_field?('search') - page.find_field('search').set user['uuid'] + page.has_field?('search this site') + page.find_field('search this site').set aproject_uuid page.find('.glyphicon-search').click end - # we should now be in the user's home project as a result of search - assert_selector "#Data_collections[data-object-uuid='#{user['uuid']}']", "Expected to be in user page after search click" + # we should now be in aproject as a result of search + assert_selector 'a', text:'Data collections' + click_link 'Data collections' + assert_selector "#Data_collections[data-object-uuid='#{aproject_uuid}']", "Expected to be in user page after search click" - # let's search again for an invalid valid uuid + # let's search again for an invalid uuid within('.navbar-fixed-top') do search_for = String.new user['uuid'] search_for[0]='1' - page.find_field('search').set search_for + page.find_field('search this site').set search_for page.find('.glyphicon-search').click end @@ -58,7 +65,7 @@ class SearchBoxTest < ActionDispatch::IntegrationTest within('.navbar-fixed-top') do # search again for the anonymously accessible project - page.find_field('search').set publicly_accessible_project['name'][0,10] + page.find_field('search this site').set publicly_accessible_project['name'][0,10] page.find('.glyphicon-search').click end @@ -77,7 +84,7 @@ class SearchBoxTest < ActionDispatch::IntegrationTest assert page.has_text?(publicly_accessible_project['description']), 'No text - publicly accessible project description' else within('.navbar-fixed-top') do - page.has_no_field?('search') + page.has_no_field?('search this site') end end end