Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple screen diff sections #416

Closed
grybykm opened this issue Jan 24, 2022 · 7 comments · Fixed by #607
Closed

Multiple screen diff sections #416

grybykm opened this issue Jan 24, 2022 · 7 comments · Fixed by #607

Comments

@grybykm
Copy link

grybykm commented Jan 24, 2022

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

image

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

image

Describe alternatives you've considered
any other options to see multiple screen diffs per test

@baev
Copy link
Member

baev commented Jan 26, 2022

BTW multiple image diffs are supported by Allure for a while allure-framework/allure2#1145

@grybykm
Copy link
Author

grybykm commented Jan 26, 2022

For some reason it doesn't work for me with "@playwright/test": "^1.18.0" and "allure-playwright": "^2.0.0-beta.15"

@baev
Copy link
Member

baev commented Jan 26, 2022

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'
})

@grybykm
Copy link
Author

grybykm commented Jan 26, 2022

Thanks for the tip, let me try. I'd really like to have it working out of the box!

@mxschmitt
Copy link
Contributor

Just as a heads up, Soft assertions are coming with Playwright 1.19 microsoft/playwright#7819

@amrsa1
Copy link

amrsa1 commented Feb 3, 2022

@mxschmitt when do we expect to have this release

@mxschmitt
Copy link
Contributor

@mxschmitt when do we expect to have this release

We release every month, so probably in 2 weeks it's stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants