Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

puppeteer-screenshot-tester

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puppeteer-screenshot-tester - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "puppeteer-screenshot-tester",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -33,7 +33,19 @@ puppeteer-screenshot-tester

#### constructor([threshold = 0.02][, includeAA = false[, ignoreColors = false[, ignoreRectangles = [] ]]])
- `threshold` <[number]> A threshold value <0,1> default set to 0.02, max ratio of difference between images
#### constructor([threshold = 0][, includeAA = false[, ignoreColors = false[, ignoreRectangles = [] [, errorSettings = Object] ]]])
- `threshold` <[number]> A threshold value <0,1> default set to 0, max ratio of difference between images
- `includeAA` <[boolean]> should include anti aliasing?
- `ignoreColors` <[boolean]> should ignore colors?
- `ignoreRectangles` <[Array<Array[x, y, width, height]>]> should ignore rectangles? example: `[[325,170,100,40], [10,10,200,200]]`
- `errorSettings` <[Object]> change how to display errors (errorType: `flat` | `movement` | `flatDifferenceIntensity` | `movementDifferenceIntensity` | `diffOnly`):
```
{
errorColor: {
red: 255,
green: 0,
blue: 255
},
errorType: 'flat',
transparency: 0.7
}
```
- returns: <[function]> resolves to function

@@ -40,0 +52,0 @@

@@ -7,4 +7,8 @@ const resemble = require('node-resemble-js');

// currying everywhere, that allows us to create one setup and then use tester without copying config each time
const ScreenTestFactory = function(threshold = 0.02, includeAA = false, ignoreColors = false, ignoreRectangles = []) {
resemble.outputSettings({
const ScreenTestFactory = function(
threshold = 0,
includeAA = false,
ignoreColors = false,
ignoreRectangles = [],
errorSettings = {
errorColor: {

@@ -15,5 +19,6 @@ red: 255,

},
errorType: 'movement',
transparency: 0.2
});
errorType: 'flat',
transparency: 0.7
}) {
resemble.outputSettings(errorSettings);
// get path to called directory

@@ -20,0 +25,0 @@ // cannot use __directory because it returns module directory instead of caller

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc