2872: added graph and run button checks back. the test does not pass right now due...
[arvados.git] / apps / workbench / test / integration / pipeline_instances_test.rb
index e3449f6e98a58d01ae857ed93caee810e84e37e5..a755b1f6425b1ba4ca32ce9ff82b9b30f6293613 100644 (file)
@@ -13,32 +13,53 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
   test 'Create and run a pipeline' do
     visit page_with_token('active_trustedclient')
 
-    click_link 'Pipeline templates'
+    visit '/pipeline_templates'
     within('tr', text: 'Two Part Pipeline Template') do
       find('a,button', text: 'Run').click
     end
 
+    # This pipeline needs input. So, Run should be disabled
+    page.assert_selector 'a.disabled,button.disabled', text: 'Run'
+
     instance_page = current_path
 
+    find('button', text: 'Choose a folder...').click
+    within('.modal-dialog') do
+      find('.selectable', text: 'A Folder').click
+      find('button', text: 'Move').click
+    end
+
     # Go over to the collections page and select something
-    click_link 'Collections (data files)'
+    visit '/collections'
     within('tr', text: 'GNU_General_Public_License') do
       find('input[type=checkbox]').click
     end
     find('#persistent-selection-count').click
 
-    # Go back to the pipeline instance page to use the new selection
-    visit instance_page
+    # Add this collection to the folder
+    visit '/folders'
+    find('.arv-folder-list a,button', text: 'A Folder').click
+    find('.btn', text: 'Add data').click
+    find('span', text: 'foo_tag').click
+    within('.modal-dialog') do
+      find('.btn', text: 'Add').click
+    end
+   
+    find('tr[data-kind="arvados#pipelineInstance"]', text: 'New pipeline instance').
+      find('a', text: 'Show').
+      click
 
-    page.assert_selector 'a.disabled,button.disabled', text: 'Run'
     assert find('p', text: 'Provide a value')
 
     find('div.form-group', text: 'Foo/bar pair').
-      find('a,input').
+      find('.btn', text: 'Choose').
       click
-    find('.editable-input select').click
-    find('.editable-input').
-      first(:option, 'b519d9cb706a29fc7ea24dbea2f05851+249025').click
+
+    within('.modal-dialog') do
+      find('span', text: 'foo_tag').click
+      find('button', text: 'OK').click
+    end
+
     wait_for_ajax
 
     # "Run" button is now enabled
@@ -46,11 +67,17 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
 
     first('a,button', text: 'Run').click
 
+    # Go over to the graph tab
+    click_link 'Provenance'
+    assert page.has_css? 'div#provenance_graph'
+
     # Pipeline is running. We have a "Stop" button instead now.
     page.assert_selector 'a,button', text: 'Stop'
     find('a,button', text: 'Stop').click
 
-    # Pipeline is stopped. We have the option to resume it.
-    page.assert_selector 'a,button', text: 'Run'
+    # Pipeline is stopped. It should now be in paused state and Runnable again.
+    assert page.has_text? 'Paused'
+    page.assert_no_selector 'a.disabled,button.disabled', text: 'Run'
+    page.assert_selector 'a,button', text: 'Clone and edit'
   end
 end