Open dmtrKovalenko opened 11 months ago
How would you like to pass on information about the library? In the configuration file? In the .toHaveScreenshot()
method? So we would need to define an interface for adapters first.
Yeah just make an interface and pass an adapter in the configuration
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
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