From: radhika Date: Tue, 9 Sep 2014 17:23:49 +0000 (-0400) Subject: 2761: diagnostics testing X-Git-Tag: 1.1.0~2195^2~24 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/1eedd481146bc30cd2548c44399949cbfa2d576b 2761: diagnostics testing --- diff --git a/apps/workbench/config/diagnostics.yml b/apps/workbench/config/diagnostics.yml new file mode 100644 index 0000000000..b3f9b4800f --- /dev/null +++ b/apps/workbench/config/diagnostics.yml @@ -0,0 +1,14 @@ +# Do not use this file for diagnostics testing configuration. +# Instead, create diagnostics.yml by making a copy + +development: + diagnostics_testing_active_user_token: "eu33jurqntstmwo05h1jr3eblmi961e802703y6657s8zb14r" + diagnostics_testing_admin_user_token: false + +production: + diagnostics_testing_active_user_token: false + diagnostics_testing_admin_user_token: false + +common: + diagnostics_testing_active_user_token: false + diagnostics_testing_admin_user_token: false diff --git a/apps/workbench/config/diagnostics.yml.example b/apps/workbench/config/diagnostics.yml.example new file mode 100644 index 0000000000..4093e4221f --- /dev/null +++ b/apps/workbench/config/diagnostics.yml.example @@ -0,0 +1,14 @@ +# Do not use this file for diagnostics testing configuration. +# Instead, create diagnostics.yml by making a copy + +development: + diagnostics_testing_active_user_token: false + diagnostics_testing_admin_user_token: false + +production: + diagnostics_testing_active_user_token: false + diagnostics_testing_admin_user_token: false + +common: + diagnostics_testing_active_user_token: false + diagnostics_testing_admin_user_token: false diff --git a/apps/workbench/config/load_config.rb b/apps/workbench/config/load_config.rb index 51fc81ab75..f47c8a8a44 100644 --- a/apps/workbench/config/load_config.rb +++ b/apps/workbench/config/load_config.rb @@ -3,7 +3,7 @@ $application_config = {} -%w(application.default application).each do |cfgfile| +%w(application.default application diagnostics).each do |cfgfile| path = "#{::Rails.root.to_s}/config/#{cfgfile}.yml" if File.exists? path yaml = ERB.new(IO.read path).result(binding) diff --git a/apps/workbench/test/diagnostics/pipeline_test.rb b/apps/workbench/test/diagnostics/pipeline_test.rb new file mode 100644 index 0000000000..431719e6af --- /dev/null +++ b/apps/workbench/test/diagnostics/pipeline_test.rb @@ -0,0 +1,55 @@ +require 'integration_helper' +require 'selenium-webdriver' +require 'headless' + +class PipelineTest < ActionDispatch::IntegrationTest + 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' + end + +end diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb index 260bff043c..7f23988837 100644 --- a/apps/workbench/test/test_helper.rb +++ b/apps/workbench/test/test_helper.rb @@ -1,4 +1,5 @@ -ENV["RAILS_ENV"] = "test" +ENV["RAILS_ENV"] = "test" if !ENV["RAILS_ENV"] + unless ENV["NO_COVERAGE_TEST"] begin require 'simplecov' @@ -151,4 +152,6 @@ class ApiServerForTests end end -ApiServerForTests.run +if ENV["RAILS_ENV"].eql? 'test' + ApiServerForTests.run +end