X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9bc64c76164e6b11cbbfd0bdb86483243bb08306..8c948701e887e96f05ffaf0adaec9da9f2533f72:/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 5e407cea33..552a9cd5e8 100644 --- a/apps/workbench/test/integration/collection_upload_test.rb +++ b/apps/workbench/test/integration/collection_upload_test.rb @@ -41,6 +41,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' @@ -52,23 +55,20 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest assert_match /_text":"\. d41d8\S+ 0:0:empty.txt\\n\. d41d8\S+ 0:0:empty\\\\040\(1\).txt\\n"/, body end - test "Upload non-empty files, report errors" do + 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') assert_selector 'button:not([disabled])', text: 'Start' click_button 'Start' - if "test environment does not have a keepproxy yet, see #4534" != "fixed" - using_wait_time 20 do - assert_text :visible, 'error' - end - else - assert_text :visible, 'Done!' - visit sandbox_path+'.json' - assert_match /_text":"\. 0cc1\S+ 0:1:a\\n\. acbd\S+ 0:3:foo.txt\\n"/, body - end + assert_text :visible, 'Done!' + visit sandbox_path+'.json' + assert_match /_text":"\. 0cc1\S+ 0:1:a\\n\. acbd\S+ 0:3:foo.txt\\n"/, body end test "Report mixed-content error" do @@ -99,6 +99,9 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest service_port: 99999) 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' @@ -134,4 +137,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