puppeteer-screenshot-tester
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1263558
117
113