X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/72aa70eec7693bfb5d46a4bdac3619b3c6b1f79c..08271aa69aafdc92e2e8f8f25ed7fab078deb993:/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 e4a249e07a..3587721eda 100644 --- a/apps/workbench/test/diagnostics_test_helper.rb +++ b/apps/workbench/test/diagnostics_test_helper.rb @@ -5,6 +5,9 @@ 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 @@ -21,13 +24,12 @@ class DiagnosticsTest < ActionDispatch::IntegrationTest # 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)) + text_found = false Timeout.timeout(max_time) do - loop until page.has_text?(text_to_look_for) + until text_found do + visit_page_with_token 'active', current_path + text_found = has_text?(text_to_look_for) + end end end - - # Diagnostics tests never want to reset the database fixtures. - protected - def self.reset_api_fixtures_now end - end