HEL-892: document Qwen background removal and simplify eleven workflow summaries
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
+13
-6
@@ -2,13 +2,19 @@
|
||||
import fs from 'node:fs';
|
||||
import assert from 'node:assert/strict';
|
||||
const { chromium } = await import(process.env.PLAYWRIGHT_MODULE || 'playwright');
|
||||
const out = '.local-evidence/audio-document/browser';
|
||||
const out = '.local-evidence/background-reading-regression/audio-document/browser';
|
||||
fs.mkdirSync(out, { recursive: true });
|
||||
const checks = [], requests = [], errors = [];
|
||||
function check(value, text) { assert.ok(value, text); checks.push(text); console.log('PASS ' + text); }
|
||||
const browser = await chromium.launch({ headless: true, executablePath: process.env.BROWSER_EXECUTABLE });
|
||||
try {
|
||||
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
|
||||
await page.route('**/*', route => {
|
||||
const u=new URL(route.request().url());
|
||||
if(u.hostname==='fonts.googleapis.com')return route.fulfill({contentType:'text/css',body:''});
|
||||
if(u.hostname!=='127.0.0.1'||u.pathname==='/api/view') {errors.push('Forbidden request '+u);return route.abort();}
|
||||
return route.continue();
|
||||
});
|
||||
page.on('request', r => { if (r.url().includes('/api/')) requests.push({method:r.method(),url:r.url()}); });
|
||||
page.on('pageerror', e => errors.push(e.message));
|
||||
const list = await (await fetch('http://127.0.0.1:8247/api/workflows')).json();
|
||||
@@ -37,12 +43,13 @@ try {
|
||||
for (const detail of details.slice(0,2)) {
|
||||
const fixed = detail.doc_json.fixed_version;
|
||||
const button = await begin(detail.name); await loaded();
|
||||
await dialog.getByText('核对范围与来源依据', {exact:true}).click();
|
||||
check((await dialog.innerText()).includes(fixed.notice), `${width} ${detail.name}声明/假设提示`);
|
||||
for (const text of ['说明未定稿','未验证实跑','未检查']) check((await dialog.innerText()).includes(text), `${width} ${detail.name} ${text}`);
|
||||
check(!detail.is_enabled && detail.import_state==='needs_conversion' && !detail.doc_completed_at && !detail.exec_verified_at, `${width} ${detail.name}资格未改`);
|
||||
const names = fixed.fields.map(f => `节点 ${f.node_id} · ${f.label}(${f.field})`);
|
||||
const names = fixed.fields.map(f => `节点 ${f.node_id} · ${f.label}`);
|
||||
for (const field of fixed.fields) {
|
||||
const summary = dialog.getByText(`节点 ${field.node_id} · ${field.label}(${field.field})`, {exact:true});
|
||||
const summary = dialog.locator(`details[data-fixed-field="${field.pointer}"] > summary`);
|
||||
await summary.focus(); await page.keyboard.press('Enter');
|
||||
const box = summary.locator('..');
|
||||
check(await box.evaluate(el => el.open), `${width} ${field.node_id}.${field.field}键盘展开`);
|
||||
@@ -57,7 +64,7 @@ try {
|
||||
if (['audioUI','chunk_overlap','quality'].includes(field.field)) await page.screenshot({path:`${out}/${width}-${detail.id}-${field.field}.png`});
|
||||
await summary.click();
|
||||
}
|
||||
check(await dialog.locator('summary').filter({hasText:/节点 \d+ · .*(/}).count() === names.length, `${width} ${detail.name}无跨图参数`);
|
||||
check(await dialog.locator('.card').filter({has:page.getByText('固定版本参数说明',{exact:true})}).locator('summary').filter({hasText:/节点 \d+ · /}).count() === names.length, `${width} ${detail.name}无跨图参数`);
|
||||
if (detail.name==='音频人声分离') {
|
||||
const text=await dialog.innerText();
|
||||
check(text.includes('11槽3 Vocals → 15.audio') && text.includes('10槽0 → 18.audio') && text.includes('18槽0 → 11.audio'), `${width} 3连线/非零槽3`);
|
||||
@@ -71,7 +78,7 @@ try {
|
||||
// Return to H3 and back, ensuring definition lookup does not leak across records.
|
||||
for (const detail of [details[2],details[0],details[1]]) {
|
||||
await begin(detail.name); await loaded();
|
||||
check(await dialog.locator('summary').filter({hasText:/节点 \d+ · .*(/}).count()===detail.doc_json.fixed_version.fields.length, `${width}切换${detail.name}定义不串条`);
|
||||
check(await dialog.locator('.card').filter({has:page.getByText('固定版本参数说明',{exact:true})}).locator('summary').filter({hasText:/节点 \d+ · /}).count()===detail.doc_json.fixed_version.fields.length, `${width}切换${detail.name}定义不串条`);
|
||||
await page.keyboard.press('Escape');
|
||||
}
|
||||
}
|
||||
@@ -81,7 +88,7 @@ try {
|
||||
await page.route(`**/api/workflows/${details[0].id}`, async route=>{entered();await hold;await route.fulfill({json:details[0]});delivered();});
|
||||
await begin(details[0].name); await intercept; await page.keyboard.press('Escape');
|
||||
await begin(details[1].name); await loaded(); release(); await done;
|
||||
check(await dialog.locator('summary').filter({hasText:/节点 \d+ · .*(/}).count()===8, '迟到MP3响应不覆盖人声分离8项');
|
||||
check(await dialog.locator('.card').filter({has:page.getByText('固定版本参数说明',{exact:true})}).locator('summary').filter({hasText:/节点 \d+ · /}).count()===8, '迟到MP3响应不覆盖人声分离8项');
|
||||
await page.unroute(`**/api/workflows/${details[0].id}`); await page.keyboard.press('Escape');
|
||||
check(errors.length===0,'浏览无脚本错误');
|
||||
check(requests.every(r=>r.method==='GET' && new URL(r.url).hostname==='127.0.0.1'),'音频浏览全本地GET,无生成/目标机请求');
|
||||
|
||||
Reference in New Issue
Block a user