github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/web/wats/test/smoke.js (about) 1 import test from 'ava'; 2 3 const Suite = require('../helpers/suite'); 4 5 test.beforeEach(async t => { 6 t.context = new Suite(); 7 await t.context.init(t); 8 }); 9 10 test.afterEach(async t => { 11 t.context.passed(t); 12 }); 13 14 test.afterEach.always(async t => { 15 await t.context.finish(t); 16 }); 17 18 test('running pipelines', async t => { 19 await t.context.fly.run('set-pipeline -n -p some-pipeline -c fixtures/smoke-pipeline.yml'); 20 await t.context.fly.run('unpause-pipeline -p some-pipeline'); 21 22 var result = await t.context.fly.run('trigger-job -j some-pipeline/say-hello -w'); 23 t.regex(result.stdout, /Hello, world!/); 24 t.regex(result.stdout, /pushing version: put-version/); 25 26 await t.context.web.page.goto(t.context.web.route(`/`)); 27 const group = `.dashboard-team-group[data-team-name="${t.context.teamName}"]`; 28 await t.context.web.scrollIntoView(group); 29 await t.context.web.waitForText('some-pipeline'); 30 31 await t.context.web.page.goto(t.context.web.route(`/teams/${t.context.teamName}/pipelines/some-pipeline`)); 32 await t.context.web.waitForText('say-hello'); 33 34 await t.context.web.page.goto(t.context.web.route(`/teams/${t.context.teamName}/pipelines/some-pipeline/jobs/say-hello/builds/1`)); 35 await t.context.web.page.waitFor('.build-header[style*="rgb(17, 197, 96)"]'); // green 36 await t.context.web.clickAndWait('[data-step-name="hello"] .header', '[data-step-name="hello"] .step-body:not(.step-collapsed)'); 37 await t.context.web.waitForText('Hello, world!'); 38 39 t.true(true); 40 }); 41 42 test('running one-off builds', async t => { 43 var result = await t.context.fly.run('execute -c fixtures/smoke-task.yml -i some-input=fixtures/some-input'); 44 t.regex(result.stdout, /Hello, world!/); 45 }); 46 47 test('reaching the internet', async t => { 48 await t.context.fly.run('set-pipeline -n -p some-pipeline -c fixtures/smoke-internet-pipeline.yml'); 49 await t.context.fly.run('unpause-pipeline -p some-pipeline'); 50 51 var result = await t.context.fly.run('trigger-job -j some-pipeline/use-the-internet -w'); 52 t.regex(result.stdout, /'index.html' saved/); 53 });