Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update user-flow.md to reflect current release #14604

Merged
merged 4 commits into from
Dec 12, 2022
6 changes: 4 additions & 2 deletions docs/user-flows.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import {startFlow} from 'lighthouse/lighthouse-core/fraggle-rock/api.js';

##### Triggering a navigation via user interactions

Instead of providing a URL to navigate to, you can provide a callback function or use `startNavigation`/`endNavigation`, as seen above. This is useful when you want to audit a navigation that's initiated by a scenario like a button click or form submission.
Instead of providing a URL to navigate to, you can provide a callback function, as seen above. This is useful when you want to audit a navigation that's initiated by a scenario like a button click or form submission.

> Aside: Lighthouse typically clears out any active Service Worker and Cache Storage for the origin under test. However, in this case, as it doesn't know the URL being analyzed, Lighthouse cannot clear this storage. This generally reflects the real user experience, but if you still wish to clear the Service Workers and Cache Storage you must do it manually.

Expand Down Expand Up @@ -181,7 +181,9 @@ async function search(page) {
await flow.navigate('https://www.bestbuy.com');

// Phase 2 - Interact with the page and submit the search form.
await flow.navigate(async () => await search(page));
await flow.startTimespan();
await search(page);
await flow.endTimespan();
ChristopherPHolder marked this conversation as resolved.
Show resolved Hide resolved

// Phase 3 - Analyze the new state.
await flow.snapshot();
Expand Down