testcafe-browser-provider-chromejpeg
v0.2.0
Published
TestCafe provider for Chrome with JPEG screenshot support.
Downloads
1
Maintainers
Readme
TestCafe browser provider for Chrome with JPEG screenshot support
Background
- Chrome's
Page.captureScreenshot()
is on average 5 times faster for JPEG as opposed to PNG. This has significant benefits when comparing screenshots for a large test suite. - TestCafe's PNG postprocessing is slow (follow the original issue here).
Solution
- Using JPEG format in Chrome and ignoring TestCafe's postprocessing significantly improves performance.
- JPEG quality is set 100 to minimise the artifacts. Artifacts should not matter much for JPEG to JPEG comparison on the same platform. The comparison should be always done on the same environment (e.g. in Docker).
- Fragment screenshots are not supported.
Usage
Install:
npm install testcafe-browser-provider-chromejpeg
Run:
testcafe chromejpeg:chrome my-test.js
Known issues
Due to TestCafe being unable to process JPEGs, the following warning is expected at the end of test execution.
Warnings (1):
--
Was unable to take a screenshot due to an error.
Error: Invalid file signature
at module.exports.Parser._parseSignature
...