mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: do not print empty attachments in terminal (#12419)
This commit is contained in:
parent
e0e6b66cbe
commit
96945ab0a2
@ -250,6 +250,9 @@ export function formatFailure(config: FullConfig, test: TestCase, options: {inde
|
|||||||
if (includeAttachments) {
|
if (includeAttachments) {
|
||||||
for (let i = 0; i < result.attachments.length; ++i) {
|
for (let i = 0; i < result.attachments.length; ++i) {
|
||||||
const attachment = result.attachments[i];
|
const attachment = result.attachments[i];
|
||||||
|
const hasPrintableContent = attachment.contentType.startsWith('text/') && attachment.body;
|
||||||
|
if (!attachment.path && !hasPrintableContent)
|
||||||
|
continue;
|
||||||
resultLines.push('');
|
resultLines.push('');
|
||||||
resultLines.push(colors.cyan(pad(` attachment #${i + 1}: ${attachment.name} (${attachment.contentType})`, '-')));
|
resultLines.push(colors.cyan(pad(` attachment #${i + 1}: ${attachment.name} (${attachment.contentType})`, '-')));
|
||||||
if (attachment.path) {
|
if (attachment.path) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user