Files
aigc-home/e2e/hel732-conflict.cjs
T

13 lines
1.5 KiB
JavaScript

// Review-only proposal: temporary browser style; never change product/sample code.
const {chromium}=require(process.env.PLAYWRIGHT_MODULE_PATH||'playwright');
const fs=require('node:fs');const out='e2e/shots/hel732';
(async()=>{const b=await chromium.launch({args:['--no-sandbox']});const rows=[];
try {for(const [width,height] of [[1366,768],[1280,720]]){
const p=await b.newPage({viewport:{width,height}});await p.goto('http://127.0.0.1:5173/agents');await p.locator('.roster .acard').first().waitFor();
const measure=()=>p.evaluate(()=>{const hero=document.querySelector('.ahero').getBoundingClientRect(),button=document.querySelector('.big-input .primary').getBoundingClientRect();return {heroHeight:hero.height,heroBottom:hero.bottom,buttonTop:button.top,buttonBottom:button.bottom,clipped:button.bottom>hero.bottom,viewport:innerHeight}});
const before=await measure();await p.screenshot({path:`${out}/conflict-${width}-actual.png`,animations:'disabled'});
await p.locator('.ahero').evaluate(e=>e.style.flexShrink='0');const proposal=await measure();await p.screenshot({path:`${out}/proposal-${width}-browser-only.png`,animations:'disabled'});
rows.push({width,height,before,proposal,temporaryRule:'.ahero {flex-shrink:0}',productCodeChanged:false});await p.close();
}fs.writeFileSync(out+'/conflict.json',JSON.stringify(rows,null,2));console.log('RECORDED visual blocker and browser-only proposal',rows);
}finally{await b.close()}})().catch(e=>{console.error(e);process.exit(1)});