(metricName: string)
| 311 | } |
| 312 | |
| 313 | async reload(metricName: string) { |
| 314 | const page = this.page |
| 315 | if (!page) { |
| 316 | throw new Error('reload() must be called after hardNavigation()') |
| 317 | } |
| 318 | await withRequestMetrics(metricName, page, async () => { |
| 319 | await measureTime(`${metricName}/start`) |
| 320 | const idle = networkIdle(page, 3000) |
| 321 | await page.reload({ |
| 322 | waitUntil: 'commit', |
| 323 | }) |
| 324 | await measureTime(`${metricName}/html`, { |
| 325 | relativeTo: `${metricName}/start`, |
| 326 | }) |
| 327 | await page.waitForLoadState('domcontentloaded') |
| 328 | await measureTime(`${metricName}/dom`, { |
| 329 | relativeTo: `${metricName}/start`, |
| 330 | }) |
| 331 | await page.waitForLoadState('load') |
| 332 | await measureTime(`${metricName}/load`, { |
| 333 | relativeTo: `${metricName}/start`, |
| 334 | }) |
| 335 | await idle |
| 336 | await measureTime(`${metricName}`, { |
| 337 | offset: 3000, |
| 338 | relativeTo: `${metricName}/start`, |
| 339 | }) |
| 340 | }) |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | export async function newBrowserSession(options: { |
nothing calls this directly
no test coverage detected