import { chromium } from 'playwright'; const b = await chromium.launch({ headless: true }); const ctx = await b.newContext({ viewport: { width: 1440, height: 900 } }); const p = await ctx.newPage(); p.on('console', m => console.log(`[${m.type()}]`, m.text().slice(0, 300))); p.on('pageerror', e => console.log('[PAGEERROR]', e.message.slice(0, 400))); p.on('requestfailed', r => console.log('[REQFAIL]', r.url().slice(0, 120), r.failure()?.errorText)); await p.goto('http://localhost:3000/contact', { waitUntil: 'networkidle', timeout: 60000 }).catch(e => console.log('goto err', e.message.slice(0, 100))); await p.waitForTimeout(3000); const info = await p.evaluate(() => ({ bodyLen: document.body.innerHTML.length, bodyKids: document.body.children.length, h: document.documentElement.scrollHeight, forms: document.querySelectorAll('form').length, inputs: document.querySelectorAll('input,textarea,select').length, main: document.querySelector('main')?.outerHTML.slice(0, 600) || 'NO main', })).catch(e => ({ err: e.message })); console.log('STATE', JSON.stringify(info, null, 2)); await b.close();