increased viewport for improved screenshotting experience

main
Inga 🏳‍🌈 2 years ago
parent 0245657254
commit d227773f81
  1. BIN
      src/screenshots/__image_snapshots__/screenshotter-service-spec-ts-screenshotter-service-should-return-hello-world-screenshot-1-snap.png
  2. 5
      src/screenshots/screenshotter.service.ts
  3. BIN
      test/__image_snapshots__/app-e-2-e-spec-ts-app-controller-e-2-e-stores-a-job-for-suricrasia-online-and-completes-it-1-snap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

@ -12,6 +12,11 @@ export class ScreenshotterService {
const browser = await puppeteer.launch(); const browser = await puppeteer.launch();
try { try {
const page = await browser.newPage(); const page = await browser.newPage();
page.setViewport({
width: 1024,
height: 768,
deviceScaleFactor: 1,
});
await page.goto(options.url.toString()); await page.goto(options.url.toString());
const image = (await page.screenshot({ const image = (await page.screenshot({
type: options.imageType, type: options.imageType,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 295 KiB

Loading…
Cancel
Save