X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/767e1199d0e1bdf2b564b5c58a91d29141eb67d7..42c20b25e1325124b88e3b9b285544dc41122b56:/apps/workbench/test/integration/collection_upload_test.rb diff --git a/apps/workbench/test/integration/collection_upload_test.rb b/apps/workbench/test/integration/collection_upload_test.rb index 903df90fb4..608cd521de 100644 --- a/apps/workbench/test/integration/collection_upload_test.rb +++ b/apps/workbench/test/integration/collection_upload_test.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'integration_helper' class CollectionUploadTest < ActionDispatch::IntegrationTest @@ -41,6 +45,9 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest test "Upload two empty files with the same name" do need_selenium "to make file uploads work" visit page_with_token 'active', sandbox_path + + unlock_collection + find('.nav-tabs a', text: 'Upload').click attach_file 'file_selector', testfile_path('empty.txt') assert_selector 'div', text: 'empty.txt' @@ -55,6 +62,9 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest test "Upload non-empty files" do need_selenium "to make file uploads work" visit page_with_token 'active', sandbox_path + + unlock_collection + find('.nav-tabs a', text: 'Upload').click attach_file 'file_selector', testfile_path('a') attach_file 'file_selector', testfile_path('foo.txt') @@ -86,13 +96,16 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest test "Report network error" do need_selenium "to make file uploads work" use_token :admin do - # Even if you somehow do port>2^16, surely nx.example.net won't + # Even if port 0 is a thing, surely nx.example.net won't # respond KeepService.where(service_type: 'proxy').first. update_attributes(service_host: 'nx.example.net', - service_port: 99999) + service_port: 0) end visit page_with_token 'active', sandbox_path + + unlock_collection + find('.nav-tabs a', text: 'Upload').click attach_file 'file_selector', testfile_path('foo.txt') assert_selector 'button:not([disabled])', text: 'Start' @@ -128,4 +141,9 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest # Must be an absolute path. https://github.com/jnicklas/capybara/issues/621 File.join Dir.getwd, 'tmp', filename end + + def unlock_collection + first('.lock-collection-btn').click + accept_alert + end end