X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2c447c25f810b52e986649a3f4138c671d066092..62eaf39454cf7d3874691fc59174c546767de89c:/apps/workbench/test/integration/anonymous_access_test.rb diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb index 43783bd0ca..bffef339ce 100644 --- a/apps/workbench/test/integration/anonymous_access_test.rb +++ b/apps/workbench/test/integration/anonymous_access_test.rb @@ -145,9 +145,11 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest end [ - [nil, 'job'], + [nil, 'running_job'], + [nil, 'completed_job'], + ['admin', 'running_job'], + ['admin', 'completed_job'], [nil, 'pipelineInstance'], - ['admin', 'job'], ['admin', 'pipelineInstance'], ].each do |token, type| test "user #{token.inspect} accesses jobs and pipelines tab in shared project and clicks on #{type}" do @@ -159,16 +161,16 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest assert_text 'Pipeline in publicly accessible project' # click on type specified collection - if type == 'job' - verify_job_row token + if type.include? 'job' + verify_job_row token, type else verify_pipeline_instance_row token end end end - def verify_job_row user - within first('tr[data-kind="arvados#job"]') do + def verify_job_row user, look_for + within first('tr', text: look_for) do click_link 'Show' end assert_text 'script_version' @@ -176,13 +178,20 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest assert_selector 'a', text: 'Active User' # modified by user assert_selector 'a', text: 'Log' assert_selector 'a', text: 'Move job' - assert_selector 'button', text: 'Cancel' + if look_for.include? 'running' + assert_selector 'button', text: 'Cancel' + assert_no_selector 'button', text: 'Re-run job' + else + assert_selector 'button', text: 'Re-run job' + assert_no_selector 'button', text: 'Cancel' + end else assert_text 'zzzzz-tpzed-xurymjxw79nv3jz' # modified by user assert_no_selector 'a', text: 'zzzzz-tpzed-xurymjxw79nv3jz' assert_no_selector 'a', text: 'Log' assert_no_selector 'a', text: 'Move job' - assert_no_selector 'a', text: 'Re-run job' + assert_no_selector 'button', text: 'Cancel' + assert_no_selector 'button', text: 'Re-run job' end end