Merge branch 'master' into 9372-container-display
[arvados.git] / apps / workbench / test / diagnostics_test_helper.rb
index 392e7d0fd0368af26d1eb395d5bf640fb9eeabf8..c7433bb247450464fb42fa780e309ce09fdb27b7 100644 (file)
@@ -5,8 +5,13 @@ require 'yaml'
 # 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/<uuid>"
   def visit_page_with_token token_name, path='/'
     workbench_url = Rails.configuration.arvados_workbench_url
     if workbench_url.end_with? '/'
@@ -16,6 +21,7 @@ class DiagnosticsTest < ActionDispatch::IntegrationTest
     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