fix(ui): e2e checks match the current dashboard; trim stray label whitespace, keep Home/End in suggest input
This commit is contained in:
1 parent
acf9ce2cd5
commit
4fab3d766a
11 files changed
+51
-48
No files matched your search
@@ -14,7 +14,9 @@ module.exports = async ({ page, go, shot }) => {
|
||||
const openSettings = async () => {
|
||||
await go('/workflows');
|
||||
await page.getByRole('button', { name: /^implement/ }).click();
|
||||
await page.locator('.vue-flow__node').filter({ hasText: 'Start' }).first().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: 'Workflow' }).first().click();
|
||||
return page.getByRole('combobox', { name: 'Execution identity', exact: true });
|
||||
};
|
||||
try {
|
||||
@@ -23,23 +25,25 @@ module.exports = async ({ page, go, shot }) => {
|
||||
});
|
||||
assert.equal(created.ok(), true, await created.text());
|
||||
agent = await created.json();
|
||||
const select = await openSettings();
|
||||
await select.locator(`option[value="${agent.id}"]`).waitFor({ state: 'attached' });
|
||||
assert.equal(await select.locator(`option[value="${agent.id}"]`).textContent(), agent.display_name);
|
||||
await select.selectOption(agent.id);
|
||||
assert.equal(await select.inputValue(), agent.id);
|
||||
const trigger = await openSettings();
|
||||
await page.waitForFunction(() => !document.querySelector('[aria-label="Execution identity"]')?.hasAttribute('disabled'));
|
||||
await trigger.click();
|
||||
await page.getByRole('option', { name: agent.display_name, exact: true }).click();
|
||||
assert.match(await trigger.innerText(), new RegExp(agent.display_name));
|
||||
await shot('named-execution-identity');
|
||||
await command('rename', agent.display_name + ' renamed');
|
||||
await page.reload();
|
||||
const renamed = await openSettings();
|
||||
await renamed.locator(`option[value="${agent.id}"]`).waitFor({ state: 'attached' });
|
||||
assert.equal(await renamed.locator(`option[value="${agent.id}"]`).textContent(), agent.display_name);
|
||||
await page.waitForFunction(() => !document.querySelector('[aria-label="Execution identity"]')?.hasAttribute('disabled'));
|
||||
await renamed.click();
|
||||
await page.getByRole('option', { name: agent.display_name, exact: true }).waitFor();
|
||||
await page.keyboard.press('Escape');
|
||||
await command('suspend');
|
||||
await page.reload();
|
||||
const suspended = await openSettings();
|
||||
await suspended.waitFor();
|
||||
await page.waitForFunction(() => !document.querySelector('select[aria-label="Execution identity"]')?.disabled);
|
||||
assert.equal(await suspended.locator(`option[value="${agent.id}"]:not([disabled])`).count(), 0);
|
||||
await page.waitForFunction(() => !document.querySelector('[aria-label="Execution identity"]')?.hasAttribute('disabled'));
|
||||
await suspended.click();
|
||||
assert.equal(await page.getByRole('option', { name: agent.display_name, exact: true }).and(page.locator(':not([data-disabled])')).count(), 0);
|
||||
} finally {
|
||||
if (agent && agent.lifecycle !== 'retired') await command('retire');
|
||||
}
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
// Draft edits only: no saved configuration is changed.
|
||||
const assert = require('node:assert/strict');
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
await go('/settings/schedules');
|
||||
await page.getByRole('button', { name: 'Add schedule', exact: true }).click();
|
||||
await page.getByLabel('Schedule name', { exact: true }).fill('Daily repository check');
|
||||
await page.getByLabel('Instructions', { exact: true }).fill('Check the repository and report actionable failures.\n'.repeat(20));
|
||||
assert.equal(await page.getByLabel('ID', { exact: true }).count(), 0);
|
||||
await page.getByRole('link', { name: 'Dashboard', exact: true }).click();
|
||||
await page.getByRole('link', { name: 'Settings', exact: true }).click();
|
||||
await go('/settings/channels');
|
||||
const workspace = page.getByLabel('Workspace', { exact: true });
|
||||
assert.equal(await page.getByRole('region', { name: 'Unsaved changes' }).count(), 0, 'unsaved bar before any edit');
|
||||
await workspace.fill('/srv/e2e-workspace');
|
||||
await page.getByRole('link', { name: 'Models', exact: true }).click();
|
||||
await page.getByRole('heading', { name: 'Models' }).waitFor();
|
||||
await page.getByRole('link', { name: 'Channels', exact: true }).click();
|
||||
await page.getByText('Chat session defaults', { exact: true }).waitFor();
|
||||
const form = await page.getByText('Chat session defaults', { exact: true }).evaluate(el => el.closest('section').getBoundingClientRect().width);
|
||||
assert.equal(await page.getByLabel('Workspace', { exact: true }).inputValue(), '/srv/e2e-workspace', 'edit lost on navigation');
|
||||
const form = await page.getByText('Chat session defaults', { exact: true }).evaluate(el => el.closest('[data-slot="card"]').getBoundingClientRect().width);
|
||||
assert.ok(form <= 850, `settings form stretched to ${form}px`);
|
||||
const review = page.getByRole('button', { name: 'Review and save', exact: true });
|
||||
await review.scrollIntoViewIfNeeded();
|
||||
@@ -18,14 +17,13 @@ module.exports = async ({ page, go, shot }) => {
|
||||
assert.ok(unobscured, 'Review and save is covered');
|
||||
await review.click();
|
||||
await page.getByRole('heading', { name: /^Review \d/ }).waitFor();
|
||||
await page.getByText('Daily repository check', { exact: false }).last().waitFor();
|
||||
assert.equal(await page.locator('li p').filter({ hasText: /^After:.*\{"id":/ }).count(), 0, 'review contains a raw schedule object');
|
||||
await page.getByText('/srv/e2e-workspace', { exact: false }).last().waitFor();
|
||||
await shot('review');
|
||||
await page.getByRole('button', { name: 'Discard all', exact: true }).click();
|
||||
assert.equal(await page.getByRole('region', { name: 'Unsaved changes' }).count(), 0);
|
||||
assert.equal(await page.getByLabel('Workspace', { exact: true }).inputValue(), '', 'discard kept the edit');
|
||||
await page.setViewportSize({width:390,height:844});
|
||||
await page.getByRole('link',{name:'Schedules',exact:true}).click();
|
||||
await page.getByRole('button',{name:'Add schedule',exact:true}).click();
|
||||
await page.getByLabel('Workspace', { exact: true }).fill('/srv/e2e-workspace');
|
||||
const mobileReview=page.getByRole('button',{name:'Review and save',exact:true});
|
||||
await mobileReview.scrollIntoViewIfNeeded();
|
||||
assert.ok(await mobileReview.evaluate(el=>{const r=el.getBoundingClientRect();return el.contains(document.elementFromPoint(r.x+r.width/2,r.y+r.height/2))}), 'mobile save action covered');
|
||||
|
||||
@@ -12,8 +12,8 @@ module.exports=async({page,go,shot})=>{
|
||||
const logs=await (await page.request.get(`${base}/api/tasks/${task.id}/logs?attempt=${state.current_attempt}&level=ERROR&limit=1`)).json();
|
||||
await page.getByRole('button',{name:'Jump to log line',exact:true}).click();
|
||||
if(logs.entries?.[0]?.id){
|
||||
await page.locator(`[data-log-id="${logs.entries[0].id}"]`).waitFor();
|
||||
await page.waitForFunction(id=>document.activeElement?.getAttribute('data-log-id')===String(id),logs.entries[0].id);
|
||||
await page.locator(`[data-row-key="${logs.entries[0].id}"]`).waitFor();
|
||||
await page.waitForFunction(id=>document.activeElement?.getAttribute('data-row-key')===String(id),logs.entries[0].id);
|
||||
}else{
|
||||
await page.getByText('No error log line was recorded for this attempt.',{exact:true}).waitFor();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ module.exports = async ({ page, go, shot }) => {
|
||||
await page.getByText('Loading workflows…', { exact: true }).waitFor({ state: 'hidden' });
|
||||
await page.getByRole('button', { name: /^implement/ }).click();
|
||||
assert.equal(await page.getByText(/workflow implement has no steps/).count(), 0, 'late definition left an empty canvas');
|
||||
await page.locator('.vue-flow__node').filter({ hasText: 'Repository gate' }).first().waitFor();
|
||||
await page.locator('.vue-flow__node').filter({ hasText: 'Repository' }).first().waitFor();
|
||||
await shot('loaded');
|
||||
};
|
||||
@@ -71,14 +71,14 @@ module.exports = async ({ page, go, shot }) => {
|
||||
const response = await page.request.get(new URL('/api/control-plane/resources/workflow-definitions', page.url()).href);
|
||||
const resource = await response.json();
|
||||
const definition = resource.resource.value.definitions.find(entry => entry.id === 'feasibility');
|
||||
definition.yaml = definition.yaml.replace(/\bid: prd\b/, 'id: Write a Product Requirement Document').replaceAll('steps.prd.', 'steps.Write a Product Requirement Document.');
|
||||
definition.yaml = definition.yaml.replace(/\bid: assess\b/, 'id: Write a Product Requirement Document').replaceAll('steps.assess.', 'steps.Write a Product Requirement Document.');
|
||||
await page.route('**/api/control-plane/resources/workflow-definitions', route => route.fulfill({ json: resource }));
|
||||
await page.setViewportSize({ width: 320, height: 700 });
|
||||
await go('/workflows?workflow=feasibility');
|
||||
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
|
||||
const yaml = await page.getByLabel('Workflow YAML', { exact: true }).inputValue();
|
||||
assert.ok(yaml.includes('id: write-a-product-requirement-document'));
|
||||
assert.ok(yaml.includes('steps.write-a-product-requirement-document.summary'));
|
||||
assert.ok(yaml.includes('steps.write-a-product-requirement-document.result'));
|
||||
assert.ok(!yaml.includes('steps.Write a Product Requirement Document'));
|
||||
assert.equal(await page.evaluate(() => document.documentElement.scrollHeight), 700, 'YAML causes page scroll');
|
||||
await page.getByRole('tab', { name: 'Canvas', exact: true }).click();
|
||||
@@ -111,6 +111,7 @@ module.exports = async ({ page, go, shot }) => {
|
||||
: route.continue();
|
||||
});
|
||||
await page.route('**/api/tasks/999999/*?*', route => route.fulfill({ json: {} }));
|
||||
await page.route('**/api/tasks/999999/debug', route => route.fulfill({ json: {} }));
|
||||
await page.route('**/api/tasks/999999/attempts', route => route.fulfill({ json: { attempts: [{ attempt: 1, stages: [{ name: 'Write a Product Requirement Document', status: 'failed', error: 'Historical failure' }] }] } }));
|
||||
await go('/workflows?workflow=feasibility');
|
||||
const picker = page.getByRole('combobox', { name: 'Run shown on the canvas' });
|
||||
@@ -135,6 +136,8 @@ module.exports = async ({ page, go, shot }) => {
|
||||
assert.equal(await picker.innerText(), 'Definition');
|
||||
await capture('definition-picker-320');
|
||||
await go('/workflows?workflow=triage');
|
||||
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').hover();
|
||||
await page.mouse.wheel(0, 650);
|
||||
await page.waitForTimeout(300);
|
||||
@@ -155,6 +158,7 @@ module.exports = async ({ page, go, shot }) => {
|
||||
await handoff.click();
|
||||
await target.fill('implement');
|
||||
await page.keyboard.press('Escape');
|
||||
await page.keyboard.press('Escape');
|
||||
await page.getByRole('tab', { name: 'YAML', exact: true }).click();
|
||||
assert.ok((await page.getByLabel('Workflow YAML', { exact: true }).inputValue()).includes('workflow: implement'));
|
||||
};
|
||||
@@ -2,20 +2,20 @@ const assert = require('node:assert/strict');
|
||||
module.exports = async ({ page, go, shot }) => {
|
||||
await go('/workflows');
|
||||
await page.getByRole('button', {name:/^implement/}).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 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');
|
||||
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();
|
||||
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/);
|
||||
|
||||
Reference in new issue
Block a user