Playwright Capture PDF - yelenagotraining/E2EFrameworks GitHub Wiki
PDF Screenshots
For earlier versions of playwright, the healdess browser mode should be set to false
await page.pdf({path: 'fullpage.pdf'});
Setting local browser
const browser = await chromium.launch({ headless: false, executablePath: "/Applications/Google\ Chrome.app/Contents/.../Google\ CHrome"
});
Page Emulation
Emulation is set on the context level
const {devices} = require('playwright');
const iPhone = devices['iPhone 11 Pro Max landscape']
const browser = await chromium.launch({ headless: false});
const context = await browser.newContext({
...iPhone,
viewport: {width: 1280, height: 2014}, //overrides iphone settings
videoPath: 'videos/'
});