Context:
- Playwright Version: ToT, 1.17.1
The HTML Reporter always shows an Image Mismatch section, even if the snapshot is not a common image format:

In this example, our use case is API testing, so we are not doing visual regressions.
Would it be OK for me to suppress this block in the reporter if the snapshot is not a common image format?
I'd imagine we could infer the content type based on (1) sniffed mimetype from the contents, (2) the filename extension, and/or (3) an explicit (new) contentType option similar to what we have in https://github.com/microsoft/playwright/pull/10121/files.
For backwards compatibility (if we don't have (1)), we might have to inference in some cases and only NOT show it if the name explicitly has a textual extension (e.g. .json, .yml) or explicit (new) non-image contentType option. For instance, if a user is currently supplying their image snapshot name as foo (no extension), we wouldn't want to break the reporter so we would always show the Image mismatch block in this case.
(I know there is other work/conversations regarding snapshot testing, and I'm happy to wait on implementing this to see if it makes sense with whatever other changes land. Thanks!)
Context:
The HTML Reporter always shows an Image Mismatch section, even if the snapshot is not a common image format:
In this example, our use case is API testing, so we are not doing visual regressions.
Would it be OK for me to suppress this block in the reporter if the snapshot is not a common image format?
I'd imagine we could infer the content type based on (1) sniffed mimetype from the contents, (2) the filename extension, and/or (3) an explicit (new) contentType option similar to what we have in https://github.com/microsoft/playwright/pull/10121/files.
For backwards compatibility (if we don't have (1)), we might have to inference in some cases and only NOT show it if the name explicitly has a textual extension (e.g.
.json,.yml) or explicit (new) non-imagecontentTypeoption. For instance, if a user is currently supplying their image snapshot name asfoo(no extension), we wouldn't want to break the reporter so we would always show the Image mismatch block in this case.(I know there is other work/conversations regarding snapshot testing, and I'm happy to wait on implementing this to see if it makes sense with whatever other changes land. Thanks!)