Files
archie/e2e/checks/workflow-validation.cjs
T

24 lines
1.4 KiB
JavaScript

const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot }) => {
await go('/workflows');
await page.getByRole('button', {name:/^implement/}).click();
await page.locator('.vue-flow__node').filter({hasText:'Prepare worktree'}).first().click();
const condition=page.getByLabel('Run only when', {exact:true});
await condition.fill('what');
await page.getByRole('alert').filter({hasText:'when must name'}).first().waitFor();
assert.equal(await page.getByRole('button',{name:'Save',exact:true}).isDisabled(),true);
await condition.fill('task.title');
const backoff=page.getByLabel('Retry backoff',{exact:true});
await backoff.fill('yes');
await page.getByText('Enter a number zero or greater.',{exact:true}).waitFor();
assert.equal(await page.getByRole('button',{name:'Save',exact:true}).isDisabled(),true);
await backoff.fill('0.5');
await page.getByLabel('Run only when',{exact:true}).focus();
await page.getByText('Enter a number zero or greater.',{exact:true}).waitFor({state:'hidden'});
assert.equal(await page.getByRole('button',{name:'Save',exact:true}).isEnabled(),true);
await page.getByRole('combobox',{name:'Unit',exact:true}).selectOption('m');
await page.getByRole('tab',{name:'YAML',exact:true}).click();
assert.match(await page.getByLabel('Workflow YAML',{exact:true}).inputValue(), /backoff: 30s/);
await shot('validated');
};