Description
We are doing a lot of visual regression tests during out CI and I noticed that when tests are running without snapshots there is a significant time difference for making and comparing screenshots.
So I build and now use https://github.com/dmtrKovalenko/odiff for my playwright tests. The only addition I'd like to have is the ability to specify the comparison library in playwright instead of completely rewriting the logic of comparing screenshots.
This will make it possible to use the same test-results output, the same scripts for updating snapshots, and do not think about possilbe breaking changes for the while visual regression when updating playwright.
Example
// playwright.config.ts
compareImages: (originalPath: string, actualPath: string, diffPath: string, width, height, options) => {
// here is all the logic related to comparing screenshots and outputting the diff
}
Which is by default equals to
https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/third_party/pixelmatch.js
I'd be happy to make a PR if there will be a green light