Browse Source

increased viewport for improved screenshotting experience

main
Inga 🏳‍🌈 3 months ago
parent
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

BIN
src/screenshots/__image_snapshots__/screenshotter-service-spec-ts-screenshotter-service-should-return-hello-world-screenshot-1-snap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

5
src/screenshots/screenshotter.service.ts

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

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: 98 KiB

After

Width:  |  Height:  |  Size: 295 KiB

Loading…
Cancel
Save