After navigating to a page, how can I get the response time of 10 APIs that would have been called? I want the time to be accurate as shown in the network tab- to test the performance sanity.
I have tried the playwright's offering https://playwright.dev/docs/api/class-request#request-timing but the response time given by playwright and network tab is different.
const waitForResponseOfXXX = page.waitForResponse(
'**/prism/?op=XXX'
);
await page.goto(
'https://testing.com'
);
const xxxResponse = await waitForResponseOfXXX;
let timings = await xxxResponse.request().timing();
console.log(
`xxxResponse:` +
(timings.responseEnd - timings.responseStart)
);