Files
archie/e2e/checks/workflow-validation.cjs
T
sam cdfdf3a756 fix(e2e): workflow checks drive the reworked step cards (#1966)
A duration field with an id now takes its accessible name from its label
instead of a fixed 'Duration' aria-label.
2026-11-14 15:05:53 +11:00

26 lines
1.6 KiB
JavaScript

const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot }) => {
await go('/workflows');
await page.getByRole('button', {name:/^implement(?! actions)/}).click();
const runPicker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
if (await runPicker.count()) { await runPicker.click(); await page.getByRole('option', { name: 'Definition', exact: true }).click(); }
await page.locator('.vue-flow__node').filter({hasText:'Prepare worktree'}).first().click();
const more=page.getByRole('button',{name:'More',exact:true}).filter({hasText:'More'});
if (await more.getAttribute('aria-expanded')==='false') await more.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();
await condition.fill('task.title');
await page.getByRole('alert').filter({hasText:'when must name'}).first().waitFor({state:'hidden'});
const backoff=page.getByLabel('Retry backoff',{exact:true});
await backoff.fill('yes');
await page.getByText('Enter a number zero or greater.',{exact:true}).waitFor();
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'});
await page.getByRole('combobox',{name:'Unit',exact:true}).selectOption('m');
await page.getByRole('tab',{name:'History',exact:true}).click();
assert.match(await page.getByLabel('Workflow YAML',{exact:true}).inputValue(), /backoff: 30s/);
await shot('validated');
};