Skip to content

screenshot images in puppeteer to test browsers' rendering

License

Notifications You must be signed in to change notification settings

test-images/puppeteer-image-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puppeteer Capture Local Files

Setup

Node 12+: uses ESM modules

// .profile.secret.js
// User & OS specific settings

//ASSUME Windows
export let ENV = {
	user:`USERNAME-FOLDER`
}

export let BROWSERS = {
	//windows
	canary:`C:\\Users\\${ENV.user}\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe`,
	edge:`"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"`,
	fxdev:`C:\\Program Files\\Firefox Developer Edition\\firefox.exe`,
}

Video Monitor Warnings

Your video display must not scale. (At least in Windows) If your display scales, your images will be the wrong size and your automated tests will give wrong results &/or fail.

Windows Display Scale

Also, your video color profile may alter the browsers' renderings. EG 1 of my 2 computers rendered the images sith slightly different images for the exact same lossless files. So test with 2+ computers with lossless images first.

Firefox

Fx may timeout; can't seem to set 'image.avif.enabled' to true in headless mode. https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions

Credits

Started with on Sagar's Puppeteer Screenshot example code But could not get Firefox to capture, even though it sucessfully displayed the AVIF.

About

screenshot images in puppeteer to test browsers' rendering

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published