The build in method onEnd
can has a results object that can be accessed within the onEnd
function. Per the documentation here, it will include the property duration
which is number in milliseconds. When I try and access results.duration
the value is undefined.
The following code block should include the start time, duration and result of the entire run of tests. It does not. The only property that is defined is result.status
.
async onEnd(result): Promise<void> {
const suiteData: LogSuiteData = {
"@timeStamp": result.startTime,
suiteDuration: result.durationMinutes,
suiteResult: result.status,
};
logArray.push(suiteData);
await logCallHandler.postReportDataBatch(logArray);
}
Further digging lead me to the Playwright type FullResult
which has no mentions in the documentation but the defined type within the Playwright types only has the status
property, as seen in this screenshot.
Are the official Playwright docs incorrect? Am I doing something wrong? Any help is appreciated.
karcaroth is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.