Last active
September 25, 2020 08:22
-
-
Save indreklasn/69bbea5331b4aa0283e652ee3d57baa1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
webkit, | |
firefox, | |
chromium | |
} = require('playwright'); | |
const simulateBrowser = async (browserEngine) => { | |
const browser = await browserEngine.launch({ headless: false, slowMo: 50 }); | |
const page = await browser.newPage(); | |
await page.goto('http://whatsmyuseragent.org/'); | |
await page.screenshot({ path: `example-${browserEngine._initializer.name}.png` }); | |
await browser.close(); | |
}; | |
simulateBrowser(firefox) | |
simulateBrowser(webkit) | |
simulateBrowser(chromium) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment