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

23 lines
1.4 KiB
JavaScript

const {chromium}=require('playwright-core');
const assert=require('node:assert/strict'),fs=require('node:fs');
(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:1000}}),errors=[];
page.on('pageerror',e=>errors.push(e.message));
await page.goto(base+'/settings',{waitUntil:'networkidle'});
const rows=page.locator('.config-row');
assert.equal(await rows.count(),28);
assert.equal(await rows.filter({hasText:'ComfyUI'}).count(),24);
assert.equal(await rows.filter({hasText:/端口 1879[24]/}).count(),0);
for(const [gpu,port] of [['GPU1',8189],['GPU2',8188],['GPU3',8191]])assert.equal(await rows.filter({hasText:gpu+' · ComfyUI '+port}).count(),6);
assert.equal(await rows.filter({hasText:'容器内'}).count(),0);
for(const gpu of ['GPU1','GPU2','GPU3'])assert.equal(await rows.filter({hasText:new RegExp(' · '+gpu)}).count(),6);
await rows.filter({hasText:'MiniMax H3 · GPU1'}).scrollIntoViewIfNeeded();
await page.screenshot({path:'D:/web/dj/integration-work/gpu-live-model-configs.png'});
assert.deepEqual(errors,[]);
console.log('PASS: 24 ComfyUI labels with actual 8189/8188/8191 panel mapping; no UI errors');
}finally{await browser.close()}
})().catch(e=>{console.error(e.stack);process.exit(1)});