1 require 'integration_helper'
4 # Diagnostics tests are executed when "RAILS_ENV=diagnostics" is used.
5 # When "RAILS_ENV=test" is used, tests in the "diagnostics" directory
6 # will not be executed.
8 class DiagnosticsTest < ActionDispatch::IntegrationTest
10 # Prepends workbench URL to the path provided and visits that page
11 # Expects path parameters such as "/collections/<uuid>"
12 def visit_page_with_token token_name, path='/'
13 workbench_url = Rails.configuration.arvados_workbench_url
14 if workbench_url.end_with? '/'
15 workbench_url = workbench_url[0, workbench_url.size-1]
17 tokens = Rails.configuration.user_tokens
18 visit page_with_token(tokens[token_name], (workbench_url + path))
21 # Looks for the text_to_look_for for up to the max_time provided
22 def wait_until_page_has text_to_look_for, max_time=30
23 max_time = 30 if (!max_time || (max_time.to_s != max_time.to_i.to_s))
24 Timeout.timeout(max_time) do
25 loop until page.has_text?(text_to_look_for)
29 # Diagnostics tests never want to reset the database fixtures.
31 def self.reset_api_fixtures_now