- 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
+ 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
+ skip 'Test suite does not use TLS'
+ need_selenium "to make file uploads work"
+ use_token :admin do
+ KeepService.where(service_type: 'proxy').first.
+ update_attributes(service_ssl_flag: false)
+ end
+ visit page_with_token 'active', sandbox_path
+ find('.nav-tabs a', text: 'Upload').click
+ attach_file 'file_selector', testfile_path('foo.txt')
+ assert_selector 'button:not([disabled])', text: 'Start'
+ click_button 'Start'
+ using_wait_time 5 do
+ assert_text :visible, 'server setup problem'
+ assert_text :visible, 'cannot be used from origin'
+ end
+ end
+
+ test "Report network error" do
+ need_selenium "to make file uploads work"
+ use_token :admin do
+ # 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: 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'
+ click_button 'Start'
+ using_wait_time 5 do
+ assert_text :visible, 'network error'