- inputs_needed = page.all('.btn', text: 'Choose')
- inputs_needed.each_with_index do |input_needed, index|
- input_needed.click
- within('.modal-dialog') do
- look_for = pipeline_config['input_paths'][index]
- found = page.has_text?(look_for)
- if found
- find('.selectable').click
- else
- fill_in('Search', with: look_for, exact: true)
- wait_for_ajax
- find('.selectable').click
- end
- find('button', text: 'OK').click
- wait_for_ajax
- end
- end