allure-js
allure-js copied to clipboard
Multiple screen diff sections
Is your feature request related to a problem? Please describe. I'd like to compare screenshots of multiple areas in the page within the same test.
At the moment only it should be only one diff per test otherwise screen diff section is not shown

Describe the solution you'd like I'd like to see multiple collapsible screen diff entries ideally with the screenshot name

Describe alternatives you've considered any other options to see multiple screen diffs per test
BTW multiple image diffs are supported by Allure for a while https://github.com/allure-framework/allure2/pull/1145
For some reason it doesn't work for me with "@playwright/test": "^1.18.0" and "allure-playwright": "^2.0.0-beta.15"
that's because playwright by default doesn't support soft assertions. So we expect only one diff per test. It could (and probably will) be changed at some point, but for now I can only suggest crafting your own image diff attachments:
testInfo.attach('Image Diff', {
body: Buffer.from(JSON.stringify({
actual: 'data:image/png;base64,' + actual.toString("base64"),
expected: 'data:image/png;base64,' + expected.toString("base64"),
diff: 'data:image/png;base64,' + diff.toString("base64")
})),
contentType: 'application/vnd.allure.image.diff'
})
Thanks for the tip, let me try. I'd really like to have it working out of the box!
Just as a heads up, Soft assertions are coming with Playwright 1.19 https://github.com/microsoft/playwright/issues/7819
@mxschmitt when do we expect to have this release
@mxschmitt when do we expect to have this release
We release every month, so probably in 2 weeks it's stable.