Merge branch 'master' into 13822-nm-delayed-daemon
[arvados.git] / apps / workbench / test / diagnostics / pipeline_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'diagnostics_test_helper'
6
7 class PipelineTest < DiagnosticsTest
8   pipelines_to_test = Rails.configuration.pipelines_to_test.andand.keys
9
10   setup do
11     need_selenium 'to make websockets work'
12   end
13
14   pipelines_to_test.andand.each do |pipeline_to_test|
15     test "run pipeline: #{pipeline_to_test}" do
16       visit_page_with_token 'active'
17       pipeline_config = Rails.configuration.pipelines_to_test[pipeline_to_test]
18
19       # Search for tutorial template
20       find '.navbar-fixed-top'
21       within('.navbar-fixed-top') do
22         page.find_field('search this site').set pipeline_config['template_uuid']
23         page.find('.glyphicon-search').click
24       end
25
26       # Run the pipeline
27       assert_triggers_dom_event 'shown.bs.modal' do
28         find('a,button', text: 'Run').click
29       end
30
31       # Choose project
32       within('.modal-dialog') do
33         find('.selectable', text: 'Home').click
34         find('button', text: 'Choose').click
35       end
36
37       page.assert_selector('a.disabled,button.disabled', text: 'Run') if pipeline_config['input_paths'].any?
38
39       # Choose input for the pipeline
40       pipeline_config['input_paths'].each do |look_for|
41         select_input look_for
42       end
43       wait_for_ajax
44
45       # All needed input are filled in. Run this pipeline now
46       find('a,button', text: 'Components').click
47       find('a,button', text: 'Run').click
48
49       # Pipeline is running. We have a "Pause" button instead now.
50       page.assert_selector 'a,button', text: 'Pause'
51
52       # Wait for pipeline run to complete
53       wait_until_page_has 'completed', pipeline_config['max_wait_seconds']
54     end
55   end
56 end