The built-in onEnd
method can have a results object that is accessible within the function. According to the documentation here, this object should include the property duration
, which represents the time in milliseconds. However, when I attempt to access results.duration
, the value returned is undefined.
The code block provided below should display the start time, duration, and result of the entire test run, but only the result.status
property appears to be defined.
async onEnd(result): Promise<void> {
const suiteData: LogSuiteData = {
"@timeStamp": result.startTime,
suiteDuration: result.duration,
suiteResult: result.status,
};
logArray.push(suiteData);
await logCallHandler.postReportDataBatch(logArray);
}
Further investigation led me to discover the Playwright type FullResult
, which is not documented officially. The included type within Playwright types only contains the status
property, as shown in this screenshot.
Could it be that the official Playwright documentation is incorrect? Have I made an error somewhere in my implementation? Any assistance would be greatly appreciated.
For reference, I am currently using version 1.34.1.