track attachment index in json reporter

This commit is contained in:
Simon Knott 2024-12-16 19:16:41 +01:00
parent 9765124b8b
commit 9a5e255529
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -100,7 +100,7 @@ export class TeleReporterEmitter implements ReporterV2 {
params: {
testId: test.id,
resultId: (result as any)[this._idSymbol],
step: this._serializeStepEnd(step)
step: this._serializeStepEnd(step, result)
}
});
}
@ -251,11 +251,12 @@ export class TeleReporterEmitter implements ReporterV2 {
};
}
private _serializeStepEnd(step: reporterTypes.TestStep): teleReceiver.JsonTestStepEnd {
private _serializeStepEnd(step: reporterTypes.TestStep, result: reporterTypes.TestResult): teleReceiver.JsonTestStepEnd {
return {
id: (step as any)[this._idSymbol],
duration: step.duration,
error: step.error,
attachments: step.attachments.map(a => result.attachments.indexOf(a)),
};
}