# input_paths: an array of inputs for the pipeline. Use either a collection's "uuid"
# or a file's "uuid/file_name" path in this array. If the pipeline does not require
# any inputs, this can be omitted.
+ # max_wait_seconds: max time in seconds to wait for the pipeline run to complete.
+ # Default value of 30 seconds is used when this value is not provided.
#diagnostics_testing_user_tokens:
# active: eu33jurqntstmwo05h1jr3eblmi961e802703y6657s8zb14r
#diagnostics_testing_pipeline_fields:
- # tutorial pipeline:
+ # pipeline with one input:
# template_uuid: zzzzz-p5p6p-rxj8d71854j9idn
- # input_paths: [zzzzz-4zz18-u9pmni8msw9zm9n]
- # tutorial pipeline 2:
+ # input_paths: [qr1hi-4zz18-wu1s009qgnvgjc9]
+ # max_wait_seconds: 100
+ # pipeline with two inputs:
+ # template_uuid: zzzzz-p5p6p-kfwus81of6y3ezs
+ # input_paths: [2051b5d448fbd489ab00bbdedbee1ffa+91, e5e440c9c486df057e1bf6a7feac25be+77/alignment_summary_metrics.txt]
+ # max_wait_seconds: 200
+ # pipeline with no inputs:
# template_uuid: zzzzz-p5p6p-kfwus81of6y3ezs
- # input_paths: [zzzzz-4zz18-u9pmni8msw9zm9n]
# This pipeline needs input. So, Run should be disabled
page.assert_selector 'a.disabled,button.disabled', text: 'Run'
- inputs_needed = page.all('.btn', text: 'Choose')
- inputs_needed.each_with_index do |input_needed, index|
- input_needed.click
+ index = 0
+ while true
+ inputs_needed = page.all('.btn', text: 'Choose')
+ break if !inputs_needed.any?
+
+ inputs_needed[0].click
within('.modal-dialog') do
look_for = pipeline_config['input_paths'][index]
found = page.has_text?(look_for)
end
find('button', text: 'OK').click
wait_for_ajax
+ index += 1
end
end
end
- # Run this pipeline instance
+ # All needed input are filled in. Run this pipeline now
find('a,button', text: 'Run').click
# Pipeline is running. We have a "Stop" button instead now.
page.assert_selector 'a,button', text: 'Stop'
+
+ # Wait for pipeline run to complete
+ wait_until_page_has 'Complete', pipeline_config['max_wait_seconds']
end
end
Rails.configuration.diagnostics_testing_pipeline_fields[pipeline_to_run]
end
+ def wait_until_page_has text_to_look_for, max_time=30
+ max_time = 30 if (!max_time || (max_time.to_s != max_time.to_i.to_s))
+ Timeout.timeout(max_time) do
+ loop until page.has_text?(text_to_look_for)
+ end
+ end
+
end