Merge branch 'master' into 2761-diagnostic-suite
[arvados.git] / apps / workbench / test / diagnostics_test_helper.rb
1 require 'integration_helper'
2 require 'yaml'
3
4 class DiagnosticsTest < ActionDispatch::IntegrationTest
5
6   def visit_page_with_token token_name, path='/'
7     tokens = Rails.configuration.diagnostics_testing_user_tokens
8     visit page_with_token(tokens[token_name], path)
9   end
10
11   def diagnostic_test_pipeline_config pipeline_to_run
12     Rails.configuration.diagnostics_testing_pipeline_fields[pipeline_to_run]
13   end
14
15   def wait_until_page_has text_to_look_for, max_time=30
16     max_time = 30 if (!max_time || (max_time.to_s != max_time.to_i.to_s))
17     Timeout.timeout(max_time) do
18       loop until page.has_text?(text_to_look_for)
19     end
20   end
21
22 end