mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(html): strip ansi escaping from stdio (#9944)
This commit is contained in:
parent
5d49c41a52
commit
2bfbf65b8d
@ -136,6 +136,8 @@ svg {
|
|||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
background-color: var(--color-canvas-subtle);
|
background-color: var(--color-canvas-subtle);
|
||||||
margin-left: 24px;
|
margin-left: 24px;
|
||||||
|
line-height: normal;
|
||||||
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.test-result > div {
|
.test-result > div {
|
||||||
|
@ -25,6 +25,7 @@ import { calculateSha1, removeFolders } from 'playwright-core/lib/utils/utils';
|
|||||||
import RawReporter, { JsonReport, JsonSuite, JsonTestCase, JsonTestResult, JsonTestStep, JsonAttachment } from './raw';
|
import RawReporter, { JsonReport, JsonSuite, JsonTestCase, JsonTestResult, JsonTestStep, JsonAttachment } from './raw';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import yazl from 'yazl';
|
import yazl from 'yazl';
|
||||||
|
import { stripAnsiEscapes } from './base';
|
||||||
|
|
||||||
export type Stats = {
|
export type Stats = {
|
||||||
total: number;
|
total: number;
|
||||||
@ -385,14 +386,15 @@ class HtmlBuilder {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((a.name === 'stdout' || a.name === 'stderr') &&
|
if ((a.name === 'stdout' || a.name === 'stderr') && a.contentType === 'text/plain') {
|
||||||
a.contentType === 'text/plain' &&
|
if (lastAttachment &&
|
||||||
lastAttachment &&
|
|
||||||
lastAttachment.name === a.name &&
|
lastAttachment.name === a.name &&
|
||||||
lastAttachment.contentType === a.contentType) {
|
lastAttachment.contentType === a.contentType) {
|
||||||
lastAttachment.body += a.body as string;
|
lastAttachment.body += stripAnsiEscapes(a.body as string);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
a.body = stripAnsiEscapes(a.body as string);
|
||||||
|
}
|
||||||
lastAttachment = a;
|
lastAttachment = a;
|
||||||
return a;
|
return a;
|
||||||
}).filter(Boolean) as TestAttachment[]
|
}).filter(Boolean) as TestAttachment[]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user