/** * lib/dom-dump.js hygiene, exercised in a real Chromium page. The script is the * arrow function Aside runs through `pg.evaluate` and the fallback engine runs * through `$B js`; here Playwright's `page.evaluate` calls it the same way. * Chromium is driven directly through playwright-core (the engine the browse * daemon wraps) rather than through the daemon: no state file, no health * window, nothing to starve under a sharded CI run. Self-skips when the * Playwright Chromium bundle is not installed (`npx playwright install chromium`). * * Pins the rules the DOM dump promises before a page leaves the browser: * input values dropped, long data: URLs replaced (attributes, inlined CSS, and * existing
x
`); const url = `http://127.0.0.1:${server.port}/index.html`; const browser = await chromium.launch({ headless: true, executablePath: CHROMIUM, timeout: 90_000 }); try { const page = await browser.newPage(); await page.goto(url, { waitUntil: 'load', timeout: 60_000 }); const html = String(await page.evaluate(`(${DOM_DUMP_SCRIPT})()`)); expect(html.startsWith('')).toBe(true); expect(html).toContain(`