+
+ test "test search all projects menu item in projects menu" do
+ need_selenium
+ visit page_with_token('active')
+ find('#projects-menu').click
+ within('.dropdown-menu') do
+ assert_selector 'a', text: 'Search all projects'
+ find('a', text: 'Search all projects').click
+ end
+ within('.modal-content') do
+ assert page.has_text?('All projects'), 'No text - All projects'
+ assert page.has_text?('Search'), 'No text - Search'
+ assert page.has_text?('Cancel'), 'No text - Cancel'
+ fill_in "Search", with: 'Unrestricted public data'
+ wait_for_ajax
+ assert_selector 'div', text: 'Unrestricted public data'
+ find(:xpath, '//*[@id="choose-scroll"]/div[2]/div').click
+ click_button 'Show'
+ end
+ assert page.has_text?('Unrestricted public data'), 'No text - Unrestricted public data'
+ assert page.has_text?('An anonymously accessible project'), 'No text - An anonymously accessible project'
+ end
+
+ test "test star and unstar project" do
+ visit page_with_token 'active', "/projects/#{api_fixture('groups')['anonymously_accessible_project']['uuid']}"
+
+ # add to favorites
+ find('.fa-star-o').click
+ wait_for_ajax
+
+ find("#projects-menu").click
+ within('.dropdown-menu') do
+ assert_selector 'li', text: 'Unrestricted public data'
+ end
+
+ # remove from favotires
+ find('.fa-star').click
+ wait_for_ajax
+
+ find("#projects-menu").click
+ within('.dropdown-menu') do
+ assert_no_selector 'li', text: 'Unrestricted public data'
+ end
+ end
+
+ [
+ ['Two Part Pipeline Template', 'part-one', 'Provide a value for the following'],
+ ['Workflow with input specifications', 'this workflow has inputs specified', 'Provide a value for the following'],
+ ].each do |template_name, preview_txt, process_txt|
+ test "run a process using template #{template_name} in a project" do
+ project = api_fixture('groups')['aproject']
+ visit page_with_token 'active', '/projects/' + project['uuid']
+
+ find('.btn', text: 'Run a process').click
+
+ # in the chooser, verify preview and click Next button
+ within('.modal-dialog') do
+ find('.selectable', text: template_name).click
+ assert_text preview_txt
+ find('.btn', text: 'Next: choose inputs').click
+ end
+
+ # in the process page now
+ assert_text process_txt
+ assert_text project['name']
+ end
+ end