1 require 'integration_helper'
2 require 'selenium-webdriver'
5 class PipelineInstancesTest < ActionDispatch::IntegrationTest
7 # Selecting collections requiresLocalStorage
8 headless = Headless.new
10 Capybara.current_driver = :selenium
13 test 'Create and run a pipeline' do
14 visit page_with_token('active_trustedclient')
16 visit '/pipeline_templates'
17 within('tr', text: 'Two Part Pipeline Template') do
18 find('a,button', text: 'Run').click
21 # This pipeline needs input. So, Run should be disabled
22 page.assert_selector 'a.disabled,button.disabled', text: 'Run'
24 instance_page = current_path
26 find('button', text: 'Choose a folder...').click
27 within('.modal-dialog') do
28 find('.selectable', text: 'A Folder').click
29 find('button', text: 'Move').click
32 # Go over to the collections page and select something
34 within('tr', text: 'GNU_General_Public_License') do
35 find('input[type=checkbox]').click
37 find('#persistent-selection-count').click
39 # Add this collection to the folder
41 find('.arv-folder-list a,button', text: 'A Folder').click
42 find('.btn', text: 'Add data').click
43 find('span', text: 'foo_tag').click
44 within('.modal-dialog') do
45 find('.btn', text: 'Add').click
48 find('tr[data-kind="arvados#pipelineInstance"]', text: 'New pipeline instance').
49 find('a', text: 'Show').
52 assert find('p', text: 'Provide a value')
54 find('div.form-group', text: 'Foo/bar pair').
55 find('.btn', text: 'Choose').
58 within('.modal-dialog') do
59 find('span', text: 'foo_tag').click
60 find('button', text: 'OK').click
65 # "Run" button is now enabled
66 page.assert_no_selector 'a.disabled,button.disabled', text: 'Run'
68 first('a,button', text: 'Run').click
70 # Pipeline is running. We have a "Stop" button instead now.
71 page.assert_selector 'a,button', text: 'Stop'
72 find('a,button', text: 'Stop').click
74 # Pipeline is stopped. It should now be in paused state and Runnable again.
75 assert page.has_text? 'Paused'
76 page.assert_no_selector 'a.disabled,button.disabled', text: 'Resume'
77 page.assert_selector 'a,button', text: 'Clone and edit'
79 # Since it is test env, no jobs are created to run. So, graph not visible
80 assert_not page.has_text? 'Graph'
83 test 'view pipeline with job and see graph' do
84 visit page_with_token('active_trustedclient')
86 visit '/pipeline_instances'
87 assert page.has_text? 'pipeline_with_job'
89 find('a', text: 'pipeline_with_job').click
91 # since the pipeline component has a job, expect to see the graph
92 assert page.has_text? 'Graph'
94 assert page.has_text? 'script_version'