Files
kefu/deploy/review-visibility-20260916/frontend-final-screenshots.mjs
T
2026-09-21 10:34:06 +08:00

20 lines
1.8 KiB
JavaScript

import {createRequire} from 'node:module';
import assert from 'node:assert/strict';
const require=createRequire('C:/kefu/admin-web/package.json');const {chromium}=require('playwright');
const browser=await chromium.launch({executablePath:'C:/Program Files/Google/Chrome/Application/chrome.exe',headless:true});
for(const [label,root] of [['protocol','C:/wechat_rpa'],['classic','C:/kefu/wechat_rpa']]){
const context=await browser.newContext({viewport:{width:1440,height:900},deviceScaleFactor:2});
await context.route('**/*',route=>route.request().url().startsWith('file:')?route.continue():route.abort());
const p=await context.newPage();await p.goto(`file:///${root}/assets/ui/zhenyang-ai-console.html`);await p.waitForTimeout(250);
await p.evaluate(()=>{
window.qtBridge={};
const task={key:'test-uncertain-001',name:'模拟客户',sessionId:'test-session',messages:[{time:'10:00',text:'合成测试问题'}],answer:'合成回复草稿,请核对发送结果。',awaitingReview:false,canApprove:false,canRetry:false,needsHuman:true,isProtocol:true,deliveryUncertain:true,reviewReason:'发送结果待人工核对',action:'发送结果待核对',stepIndex:4};
applyState({view:'queue',demo:false,ready:true,metrics:{review:0,human:1},people:[{key:task.key,name:task.name,status:'需人工',bubbles:1}],selectedKey:task.key,task,queueFilter:'需人工',system:{scale:'自动'}});
});
assert.match(await p.locator('[data-action="handoff-task"]').innerText(),/核对后转人工/);
assert.equal(await p.locator('[data-action="approve-task"],[data-action="retry-task"],[data-action="cancel-task"]').count(),0);
await p.screenshot({path:`C:/kefu/deploy/review-visibility-20260916/qa/${label}-uncertain-delivery.png`,scale:'css',fullPage:true});
await context.close();
}
await browser.close();console.log('Both final unknown-receipt screenshots verified.');