1 require 'integration_helper'
2 require 'helpers/share_object_helper'
3 require_relative 'integration_test_utils'
5 class ProjectsTest < ActionDispatch::IntegrationTest
6 include ShareObjectHelper
12 test 'Check collection count for A Project in the tab pane titles' do
13 project_uuid = api_fixture('groups')['aproject']['uuid']
14 visit page_with_token 'active', '/projects/' + project_uuid
15 click_link 'Data collections'
17 collection_count = page.all("[data-pk*='collection']").count
18 assert_selector '#Data_collections-tab span', text: "(#{collection_count})"
21 test 'Find a project and edit its description' do
22 visit page_with_token 'active', '/'
23 find("#projects-menu").click
24 find(".dropdown-menu a", text: "A Project").click
25 within('.container-fluid', text: api_fixture('groups')['aproject']['name']) do
26 find('span', text: api_fixture('groups')['aproject']['name']).click
27 within('.arv-description-as-subtitle') do
28 find('.fa-pencil').click
29 find('.editable-input textarea').set('I just edited this.')
30 find('.editable-submit').click
35 assert(find?('.container-fluid', text: 'I just edited this.'),
36 "Description update did not survive page refresh")
39 test 'Create a project and move it into a different project' do
40 visit page_with_token 'active', '/projects'
41 find("#projects-menu").click
42 within('.dropdown-menu') do
43 first('li', text: 'Home').click
46 find('.btn', text: "Add a subproject").click
49 find('.fa-pencil').click
50 find('.editable-input input').set('Project 1234')
51 find('.glyphicon-ok').click
56 find("#projects-menu").click
57 within('.dropdown-menu') do
58 first('li', text: 'Home').click
61 find('.btn', text: "Add a subproject").click
63 find('.fa-pencil').click
64 find('.editable-input input').set('Project 5678')
65 find('.glyphicon-ok').click
69 click_link 'Move project...'
70 find('.selectable', text: 'Project 1234').click
71 find('.modal-footer a,button', text: 'Move').click
74 # Wait for the page to refresh and show the new parent in Sharing panel
76 assert(page.has_link?("Project 1234"),
77 "Project 5678 should now be inside project 1234")
80 def open_groups_sharing(project_name="aproject", token_name="active")
81 project = api_fixture("groups", project_name)
82 visit(page_with_token(token_name, "/projects/#{project['uuid']}"))
84 click_on "Share with groups"
87 def group_name(group_key)
88 api_fixture("groups", group_key, "name")
91 test "projects not publicly sharable when anonymous browsing disabled" do
92 Rails.configuration.anonymous_user_token = false
94 # Check for a group we do expect first, to make sure the modal's loaded.
95 assert_selector(".modal-container .selectable",
96 text: group_name("all_users"))
97 assert_no_selector(".modal-container .selectable",
98 text: group_name("anonymous_group"))
101 test "projects publicly sharable when anonymous browsing enabled" do
102 Rails.configuration.anonymous_user_token = "testonlytoken"
104 assert_selector(".modal-container .selectable",
105 text: group_name("anonymous_group"))
108 test "project owner can manage sharing for another user" do
109 add_user = api_fixture('users')['future_project_user']
110 new_name = ["first_name", "last_name"].map { |k| add_user[k] }.join(" ")
112 show_object_using('active', 'groups', 'aproject', 'A Project')
114 add_share_and_check("users", new_name, add_user)
115 modify_share_and_check(new_name)
118 test "project owner can manage sharing for another group" do
119 new_name = api_fixture('groups')['future_project_viewing_group']['name']
121 show_object_using('active', 'groups', 'aproject', 'A Project')
123 add_share_and_check("groups", new_name)
124 modify_share_and_check(new_name)
127 test "'share with group' listing does not offer projects" do
128 show_object_using('active', 'groups', 'aproject', 'A Project')
130 click_on "Share with groups"
131 good_uuid = api_fixture("groups")["private"]["uuid"]
132 assert(page.has_selector?(".selectable[data-object-uuid=\"#{good_uuid}\"]"),
133 "'share with groups' listing missing owned user group")
134 bad_uuid = api_fixture("groups")["asubproject"]["uuid"]
135 assert(page.has_no_selector?(".selectable[data-object-uuid=\"#{bad_uuid}\"]"),
136 "'share with groups' listing includes project")
140 ['Move',api_fixture('collections')['collection_to_move_around_in_aproject'],
141 api_fixture('groups')['aproject'],api_fixture('groups')['asubproject']],
142 ['Remove',api_fixture('collections')['collection_to_move_around_in_aproject'],
143 api_fixture('groups')['aproject']],
144 ['Copy',api_fixture('collections')['collection_to_move_around_in_aproject'],
145 api_fixture('groups')['aproject'],api_fixture('groups')['asubproject']],
146 ['Remove',api_fixture('collections')['collection_in_aproject_with_same_name_as_in_home_project'],
147 api_fixture('groups')['aproject'],nil,true],
148 ].each do |action, my_collection, src, dest=nil, expect_name_change=nil|
149 test "selection #{action} -> #{expect_name_change.inspect} for project" do
150 perform_selection_action src, dest, my_collection, action
154 assert page.has_text?(my_collection['name']), 'Collection not found in src project after copy'
155 visit page_with_token 'active', '/'
156 find("#projects-menu").click
157 find(".dropdown-menu a", text: dest['name']).click
158 click_link 'Data collections'
159 assert page.has_text?(my_collection['name']), 'Collection not found in dest project after copy'
162 assert page.has_no_text?(my_collection['name']), 'Collection still found in src project after move'
163 visit page_with_token 'active', '/'
164 find("#projects-menu").click
165 find(".dropdown-menu a", text: dest['name']).click
166 click_link 'Data collections'
167 assert page.has_text?(my_collection['name']), 'Collection not found in dest project after move'
170 assert page.has_no_text?(my_collection['name']), 'Collection still found in src project after remove'
175 def perform_selection_action src, dest, item, action
176 visit page_with_token 'active', '/'
177 find("#projects-menu").click
178 find(".dropdown-menu a", text: src['name']).click
179 click_link 'Data collections'
180 assert page.has_text?(item['name']), 'Collection not found in src project'
182 within('tr', text: item['name']) do
183 find('input[type=checkbox]').click
186 click_button 'Selection'
188 within('.selection-action-container') do
189 assert page.has_text?("Compare selected"), "Compare selected link text not found"
190 assert page.has_link?("Copy selected"), "Copy selected link not found"
191 assert page.has_link?("Move selected"), "Move selected link not found"
192 assert page.has_link?("Remove selected"), "Remove selected link not found"
194 click_link "#{action} selected"
197 # select the destination project if a Copy or Move action is being performed
198 if action == 'Copy' || action == 'Move'
199 within(".modal-container") do
200 find('.selectable', text: dest['name']).click
201 find('.modal-footer a,button', text: action).click
207 # Test copy action state. It should not be available when a subproject is selected.
208 test "copy action is disabled when a subproject is selected" do
209 my_project = api_fixture('groups')['aproject']
210 my_collection = api_fixture('collections')['collection_to_move_around_in_aproject']
211 my_subproject = api_fixture('groups')['asubproject']
213 # verify that selection options are disabled on the project until an item is selected
214 visit page_with_token 'active', '/'
215 find("#projects-menu").click
216 find(".dropdown-menu a", text: my_project['name']).click
218 click_link 'Data collections'
219 click_button 'Selection'
220 within('.selection-action-container') do
221 assert_selector 'li.disabled', text: 'Create new collection with selected collections'
222 assert_selector 'li.disabled', text: 'Compare selected'
223 assert_selector 'li.disabled', text: 'Copy selected'
224 assert_selector 'li.disabled', text: 'Move selected'
225 assert_selector 'li.disabled', text: 'Remove selected'
228 # select collection and verify links are enabled
229 visit page_with_token 'active', '/'
230 find("#projects-menu").click
231 find(".dropdown-menu a", text: my_project['name']).click
232 click_link 'Data collections'
233 assert page.has_text?(my_collection['name']), 'Collection not found in project'
235 within('tr', text: my_collection['name']) do
236 find('input[type=checkbox]').click
239 click_button 'Selection'
240 within('.selection-action-container') do
241 assert_no_selector 'li.disabled', text: 'Create new collection with selected collections'
242 assert_selector 'li', text: 'Create new collection with selected collections'
243 assert_selector 'li.disabled', text: 'Compare selected'
244 assert_no_selector 'li.disabled', text: 'Copy selected'
245 assert_selector 'li', text: 'Copy selected'
246 assert_no_selector 'li.disabled', text: 'Move selected'
247 assert_selector 'li', text: 'Move selected'
248 assert_no_selector 'li.disabled', text: 'Remove selected'
249 assert_selector 'li', text: 'Remove selected'
252 # select subproject and verify that copy action is disabled
253 visit page_with_token 'active', '/'
254 find("#projects-menu").click
255 find(".dropdown-menu a", text: my_project['name']).click
257 click_link 'Subprojects'
258 assert page.has_text?(my_subproject['name']), 'Subproject not found in project'
260 within('tr', text: my_subproject['name']) do
261 find('input[type=checkbox]').click
264 click_button 'Selection'
265 within('.selection-action-container') do
266 assert_selector 'li.disabled', text: 'Create new collection with selected collections'
267 assert_selector 'li.disabled', text: 'Compare selected'
268 assert_selector 'li.disabled', text: 'Copy selected'
269 assert_no_selector 'li.disabled', text: 'Move selected'
270 assert_selector 'li', text: 'Move selected'
271 assert_no_selector 'li.disabled', text: 'Remove selected'
272 assert_selector 'li', text: 'Remove selected'
275 # select subproject and a collection and verify that copy action is still disabled
276 visit page_with_token 'active', '/'
277 find("#projects-menu").click
278 find(".dropdown-menu a", text: my_project['name']).click
280 click_link 'Subprojects'
281 assert page.has_text?(my_subproject['name']), 'Subproject not found in project'
283 within('tr', text: my_subproject['name']) do
284 find('input[type=checkbox]').click
287 click_link 'Data collections'
288 assert page.has_text?(my_collection['name']), 'Collection not found in project'
290 within('tr', text: my_collection['name']) do
291 find('input[type=checkbox]').click
294 click_link 'Subprojects'
295 click_button 'Selection'
296 within('.selection-action-container') do
297 assert_selector 'li.disabled', text: 'Create new collection with selected collections'
298 assert_selector 'li.disabled', text: 'Compare selected'
299 assert_selector 'li.disabled', text: 'Copy selected'
300 assert_no_selector 'li.disabled', text: 'Move selected'
301 assert_selector 'li', text: 'Move selected'
302 assert_no_selector 'li.disabled', text: 'Remove selected'
303 assert_selector 'li', text: 'Remove selected'
307 # When project tabs are switched, only options applicable to the current tab's selections are enabled.
308 test "verify selection options when tabs are switched" do
309 my_project = api_fixture('groups')['aproject']
310 my_collection = api_fixture('collections')['collection_to_move_around_in_aproject']
311 my_subproject = api_fixture('groups')['asubproject']
313 # select subproject and a collection and verify that copy action is still disabled
314 visit page_with_token 'active', '/'
315 find("#projects-menu").click
316 find(".dropdown-menu a", text: my_project['name']).click
318 # Select a sub-project
319 click_link 'Subprojects'
320 assert page.has_text?(my_subproject['name']), 'Subproject not found in project'
322 within('tr', text: my_subproject['name']) do
323 find('input[type=checkbox]').click
326 # Select a collection
327 click_link 'Data collections'
328 assert page.has_text?(my_collection['name']), 'Collection not found in project'
330 within('tr', text: my_collection['name']) do
331 find('input[type=checkbox]').click
334 # Go back to Subprojects tab
335 click_link 'Subprojects'
336 click_button 'Selection'
337 within('.selection-action-container') do
338 assert_selector 'li.disabled', text: 'Create new collection with selected collections'
339 assert_selector 'li.disabled', text: 'Compare selected'
340 assert_selector 'li.disabled', text: 'Copy selected'
341 assert_no_selector 'li.disabled', text: 'Move selected'
342 assert_selector 'li', text: 'Move selected'
343 assert_no_selector 'li.disabled', text: 'Remove selected'
344 assert_selector 'li', text: 'Remove selected'
347 # Close the dropdown by clicking outside it.
348 find('.dropdown-toggle', text: 'Selection').find(:xpath, '..').click
350 # Go back to Data collections tab
351 find('.nav-tabs a', text: 'Data collections').click
352 click_button 'Selection'
353 within('.selection-action-container') do
354 assert_no_selector 'li.disabled', text: 'Create new collection with selected collections'
355 assert_selector 'li', text: 'Create new collection with selected collections'
356 assert_selector 'li.disabled', text: 'Compare selected'
357 assert_no_selector 'li.disabled', text: 'Copy selected'
358 assert_selector 'li', text: 'Copy selected'
359 assert_no_selector 'li.disabled', text: 'Move selected'
360 assert_selector 'li', text: 'Move selected'
361 assert_no_selector 'li.disabled', text: 'Remove selected'
362 assert_selector 'li', text: 'Remove selected'
366 # "Move selected" and "Remove selected" options should not be
367 # available when current user cannot write to the project
368 test "move selected and remove selected actions not available when current user cannot write to project" do
369 my_project = api_fixture('groups')['anonymously_accessible_project']
370 visit page_with_token 'active', "/projects/#{my_project['uuid']}"
372 click_link 'Data collections'
373 click_button 'Selection'
374 within('.selection-action-container') do
375 assert_selector 'li', text: 'Create new collection with selected collections'
376 assert_selector 'li', text: 'Compare selected'
377 assert_selector 'li', text: 'Copy selected'
378 assert_no_selector 'li', text: 'Move selected'
379 assert_no_selector 'li', text: 'Remove selected'
385 ['project_viewer', false],
386 ].each do |user, expect_collection_in_aproject|
387 test "combine selected collections into new collection #{user} #{expect_collection_in_aproject}" do
388 my_project = api_fixture('groups')['aproject']
389 my_collection = api_fixture('collections')['collection_to_move_around_in_aproject']
391 visit page_with_token user, "/projects/#{my_project['uuid']}"
392 click_link 'Data collections'
393 assert page.has_text?(my_collection['name']), 'Collection not found in project'
395 within('tr', text: my_collection['name']) do
396 find('input[type=checkbox]').click
399 click_button 'Selection'
400 within('.selection-action-container') do
401 click_link 'Create new collection with selected collections'
404 # now in the new collection page
405 if expect_collection_in_aproject
406 assert page.has_text?("Created new collection in the project #{my_project['name']}"),
407 'Not found flash message that new collection is created in aproject'
409 assert page.has_text?("Created new collection in your Home project"),
410 'Not found flash message that new collection is created in Home project'
415 def scroll_setup(project_name,
419 sort_parameters = nil)
420 project_uuid = api_fixture('groups')[project_name]['uuid']
421 visit page_with_token 'user1_with_load', '/projects/' + project_uuid
423 assert(page.has_text?("#{item_list_parameter.humanize} (#{total_nbr_items})"), "Number of #{item_list_parameter.humanize} did not match the input amount")
425 click_link item_list_parameter.humanize
429 find("th[data-sort-order='#{sort_parameters.gsub(/\s/,'')}']").click
434 def scroll_items_check(nbr_items,
440 for i in 1..nbr_items
441 items << "#{fixture_prefix}#{i}"
444 verify_items = items.dup
445 unexpected_items = []
447 within(".arv-project-#{item_list_parameter}") do
448 page.execute_script "window.scrollBy(0,999000)"
454 # Visit all rows. If not all expected items are found, retry
455 found_items = page.all(item_selector)
456 item_count = found_items.count
459 (0..item_count-1).each do |i|
460 # Found row text using the fixture string e.g. "Show Collection_#{n} "
461 item_name = found_items[i].text.split[1]
462 if !items.include? item_name
463 unexpected_items << item_name
465 verify_items.delete item_name
469 assert_operator( previous.downcase, :<=, item_name.downcase) if previous
474 assert_equal true, unexpected_items.empty?, "Found unexpected #{item_list_parameter.humanize} #{unexpected_items.inspect}"
475 assert_equal nbr_items, item_count, "Found different number of #{item_list_parameter.humanize}"
476 assert_equal true, verify_items.empty?, "Did not find all the #{item_list_parameter.humanize}"
481 ['project_with_10_collections', 10],
482 ['project_with_201_collections', 201], # two pages of data
483 ].each do |project_name, nbr_items|
484 test "scroll collections tab for #{project_name} with #{nbr_items} objects" do
485 item_list_parameter = "Data_collections"
486 scroll_setup project_name,
489 scroll_items_check nbr_items,
492 'tr[data-kind="arvados#collection"]'
497 ['project_with_10_collections', 10],
498 ['project_with_201_collections', 201], # two pages of data
499 ].each do |project_name, nbr_items|
500 test "scroll collections tab for #{project_name} with #{nbr_items} objects with ascending sort (case insensitive)" do
501 item_list_parameter = "Data_collections"
502 scroll_setup project_name,
507 scroll_items_check nbr_items,
510 'tr[data-kind="arvados#collection"]',
516 ['project_with_10_pipelines', 10, 0],
517 ['project_with_2_pipelines_and_60_crs', 2, 60],
518 ['project_with_25_pipelines', 25, 0],
519 ].each do |project_name, num_pipelines, num_crs|
520 test "scroll pipeline instances tab for #{project_name} with #{num_pipelines} pipelines and #{num_crs} container requests" do
521 item_list_parameter = "Pipelines_and_processes"
522 scroll_setup project_name,
523 num_pipelines + num_crs,
525 # check the general scrolling and the pipelines
526 scroll_items_check num_pipelines,
529 'tr[data-kind="arvados#pipelineInstance"]'
530 # Check container request count separately
531 crs_found = page.all('tr[data-kind="arvados#containerRequest"]')
532 found_cr_count = crs_found.count
533 assert_equal num_crs, found_cr_count, 'Did not find expected number of container requests'
537 test "error while loading tab" do
538 original_arvados_v1_base = Rails.configuration.arvados_v1_base
540 visit page_with_token 'active', '/projects/' + api_fixture('groups')['aproject']['uuid']
542 # Point to a bad api server url to generate error
543 Rails.configuration.arvados_v1_base = "https://[::1]:1/"
544 click_link 'Other objects'
545 within '#Other_objects' do
547 assert_selector('a', text: 'Reload tab')
549 # Now point back to the orig api server and reload tab
550 Rails.configuration.arvados_v1_base = original_arvados_v1_base
551 click_link 'Reload tab'
552 assert_no_selector('a', text: 'Reload tab')
553 assert_selector('button', text: 'Selection')
554 within '.selection-action-container' do
555 assert_selector 'tr[data-kind="arvados#trait"]'
560 test "add new project using projects dropdown" do
561 # verify that selection options are disabled on the project until an item is selected
562 visit page_with_token 'active', '/'
565 find("#projects-menu").click
566 click_link 'Add a new project'
567 assert_text 'New project'
568 assert_text 'No description provided'
570 # Add one more new project
571 find("#projects-menu").click
572 click_link 'Add a new project'
573 match = /New project \(\d\)/.match page.text
574 assert match, 'Expected project name not found'
575 assert_text 'No description provided'
578 test "first tab loads data when visiting other tab directly" do
579 # As of 2014-12-19, the first tab of project#show uses infinite scrolling.
580 # Make sure that it loads data even if we visit another tab directly.
581 need_selenium 'to land on specified tab using {url}#Advanced'
582 user = api_fixture("users", "active")
583 visit(page_with_token("active_trustedclient",
584 "/projects/#{user['uuid']}#Advanced"))
585 assert_text("API response")
586 find("#page-wrapper .nav-tabs :first-child a").click
587 assert_text("Collection modified at")
590 # "Select all" and "Unselect all" options
591 test "select all and unselect all actions" do
592 need_selenium 'to check and uncheck checkboxes'
594 visit page_with_token 'active', '/projects/' + api_fixture('groups')['aproject']['uuid']
596 # Go to "Data collections" tab and click on "Select all"
597 click_link 'Data collections'
600 # Initially, all selection options for this tab should be disabled
601 click_button 'Selection'
602 within('.selection-action-container') do
603 assert_selector 'li.disabled', text: 'Create new collection with selected collections'
604 assert_selector 'li.disabled', text: 'Copy selected'
608 click_button 'Select all'
610 assert_checkboxes_state('input[type=checkbox]', true, '"select all" should check all checkboxes')
612 # Now the selection options should be enabled
613 click_button 'Selection'
614 within('.selection-action-container') do
615 assert_selector 'li', text: 'Create new collection with selected collections'
616 assert_no_selector 'li.disabled', text: 'Copy selected'
617 assert_selector 'li', text: 'Create new collection with selected collections'
618 assert_no_selector 'li.disabled', text: 'Copy selected'
621 # Go to Pipelines and processes tab and assert none selected
622 click_link 'Pipelines and processes'
625 # Since this is the first visit to this tab, all selection options should be disabled
626 click_button 'Selection'
627 within('.selection-action-container') do
628 assert_selector 'li.disabled', text: 'Create new collection with selected collections'
629 assert_selector 'li.disabled', text: 'Copy selected'
632 assert_checkboxes_state('input[type=checkbox]', false, '"select all" should check all checkboxes')
635 click_button 'Select all'
636 assert_checkboxes_state('input[type=checkbox]', true, '"select all" should check all checkboxes')
638 # Applicable selection options should be enabled
639 click_button 'Selection'
640 within('.selection-action-container') do
641 assert_selector 'li.disabled', text: 'Create new collection with selected collections'
642 assert_selector 'li', text: 'Copy selected'
643 assert_no_selector 'li.disabled', text: 'Copy selected'
647 click_button 'Unselect all'
648 assert_checkboxes_state('input[type=checkbox]', false, '"select all" should check all checkboxes')
650 # All selection options should be disabled again
651 click_button 'Selection'
652 within('.selection-action-container') do
653 assert_selector 'li.disabled', text: 'Create new collection with selected collections'
654 assert_selector 'li.disabled', text: 'Copy selected'
657 # Go back to Data collections tab and verify all are still selected
658 click_link 'Data collections'
661 # Selection options should be enabled based on the fact that all collections are still selected in this tab
662 click_button 'Selection'
663 within('.selection-action-container') do
664 assert_selector 'li', text: 'Create new collection with selected collections'
665 assert_no_selector 'li.disabled', text: 'Copy selected'
666 assert_selector 'li', text: 'Create new collection with selected collections'
667 assert_no_selector 'li.disabled', text: 'Copy selected'
670 assert_checkboxes_state('input[type=checkbox]', true, '"select all" should check all checkboxes')
673 find('button#unselect-all').click
674 assert_checkboxes_state('input[type=checkbox]', false, '"unselect all" should clear all checkboxes')
676 # Now all selection options should be disabled because none of the collections are checked
677 click_button 'Selection'
678 within('.selection-action-container') do
679 assert_selector 'li.disabled', text: 'Copy selected'
680 assert_selector 'li.disabled', text: 'Copy selected'
683 # Verify checking just one checkbox still works as expected
684 within('tr', text: api_fixture('collections')['collection_to_move_around_in_aproject']['name']) do
685 find('input[type=checkbox]').click
688 click_button 'Selection'
689 within('.selection-action-container') do
690 assert_selector 'li', text: 'Create new collection with selected collections'
691 assert_no_selector 'li.disabled', text: 'Copy selected'
692 assert_selector 'li', text: 'Create new collection with selected collections'
693 assert_no_selector 'li.disabled', text: 'Copy selected'
697 test "test search all projects menu item in projects menu" do
699 visit page_with_token('active')
700 find('#projects-menu').click
701 within('.dropdown-menu') do
702 assert_selector 'a', text: 'Search all projects'
703 find('a', text: 'Search all projects').click
705 within('.modal-content') do
706 assert page.has_text?('All projects'), 'No text - All projects'
707 assert page.has_text?('Search'), 'No text - Search'
708 assert page.has_text?('Cancel'), 'No text - Cancel'
709 fill_in "Search", with: 'Unrestricted public data'
711 assert_selector 'div', text: 'Unrestricted public data'
712 find(:xpath, '//*[@id="choose-scroll"]/div[2]/div').click
715 assert page.has_text?('Unrestricted public data'), 'No text - Unrestricted public data'
716 assert page.has_text?('An anonymously accessible project'), 'No text - An anonymously accessible project'
719 test "test star and unstar project" do
720 visit page_with_token 'active', "/projects/#{api_fixture('groups')['anonymously_accessible_project']['uuid']}"
723 find('.fa-star-o').click
726 find("#projects-menu").click
727 within('.dropdown-menu') do
728 assert_selector 'li', text: 'Unrestricted public data'
731 # remove from favotires
732 find('.fa-star').click
735 find("#projects-menu").click
736 within('.dropdown-menu') do
737 assert_no_selector 'li', text: 'Unrestricted public data'
742 ['Two Part Pipeline Template', 'part-one', 'Provide a value for the following'],
743 ['Workflow with input specifications', 'this workflow has inputs specified', 'Provide a value for the following'],
744 ].each do |template_name, preview_txt, process_txt|
745 test "run a process using template #{template_name} in a project" do
746 project = api_fixture('groups')['aproject']
747 visit page_with_token 'active', '/projects/' + project['uuid']
749 find('.btn', text: 'Run a process').click
751 # in the chooser, verify preview and click Next button
752 within('.modal-dialog') do
753 find('.selectable', text: template_name).click
754 assert_text preview_txt
755 find('.btn', text: 'Next: choose inputs').click
758 # in the process page now
759 assert_text process_txt
760 assert_text project['name']