1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 require 'diagnostics_test_helper'
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
12 class ContainerRequestTest < DiagnosticsTest
13 crs_to_test = Rails.configuration.container_requests_to_test.andand.keys
16 need_selenium 'to make websockets work'
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]
23 visit_page_with_token 'active'
25 find('.btn', text: 'Run a process').click
27 within('.modal-dialog') do
28 page.find_field('Search').set cr_config['workflow_uuid']
30 find('.selectable', text: 'bwa-mem.cwl').click
31 find('.btn', text: 'Next: choose inputs').click
34 page.assert_selector('a.disabled,button.disabled', text: 'Run') if cr_config['input_paths'].any?
36 # Choose input for the workflow
37 cr_config['input_paths'].each do |look_for|
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
46 # container_request is running. Run button is no longer available.
47 page.assert_no_selector('a', text: 'Run')
49 # Wait for container_request run to complete
50 wait_until_page_has 'completed', cr_config['max_wait_seconds']