Skip to content

Instantly share code, notes, and snippets.

@QAProvider
Created September 23, 2019 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QAProvider/d2fb7cf8382656e4185315e59518652a to your computer and use it in GitHub Desktop.
Save QAProvider/d2fb7cf8382656e4185315e59518652a to your computer and use it in GitHub Desktop.
Puppeteer first test
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({
width: 640,
height: 480,
deviceScaleFactor: 1,
});
await page.goto('https://qaprovider.com');
await page.screenshot({path: 'qaprovider640x480.png'});
await page.setViewport({
width: 800,
height: 600,
deviceScaleFactor: 1,
});
await page.screenshot({path: 'qaprovider800x600.png'});
await page.setViewport({
width: 1024,
height: 768,
deviceScaleFactor: 1,
});
await page.screenshot({path: 'qaprovider1024x768.png'});
await browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment