mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(reporter): remove stale annotations from JsonTestEnd (#35426)
This commit is contained in:
parent
49c13a0788
commit
16f634649f
@ -75,7 +75,8 @@ export type JsonTestEnd = {
|
|||||||
testId: string;
|
testId: string;
|
||||||
expectedStatus: reporterTypes.TestStatus;
|
expectedStatus: reporterTypes.TestStatus;
|
||||||
timeout: number;
|
timeout: number;
|
||||||
annotations: Annotation[];
|
// Dropped in 1.52. Kept as empty array for backwards compatibility.
|
||||||
|
annotations: [];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type JsonTestResultStart = {
|
export type JsonTestResultStart = {
|
||||||
@ -235,7 +236,9 @@ export class TeleReporterReceiver {
|
|||||||
const test = this._tests.get(testEndPayload.testId)!;
|
const test = this._tests.get(testEndPayload.testId)!;
|
||||||
test.timeout = testEndPayload.timeout;
|
test.timeout = testEndPayload.timeout;
|
||||||
test.expectedStatus = testEndPayload.expectedStatus;
|
test.expectedStatus = testEndPayload.expectedStatus;
|
||||||
test.annotations = testEndPayload.annotations;
|
// Should be empty array, but if it's not, it represents all annotations for that test
|
||||||
|
if (testEndPayload.annotations.length > 0)
|
||||||
|
test.annotations = testEndPayload.annotations;
|
||||||
const result = test.results.find(r => r._id === payload.id)!;
|
const result = test.results.find(r => r._id === payload.id)!;
|
||||||
result.duration = payload.duration;
|
result.duration = payload.duration;
|
||||||
result.status = payload.status;
|
result.status = payload.status;
|
||||||
|
@ -73,8 +73,8 @@ export class TeleReporterEmitter implements ReporterV2 {
|
|||||||
const testEnd: teleReceiver.JsonTestEnd = {
|
const testEnd: teleReceiver.JsonTestEnd = {
|
||||||
testId: test.id,
|
testId: test.id,
|
||||||
expectedStatus: test.expectedStatus,
|
expectedStatus: test.expectedStatus,
|
||||||
annotations: test.annotations,
|
|
||||||
timeout: test.timeout,
|
timeout: test.timeout,
|
||||||
|
annotations: []
|
||||||
};
|
};
|
||||||
this._messageSink({
|
this._messageSink({
|
||||||
method: 'onTestEnd',
|
method: 'onTestEnd',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user