Files
dj/integration-work/browser-test/verify_gpu1_error_live.cjs
T

21 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const {chromium}=require('playwright-core');
const fs=require('node:fs'),assert=require('node:assert/strict');
(async()=>{
const base=JSON.parse(fs.readFileSync('D:/web/dj/huobao-data/last-launch.json')).api.replace('/api/v1','');
const browser=await chromium.launch({channel:'chrome',headless:true});
try {
const page=await browser.newPage({viewport:{width:1500,height:1100}}),errors=[];
page.on('pageerror',e=>errors.push(e.message));
await page.route('**/api/**',route=>['GET','HEAD'].includes(route.request().method())?route.continue():route.abort());
await page.goto(base+'/drama/6/episode/1',{waitUntil:'networkidle'});
await page.locator('.task-drawer-trigger').click();
await page.locator('.task-drawer .gen-task-row').first().waitFor();
const hint=page.getByText('GPU1(ComfyUI 8189)暂不可用:旧节点任务或显存尚未释放。可改选 GPU2/GPU3,或稍后重试。',{exact:true});
await hint.first().waitFor({timeout:5000});assert.ok(await hint.count()>=12);
await hint.first().scrollIntoViewIfNeeded();
await page.screenshot({path:'D:/web/dj/integration-work/gpu1-error-ui-verified.png'});
assert.deepEqual(errors,[]);
console.log('PASS: installed task drawer shows specific GPU1 / ComfyUI 8189 error, no runtime errors, no writes permitted');
}finally{await browser.close()}
})().catch(e=>{console.error(e.stack);process.exit(1)});