X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7ad2ce19e1db57314ff106bfcfa83f47c8daec2e..e7d49ab46462902a98d812b69d7257d837f85e90:/apps/workbench/test/diagnostics_test_helper.rb diff --git a/apps/workbench/test/diagnostics_test_helper.rb b/apps/workbench/test/diagnostics_test_helper.rb index a78bf6649f..c7433bb247 100644 --- a/apps/workbench/test/diagnostics_test_helper.rb +++ b/apps/workbench/test/diagnostics_test_helper.rb @@ -1,17 +1,27 @@ require 'integration_helper' require 'yaml' +# Diagnostics tests are executed when "RAILS_ENV=diagnostics" is used. +# When "RAILS_ENV=test" is used, tests in the "diagnostics" directory +# will not be executed. + +# Command to run diagnostics tests: +# RAILS_ENV=diagnostics bundle exec rake TEST=test/diagnostics/**/*.rb + class DiagnosticsTest < ActionDispatch::IntegrationTest + # Prepends workbench URL to the path provided and visits that page + # Expects path parameters such as "/collections/" def visit_page_with_token token_name, path='/' - tokens = Rails.configuration.diagnostics_testing_user_tokens - visit page_with_token(tokens[token_name], path) - end - - def diagnostic_test_pipeline_config pipeline_to_run - Rails.configuration.diagnostics_testing_pipeline_fields[pipeline_to_run] + workbench_url = Rails.configuration.arvados_workbench_url + if workbench_url.end_with? '/' + workbench_url = workbench_url[0, workbench_url.size-1] + end + tokens = Rails.configuration.user_tokens + visit page_with_token(tokens[token_name], (workbench_url + path)) end + # Looks for the text_to_look_for for up to the max_time provided def wait_until_page_has text_to_look_for, max_time=30 max_time = 30 if (!max_time || (max_time.to_s != max_time.to_i.to_s)) Timeout.timeout(max_time) do