Audit page performance
audit-performanceMeasure a page's lab Web Vitals in headless Chromium, compare results with Google thresholds or custom budgets, and identify LCP elements, layout shifts, and render-blocking requests.
Instructions
Measure a page's lab Web Vitals (LCP, CLS, TBT, FCP, TTFB, and INP when actions interact) in headless Chromium, optionally as a throttled phone and as the median of several runs. Rates them against Google thresholds or your budgets, names the LCP element and shifting elements as verified locators, lists heavy and render-blocking requests, and returns a budget check for the spec. Accepts storageState/headers/actions/routes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| har | No | ||
| url | Yes | Full URL of the page to measure (http/https) | |
| runs | No | Load the page this many times and report the median (default 1) | |
| device | No | Playwright device preset, e.g. 'iPhone 15', 'Pixel 7', 'iPad Pro 11' (viewport, user agent, touch) | |
| routes | No | Network mocks, first match wins: json/body/status fulfil, abort fails, delayMs alone slows the real request | |
| actions | No | Steps run in order after load to reach a state (modal, step 3). One call = one fresh browser, so include the login steps; end with a 'wait' on what the state shows | |
| browser | No | Engine (default chromium) | |
| budgets | No | Fail the audit when a metric exceeds its budget (default: rate against Google thresholds) | |
| channel | No | Branded Chromium to launch instead of the bundled one (must be installed) | |
| headers | No | Extra HTTP headers, e.g. Authorization | |
| waitFor | No | Wait for this selector first | |
| settleMs | No | Keep observing after load for late paints and shifts (default 1500) | |
| throttle | No | 'mobile': phone viewport, 4x CPU slowdown and slow 4G like Lighthouse mobile; 'none' (default): desktop, unthrottled | |
| viewport | No | ||
| timeoutMs | No | Limit per run in ms (default 60000) | |
| waitUntil | No | Navigation wait condition (default load) | |
| cpuSlowdown | No | Override the CPU slowdown factor | |
| projectRoot | No | Project whose Playwright launches the browser (default: server root) | |
| storageState | No | Logged-in session: storageState JSON inside the project, e.g. playwright/.auth/user.json | |
| actionTimeoutMs | No | How long each action waits for its element (default 10000); keep timeoutMs above the total |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false when the call failed (see error) or the tests it ran failed | |
| url | No | ||
| error | No | ||
| metrics | No |