8784: Fix test for latest firefox.
[arvados.git] / apps / workbench / test / diagnostics / container_request_test.rb
1 require 'diagnostics_test_helper'
2
3 # This test assumes that the configured workflow_uuid corresponds to a cwl workflow.
4 # Ex: configure a workflow using the steps below and use the resulting workflow uuid:
5 #   > cd arvados/doc/user/cwl/bwa-mem
6 #   > arvados-cwl-runner --create-workflow bwa-mem.cwl bwa-mem-input.yml
7
8 class ContainerRequestTest < DiagnosticsTest
9   crs_to_test = Rails.configuration.container_requests_to_test.andand.keys
10
11   setup do
12     need_selenium 'to make websockets work'
13   end
14
15   crs_to_test.andand.each do |cr_to_test|
16     test "run container_request: #{cr_to_test}" do
17       cr_config = Rails.configuration.container_requests_to_test[cr_to_test]
18
19       visit_page_with_token 'active'
20
21       find('.btn', text: 'Run a process').click
22
23       within('.modal-dialog') do
24         page.find_field('Search').set cr_config['workflow_uuid']
25         wait_for_ajax
26         find('.selectable', text: 'bwa-mem.cwl').click
27         find('.btn', text: 'Next: choose inputs').click
28       end
29
30       page.assert_selector('a.disabled,button.disabled', text: 'Run') if cr_config['input_paths'].any?
31
32       # Choose input for the workflow
33       cr_config['input_paths'].each do |look_for|
34         select_input look_for
35       end
36       wait_for_ajax
37
38       # All needed input are already filled in. Run this workflow now
39       page.assert_no_selector('a.disabled,button.disabled', text: 'Run')
40       find('a,button', text: 'Run').click
41
42       # container_request is running. Run button is no longer available.
43       page.assert_no_selector('a', text: 'Run')
44
45       # Wait for container_request run to complete
46       wait_until_page_has 'completed', cr_config['max_wait_seconds']
47     end
48   end
49 end