- You want to run Lighthouse on your whole web app, not just the landing page.
- You want to verify that all parts of an experience are accessible (e.g. a checkout process).
- You want to measure Cumulative Layout Shift across an SPA page transition.
The three modes
Lighthouse runs in three modes. Each has distinct use cases and limitations. A flow is built by combining them.- Timespan
- Snapshot
Chrome DevTools supports individual Navigation, Timespan, and Snapshot runs, but does not support combining multiple steps into a single multi-step user flow report. To create a multi-step flow, use the Node API as shown below.
Creating a flow
A flow is created by callingstartFlow(page) with a Puppeteer Page object. You then call flow methods (navigate, startTimespan/endTimespan, snapshot) in sequence to build up the steps.
Complete flow example
The example below models a user flow for an e-commerce site: navigate to the homepage, search for a product, snapshot the results, and navigate to the detail page.Desktop user flow
Use the built-indesktopConfig to score and emulate a desktop environment:
Inheriting Puppeteer’s viewport settings
If Puppeteer is already configured with a specific viewport, disable Lighthouse’s own screen emulation to avoid overriding it:Tips and tricks
Keep timespans short and focused
Keep timespans short and focused
Record each timespan around a single interaction sequence or page transition. Shorter recordings are easier to debug and produce more actionable results.
Use snapshot after significant DOM changes
Use snapshot after significant DOM changes
Reach for snapshot mode when a substantial portion of the page content has changed — for example, after a multi-step wizard advances to the final confirmation screen.
Wait for interactions to finish before ending a timespan
Wait for interactions to finish before ending a timespan
Always wait for page transitions and async operations to settle before calling
flow.endTimespan(). Puppeteer helpers like page.waitForSelector, page.waitForFunction, page.waitForResponse, and page.waitForTimeout are useful here.