{attachment.contentType === kMissingContentType ? icons.warning() : icons.attachment()}
{attachment.path && {linkName || attachment.name}}
- {!attachment.path && {linkifyText(attachment.name)}}
+ {!attachment.path && (
+ openInNewTab
+ ? e.stopPropagation()}>{attachment.name}
+ : {linkifyText(attachment.name)}
+ )}
} loadChildren={attachment.body ? () => {
return [{linkifyText(attachment.body!)}
];
} : undefined} depth={0} style={{ lineHeight: '32px' }}>;
diff --git a/packages/html-reporter/src/testResultView.tsx b/packages/html-reporter/src/testResultView.tsx
index 1ec8c65a1e..8ee36d0cda 100644
--- a/packages/html-reporter/src/testResultView.tsx
+++ b/packages/html-reporter/src/testResultView.tsx
@@ -67,15 +67,16 @@ export const TestResultView: React.FC<{
anchor: 'video' | 'diff' | '',
}> = ({ result, anchor }) => {
- const { screenshots, videos, traces, otherAttachments, diffs } = React.useMemo(() => {
+ const { screenshots, videos, traces, otherAttachments, diffs, 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 traces = attachments.filter(a => a.name === 'trace');
+ const htmls = attachments.filter(a => a.contentType.startsWith('text/html'));
const otherAttachments = new Set