{attachment.contentType === kMissingContentType ? icons.warning() : icons.attachment()}
{attachment.path && {linkName || attachment.name}}
{!attachment.path && {linkifyText(attachment.name)}}
} loadChildren={attachment.body ? () => {
return [{linkifyText(attachment.body!)}
];
} : undefined} depth={0} style={{ lineHeight: '32px' }}>;
};
function downloadFileNameForAttachment(attachment: TestAttachment): string {
if (attachment.name.includes('.') || !attachment.path)
return attachment.name;
const firstDotIndex = attachment.path.indexOf('.');
if (firstDotIndex === -1)
return attachment.name;
return attachment.name + attachment.path.slice(firstDotIndex, attachment.path.length);
}
export function generateTraceUrl(traces: TestAttachment[]) {
return `trace/index.html?${traces.map((a, i) => `trace=${new URL(a.path!, window.location.href)}`).join('&')}`;
}
const kMissingContentType = 'x-playwright/missing';