Installations
npm install codeceptjs-pixelmatchhelper
Releases
Unable to fetch releases
Developer
stracker-phil
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
16.17.0
NPM Version
8.18.0
Statistics
8 Stars
30 Commits
4 Forks
4 Watching
1 Branches
2 Contributors
Updated on 07 Jun 2024
Bundle Size
42.82 kB
Minified
13.14 kB
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
95,172
Last day
-18%
324
Compared to previous day
Last week
-4.9%
1,641
Compared to previous week
Last month
10.2%
6,746
Compared to previous month
Last year
250.8%
66,228
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
4
Dev Dependencies
3
CodeceptJS pixelmatch helper
Integrates visual regression tests in → CodeceptJS using the → pixelmatch library. It works with all current CodeceptJS drivers: Playwright, Webdriver, Puppeteer, Appium, TestCafe.
Two screenshots are compared for differences, using a custom tolerance. When both images are equal enough, the test passes. When there are too many differences, the test fails.
What's special about this helper?
⭐️ It's fast and private!
Comparison is done in memory on your machine by comparing pixel details. The images are not rendered into a hidden canvas, no data is sent or loaded to any web service.
⭐️ It supports parallel execution
This helper can be used with NodeJS Workers to enable → parallel testing in CodeceptJS.
⭐️ Match against multiple base images
The flexible matching logic can recognize and match multiple base images for a single screenshot. This is very helpful if you have slight pixel variations between two devices or browsers: Provide one base image for every browser or device and finally prevent false failures!
⭐️ Free and open-source
This package is open-source and only relies on other (free) open-source packages!
⭐️ Multiple areas
You can define a bounding rectangle, as well as multiple ignore-areas to only compare pixels that are relevant for the test.
⭐️ Accurate calculation
When using a bounding rectangle or ignore-areas, the library accurately counts relevant pixels to calculate the total difference between both images. Every pixel that's outside the bounds or inside an ignored area is not included in that calculation.
⭐️ Complete documentation
Browse the GitHub Wiki to learn everything about this library. Also, the code is clean, short and contains inline comments to document the behavior.
Quick Guide
Install the package. → Details
1npm install codeceptjs-pixelmatchhelper
Include the helper in your codecept.json
config file. → Details
1helpers: { 2 PixelmatchHelper: { 3 require: "codeceptjs-pixelmatchhelper" 4 } 5}
Use → checkVisualDifferences()
to compare your images.
1// Compares the two images to determine if they are identical. 2// 3// Actual image: output/screenshot.png 4// Expected image: screenshots/base/screenshot.png 5// 6// Note: You need to create those two images before running the 7// test. For example by using I.takeScreenshot("screenshot.png") 8await I.checkVisualDifferences("screenshot.png");
Methods
Documentation, Samples, Notes
Browse the full package documentation inside the → GitHub wiki!
Found an issue? → Report it via GitHub!
Want to contribute? → Read our guide!
Thanks to
- This package is inspired by
codeceptjs-resemblehelper
. - Thanks to everyone who contributes to
pixelmatch
, it's a great library to learn from - The entire CodeceptJS community
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 2/28 approved changesets -- score normalized to 0
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Reason
16 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q
- Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-qgmg-gppg-76g5
Score
1.7
/10
Last Scanned on 2024-11-18
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