1 require 'integration_helper'
2 require 'selenium-webdriver'
5 class PipelineTest < ActionDispatch::IntegrationTest
7 headless = Headless.new
9 Capybara.current_driver = :selenium
12 test 'Run tutorial pipeline' do
13 visit page_with_token(Rails.configuration.diagnostics_testing_active_user_token)
15 # Search for tutorial template
16 within('.navbar-fixed-top') do
17 page.find_field('search').set 'Diagnostic testing - Tutorial pipeline template'
18 page.find('.glyphicon-search').click
21 within '.modal-content' do
22 find('.selectable', text: 'Diagnostic testing - Tutorial pipeline template').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 # This pipeline needs input. So, Run should be disabled
36 page.assert_selector 'a.disabled,button.disabled', text: 'Run'
38 instance_page = current_path
40 # Choose input for the pipeline
41 find('.btn', text: 'Choose').click
42 within('.modal-dialog') do
43 find('.selectable', text: 'Diagnostic testing - Tutorial pipeline input').click
44 find('button', text: 'OK').click
48 # Run this pipeline instance
49 find('a,button', text: 'Run').click
51 # Pipeline is running. We have a "Stop" button instead now.
52 page.assert_selector 'a,button', text: 'Stop'