Closed
Description
Current behavior
Hi and thank you for this great work.
Just want to report a tiny issue with the CommandLine.AttemptResult
type. The type definition is:
interface AttemptResult {
state: string
error: TestError | null
startedAt: dateTimeISO
duration: ms
videoTimestamp: ms
screenshots: ScreenshotInformation[]
}
But duration
and startedAt
don't exist in the actual object, instead the following should be defined wallClockDuration
and wallClockStartedAt
respectively, I've attached a sample AttemptResult
object.
Not sure if screenshots
property exist in the actual object, and there is failedFromHookId
and timings
missing in the type definition which exist. Anyway, if this is confirmed, I could take a look into fixing it. 👍
Desired behavior
No response
Test code to reproduce
Here is a TS example accessing mentioned properties:
export default (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
on('after:spec', async (spec, results) => {
results.tests.forEach(cypressTestResult => {
const attempt = cypressTestResult.attempts.pop();
console.log(attempt);
// This will complain that the property doesn't exist
const wallClockDuration = attempt.wallClockDuration;
// This will complain that the property doesn't exist
const wallClockStartedAt = attempt.wallClockStartedAt;
});
});
}
Cypress Version
10.9.0
Node version
16.3.0
Operating System
macOS 12.1
Debug Logs
{
state: 'passed',
error: null,
timings: { lifecycle: 7, test: { fnDuration: 9805, afterFnDuration: 0 } },
failedFromHookId: null,
wallClockStartedAt: '2022-10-04T10:39:19.792Z',
wallClockDuration: 9817,
videoTimestamp: 1584
}
Other
No response