2761: test updates to be able to handle multiple inputs
authorradhika <radhika@curoverse.com>
Wed, 10 Sep 2014 17:45:47 +0000 (13:45 -0400)
committerradhika <radhika@curoverse.com>
Wed, 10 Sep 2014 17:45:47 +0000 (13:45 -0400)
apps/workbench/config/application.default.yml
apps/workbench/test/diagnostics/pipeline_test.rb

index 510dedbbbda0abe668481cdfe4615381d7bc47de..2b1a49b5aa86b11a790296f9e483f65679726a32 100644 (file)
@@ -150,15 +150,18 @@ common:
   # Configure test user tokens as "diagnostics_testing_user_tokens".
   #   At this time the tests need an "active" user token.
   # Also, configure the pipelines to be executed as "diagnostics_testing_pipeline_fields".
-  # For each of the pipeline fields:
-  #   You 
+  # For each of the pipelines identified by the name of your choice
+  #     ("tutorial pipeline" and "tutorial pipeline 2" in this sample):
+  #   template_uuid: is the uuid of the template to be executed
+  #   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. 
   #diagnostics_testing_user_tokens:
   #  active: eu33jurqntstmwo05h1jr3eblmi961e802703y6657s8zb14r
-  #  admin: eu33jurqntstmwo05h1jr3eblmi961e802703y6657s8zb14r
   #diagnostics_testing_pipeline_fields:
   #  tutorial pipeline:
   #    template_uuid: zzzzz-p5p6p-rxj8d71854j9idn
-  #    input_names: ['Diagnostic testing - Tutorial pipeline input']
+  #    input_paths: [zzzzz-4zz18-u9pmni8msw9zm9n]
   #  tutorial pipeline 2:
   #    template_uuid: zzzzz-p5p6p-kfwus81of6y3ezs
-  #    input_names: ['Diagnostic testing - Tutorial pipeline input']
+  #    input_paths: [zzzzz-4zz18-u9pmni8msw9zm9n]
index 126b6a6d21517f95e9614c537fb0c7cffa9eaf8d..2f20b00a00a1d8b4178cf50e05d5ad3a0d690602 100644 (file)
@@ -32,33 +32,35 @@ class PipelineTest < DiagnosticsTest
         find('button', text: 'Choose').click
       end
 
-      if pipeline_config['input_names'].andand.any?
+      # Choose input for the pipeline
+      if pipeline_config['input_paths'].andand.any?
         # This pipeline needs input. So, Run should be disabled
         page.assert_selector 'a.disabled,button.disabled', text: 'Run'
 
-        inputs = page.all('.btn', text: 'Choose')
-        inputs.each_with_index do |input, index|
-          # Choose input for the pipeline
-          input.click
+        inputs_needed = page.all('.btn', text: 'Choose')
+        inputs_needed.each_with_index do |input_needed, index|
+          input_needed.click
           within('.modal-dialog') do
-            input_found = page.has_text?(pipeline_config['input_names'][index])
-            if input_found
-              find('.selectable', text: pipeline_config['input_names'][index]).click
+            look_for = pipeline_config['input_paths'][index]
+            found = page.has_text?(look_for)
+            if found
+              find('.selectable').click
             else
-              fill_in('Search', with: pipeline_config['input_names'][index], exact: true)
+              fill_in('Search', with: look_for, exact: true)
               wait_for_ajax
-              find('.selectable', text: pipeline_config['input_names'][index]).click
+              find('.selectable').click
             end
             find('button', text: 'OK').click
             wait_for_ajax
           end
-
-          # Run this pipeline instance
-          find('a,button', text: 'Run').click
-          # Pipeline is running. We have a "Stop" button instead now.
-          page.assert_selector 'a,button', text: 'Stop'
         end
       end
+
+      # Run this pipeline instance
+      find('a,button', text: 'Run').click
+
+      # Pipeline is running. We have a "Stop" button instead now.
+      page.assert_selector 'a,button', text: 'Stop'
     end
   end