darekkay / darekkay/evaluatory
Add web vitals module
- Dominant language
- JavaScript
- Stars
- 98
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
It would be great to include [Web Vitals](https://web.dev/articles/vitals) as a module.
Web Vitals are included in [Google Lighthouse](https://github.com/GoogleChrome/lighthouse), and it's [possible](https://github.com/abhinaba-ghosh/playwright-lighthouse) to use Lighthouse with Playwright/Puppeteer, but there are some issues to consider:
- Only Chromium browser is supported
- Only 1 parallel check is possible (`maxConnection: 1`), otherwise we get a `TRACING_ALREADY_STARTED` errors. See also https://github.com/GoogleChrome/lighthouse/issues/1091 and https://github.com/GoogleChrome/lighthouse/issues/11321
An alternative is to use [web-vitals](https://github.com/GoogleChrome/web-vitals) directly, even though it's [officially not recommended](https://github.com/GoogleChrome/web-vitals/issues/70#issuecomment-714163695) to be used in such a way. [Artillery](https://www.artillery.io/docs/reference/engines/playwright#metrics-reported-by-the-engine) uses this package (see [code](https://github.com/artilleryio/artillery/blob/main/packages/artillery-engine-playwright/index.js#L180)). There's also an example of getting the values [without any library](https://medium.com/quinbay/playwright-101-part-2-page-performance-analysis-while-running-ui-automation-eeb2ad757b84).
I've created a WIP [lighthouse](https://github.com/darekkay/evaluatory/tree/lighthouse) branch with a proof of concept for including Lighthouse.
Further resources:
- [lighthouse puppeteer integration](https://github.com/GoogleChrome/lighthouse/blob/master/docs/puppeteer.md)
- [puppeteer recipes](https://addyosmani.com/blog/puppeteer-recipes/)
- [unlighthouse](https://github.com/harlan-zw/unlighthouse/blob/main/packages/core/src/puppeteer/tasks/lighthouse.ts)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.