Playwright · Senior · Question 45 of 77
How can Playwright collect performance data for a page?
- 1Use
expect(page).toBeFast()from the library - 2Read Performance API values with
page.evaluate - 3Run the test with the
--performanceflag
Show the answer
Correct answer: Read Performance API values with page.evaluate
Explanation
Navigation and paint timings, or Chromium-only CDP metrics, can be collected and tracked, with care since CI timing is noisy.