1 require 'diagnostics_test_helper'
2 require 'selenium-webdriver'
5 class PipelineTest < DiagnosticsTest
6 pipelines_to_run = Rails.configuration.diagnostics_testing_pipeline_fields.andand.keys
9 headless = Headless.new
11 Capybara.current_driver = :selenium
14 pipelines_to_run.andand.each do |pipeline_to_run|
15 test "visit home page for user #{pipeline_to_run}" do
16 visit_page_with_token 'active'
18 pipeline_config = diagnostic_test_pipeline_config pipeline_to_run
20 # Search for tutorial template
21 within('.navbar-fixed-top') do
22 page.find_field('search').set pipeline_config['template_uuid']
23 page.find('.glyphicon-search').click
27 find('a,button', text: 'Run').click
30 within('.modal-dialog') do
31 find('.selectable', text: 'Home').click
32 find('button', text: 'Choose').click
35 # Choose input for the pipeline
36 if pipeline_config['input_paths'].andand.any?
37 # This pipeline needs input. So, Run should be disabled
38 page.assert_selector 'a.disabled,button.disabled', text: 'Run'
40 inputs_needed = page.all('.btn', text: 'Choose')
41 inputs_needed.each_with_index do |input_needed, index|
43 within('.modal-dialog') do
44 look_for = pipeline_config['input_paths'][index]
45 found = page.has_text?(look_for)
47 find('.selectable').click
49 fill_in('Search', with: look_for, exact: true)
51 find('.selectable').click
53 find('button', text: 'OK').click
59 # Run this pipeline instance
60 find('a,button', text: 'Run').click
62 # Pipeline is running. We have a "Stop" button instead now.
63 page.assert_selector 'a,button', text: 'Stop'