Gathering detailed insights and metrics for match-screenshot
Gathering detailed insights and metrics for match-screenshot
Gathering detailed insights and metrics for match-screenshot
Gathering detailed insights and metrics for match-screenshot
cypress-match-screenshot
Utility to take screenshots during a cypress test and match them against previous runs
prevent-screenshot
Starting as just deleting screenshots because they are hard to prevent this lib has turned into an autodeleter that listens on a directory/directories and deletes all/files that match a string parse that have been added after the program started running.
winfix-match-screenshots
A modified version of cypress-match-screenshots, with fixes implemented to avoid crashing on Windows.
@selfage/screenshot_test_matcher
Screenshot testing in browser.
A simple Jest or Chai matcher to compare screenshots, using Applitools Eyes
npm install match-screenshot
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
14 Stars
60 Commits
7 Forks
6 Watchers
20 Branches
8 Contributors
Updated on Jul 15, 2020
Latest Version
3.0.168
Package Id
match-screenshot@3.0.168
Unpacked Size
13.47 kB
Size
5.91 kB
File Count
21
NPM Version
6.14.6
Node Version
12.18.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A simple Jest or Chai matcher to compare screenshots, using Applitools Eyes (other platforms will be supported as well, TBD)
1npm install --save-dev match-screenshot
Add EYES_API_KEY
environment variable, with your eyes key
go to your build's options -> settings -> Environment Variables
and add EYES_API_KEY
+ your key
add an .env
file, with:
EYES_API_KEY=<your key here>
.env
file in git ignore!!!1"jest": { 2 "setupTestFrameworkScriptFile": "match-screenshot/jest" 3}
In case you have several custom matchers in your project / you need setupTestFrameworkScriptFile
for other configurations, just use:
1"jest": { 2 "setupTestFrameworkScriptFile": "<rootDir>/setupTestFrameworkScriptFile.js" 3}
Inside setupTestFrameworkScriptFile.js
you can then:
1require('match-screenshot/jest');
1const {Assertion} = require('chai'); 2const toMatchScreenshot = require('match-screenshot/chai'); 3Assertion.addMethod('toMatchScreenshot', toMatchScreenshot);
Puppeteer example:
1it('my test', async () { 2 await page.goto('http://www.wix.com'); 3 const screenshot = await page.screenshot(); 4 await expect(screenshot).toMatchScreenshot({key: 'my test'}); 5});
When you change production code implementation, Eyes will break, and you will have to go to its management Dashboard and approve the change. In order to avoid that, you can assign a new version and create a new baseline:
1 it('my test', async () { 2 await page.goto('http://www.wix.com'); 3 const screenshot = await page.screenshot(); 4 await expect(screenshot).toMatchScreenshot({key: 'my test', version: 'v1.0.1'}); 5 });
options
key
<[string]> A unique key for your screenshot. This key will be used in Applittols Eyes.
version
<[string]> (optional) Used to create a new baseline. See Creating a new baseline for more details. Default value: 'v1.0.0'.
viewport
<[string]> (optional) Explicitly pass viewport argument to Applitools api. This will prevent Applitools from creating a new baseline in case of a change in the screenshot actual viewport. Instead, it will fail the test.
matchLevel
<[enum]> (optional) Explicitly set match level
autoSaveNewTest
<[boolean]> (optional) If you set it to false, every time that eyes will detect a new test(different viewport size, first run) it will fail the test and the baseline will need to be approved in Eyes. Default value: true.
1const MatchLevel = require('match-screenshot/matchLevel')
2...
3await expect(screenshot).toMatchScreenshot({key: 'my test', matchLevel: MatchLevel.Explicit});
Configure your matcher with global options.
Set the matcher:
1"jest": { 2 "setupTestFrameworkScriptFile": "<rootDir>/setupTestFrameworkScriptFile.js" 3},
Inside setupTestFrameworkScriptFile.js
you can then:
1require('match-screenshot/jestWithConfig')(options);
options
appName
<[string]> Application name. Will be used inside Applitools as part of test title
Everytime you use toMatchScreenshot
matcher, a screenshot will be sent to Applitools Eyes, which will compare the new screenshot with the baseline. The test will fail if they are not equal.
If you are using typescript and are missing type defintions for toMatchScreenshot
, you can add the following line to your tsconfig:
1 "files": [ 2 "./node_modules/match-screenshot/index.d.ts", 3 ]
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 9/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
58 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More