2761: diagnostics testing config in application.yml
authorradhika <radhika@curoverse.com>
Wed, 10 Sep 2014 14:40:59 +0000 (10:40 -0400)
committerradhika <radhika@curoverse.com>
Wed, 10 Sep 2014 14:40:59 +0000 (10:40 -0400)
apps/workbench/config/application.default.yml
apps/workbench/test/diagnostics/pipeline_test.rb

index 7c68648c938d7a0b02080dba26c4b1defc889a2d..510dedbbbda0abe668481cdfe4615381d7bc47de 100644 (file)
@@ -95,10 +95,6 @@ common:
   default_openid_prefix: https://www.google.com/accounts/o8/id
   send_user_setup_notification_email: true
 
-  # Configuration for diagnostics testing. Use this to enable diagnostics testing for an env.
-  diagnostics_testing_active_user_token: false
-  # End configuration for diagnostics testing
-
   # Set user_profile_form_fields to enable and configure the user profile page.
   # Default is set to false. A commented setting with full description is provided below.
   user_profile_form_fields: false
@@ -145,3 +141,24 @@ common:
   issue_reporter_email_from: arvados@example.com
   issue_reporter_email_to: arvados@example.com
   support_email_address: arvados@example.com
+
+  # Configuration for diagnostics testing. Use this to enable diagnostics testing for an env.
+  diagnostics_testing_user_tokens: false
+  diagnostics_testing_pipeline_fields: false
+
+  # Below is a sample setting for diagnostics testing.
+  # 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 
+  #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']
+  #  tutorial pipeline 2:
+  #    template_uuid: zzzzz-p5p6p-kfwus81of6y3ezs
+  #    input_names: ['Diagnostic testing - Tutorial pipeline input']
index 431719e6af78f5ffef08de7d32b8fef87cd2c328..fdc9d20a4ca07ec1afe228ebe4eaff15960a9ae8 100644 (file)
@@ -1,55 +1,60 @@
-require 'integration_helper'
+require 'diagnostics_test_helper'
 require 'selenium-webdriver'
 require 'headless'
 
-class PipelineTest < ActionDispatch::IntegrationTest
+class PipelineTest < DiagnosticsTest
+  pipelines_to_run = Rails.configuration.diagnostics_testing_pipeline_fields.andand.keys
+
   setup do
     headless = Headless.new
     headless.start
     Capybara.current_driver = :selenium
   end
 
-  test 'Run tutorial pipeline' do
-    visit page_with_token(Rails.configuration.diagnostics_testing_active_user_token)
-
-    # Search for tutorial template
-    within('.navbar-fixed-top') do
-      page.find_field('search').set 'Diagnostic testing - Tutorial pipeline template'
-      page.find('.glyphicon-search').click
-    end
-
-    within '.modal-content' do
-      find('.selectable', text: 'Diagnostic testing - Tutorial pipeline template').click
-      click_button 'Show'
-    end
-
-    # Tun the pipeline
-    find('a,button', text: 'Run').click
-
-    # Choose project
-    within('.modal-dialog') do
-      find('.selectable', text: 'Home').click
-      find('button', text: 'Choose').click
-    end
-
-    # This pipeline needs input. So, Run should be disabled
-    page.assert_selector 'a.disabled,button.disabled', text: 'Run'
-
-    instance_page = current_path
-
-    # Choose input for the pipeline
-    find('.btn', text: 'Choose').click
-    within('.modal-dialog') do
-      find('.selectable', text: 'Diagnostic testing - Tutorial pipeline input').click
-      find('button', text: 'OK').click
-    end
-    wait_for_ajax
-
-    # 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'
+  pipelines_to_run.andand.each do |pipeline_to_run|
+    test "visit home page for user #{pipeline_to_run}" do
+      visit_page_with_token 'active'
+
+      pipeline_config = diagnostic_test_pipeline_config pipeline_to_run
+
+      # Search for tutorial template
+      within('.navbar-fixed-top') do
+        page.find_field('search').set pipeline_config['template_uuid']
+        page.find('.glyphicon-search').click
+      end
+
+#      within '.modal-content' do
+#        find('.selectable', text: pipeline_config['template_name']).click
+#        find(:xpath, "//div[./span[contains(.,'zzzzz-p5p6p-rxj8d71854j9idn')]]").click
+#        click_button 'Show'
+#      end
+
+      # Run the pipeline
+      find('a,button', text: 'Run').click
+
+      # Choose project
+      within('.modal-dialog') do
+        find('.selectable', text: 'Home').click
+        find('button', text: 'Choose').click
+      end
+
+        # This pipeline needs input. So, Run should be disabled
+        page.assert_selector 'a.disabled,button.disabled', text: 'Run'
+
+        # Choose input for the pipeline
+        find('.btn', text: 'Choose').click
+        within('.modal-dialog') do
+          find('.selectable', text: pipeline_config['input_names'][0]).click
+          find('button', text: 'OK').click
+        end
+        wait_for_ajax
+
+        # 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
 
 end