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