in src/helpers.ts [186:213]
export async function testStep(
title: string,
stepData: object[],
page: Page,
stepFunction: any,
...args: any[]
): Promise<any> {
const start = Date.now();
const startTimePerf = performance.now();
try {
const result = await stepFunction.apply(null, [page, ...args]);
const endTimePerf = performance.now();
const end = Date.now();
const duration = endTimePerf - startTimePerf;
stepData.push({
[title]: {
start,
end,
duration
}
});
return result;
} catch (error) {
throw error;
}
}