feat(html-reporter): recognize video attachment by the contentType (#33074)

Closes https://github.com/microsoft/playwright/issues/33073.

---------

Signed-off-by: Remigiusz Dudek <remigiusz_dudek@tlen.pl>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
This commit is contained in:
Remigiusz Dudek 2024-10-14 14:16:19 +02:00 committed by GitHub
parent 0a63427c77
commit 4c2d62a881
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ export const TestResultView: React.FC<{
const { screenshots, videos, traces, otherAttachments, diffs, errors, htmls } = React.useMemo(() => {
const attachments = result?.attachments || [];
const screenshots = new Set(attachments.filter(a => a.contentType.startsWith('image/')));
const videos = attachments.filter(a => a.name === 'video');
const videos = attachments.filter(a => a.contentType.startsWith('video/'));
const traces = attachments.filter(a => a.name === 'trace');
const htmls = attachments.filter(a => a.contentType.startsWith('text/html'));
const otherAttachments = new Set<TestAttachment>(attachments);