import { chromium } from 'playwright'; const routes = ['/', '/about', '/contact', '/products', '/services/software', '/insights']; const b = await chromium.launch(); for (const r of routes) { const ctx = await b.newContext({ viewport:{width:1280,height:900} }); const p = await ctx.newPage(); const cdp = await ctx.newCDPSession(p); await cdp.send('Network.enable'); await cdp.send('Network.setCacheDisabled', { cacheDisabled: true }); await cdp.send('Network.emulateNetworkConditions', { offline:false, latency:150, downloadThroughput: 900*1024/8, uploadThroughput: 400*1024/8 }); p.goto('https://www.novalon.cn'+r, { waitUntil:'commit', timeout:90000 }).catch(()=>{}); let firstVisible = null, s = null; for (let i=0;i<70;i++) { s = await p.evaluate(() => { const h1 = document.querySelector('h1'); const cs = h1 ? getComputedStyle(h1) : null; return h1 ? { t: Math.round(performance.now()), op: Number(cs.opacity), visible: document.visibilityState } : null; }).catch(()=>null); if (s && s.op === 1) { firstVisible = s.t; break; } await p.waitForTimeout(120); } console.log(r.padEnd(20), firstVisible !== null ? `h1 可见@${firstVisible}ms` : 'NOT VISIBLE in window'); if (r === '/about') await p.screenshot({ path:'docs/acceptance/2026-10-20-prod-about/about-cold-after-fix.png', fullPage:false }); await ctx.close(); } await b.close();