import {chromium} from 'playwright'; import path from 'node:path'; import {fileURLToPath} from 'node:url'; const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'../../..'); const out=path.join(root,'outputs/01a1e261-9424-7620-9eb8-641798779213'); const browser=await chromium.launch({headless:true,channel:'chrome'}); const page=await browser.newPage({viewport:{width:1440,height:1000}}); await page.goto('file://'+path.join(out,'qwen4-practical-guide.html')); await page.screenshot({path:path.join(out,'guide-preview-desktop.png')}); await page.setViewportSize({width:390,height:844}); await page.screenshot({path:path.join(out,'guide-preview-mobile.png')}); const overflow=await page.evaluate(()=>({width:innerWidth,scroll:document.documentElement.scrollWidth})); console.log(JSON.stringify({overflow,tables:await page.locator('table').count(),headings:await page.locator('h1').count()})); await browser.close();