mfrachet / cypress-audit

⚡ Run Lighthouse and Pa11y audits directly in your E2E test suites
https://mfrachet.github.io/cypress-audit/
MIT License
351 stars 44 forks source link

Lower performance when running lighthouse in cypress #140

Closed dapinto8 closed 2 years ago

dapinto8 commented 2 years ago

What does not work? Lower performance when running llighthouse with cypress. I have a frontend app build with single-spa, this tool uses multiple scripts that comes from cdn.jsdelivr.net. When i run lighthouse inside of cypress i have a lower performance caused by the external scripts acording to lighthouse but when i run the test with chrome everything it's ok, i tried in multiple machines with differente enviroments and it's the same. I want to know if this is an expected behavior or there's something i'm missing

How to reproduce? clone https://github.com/dapinto8/cypress-test, run npm run cypress:open and then run the test lighthouse.spec.js. This repo is just a next js default app and also experiences lower performance

Expected behavior Having a better performance

Screenshots / Animated Gifs Performance ruuning lighthouse in chrome Screenshot from 2022-04-11 09-20-25 Performance ruuning lighthouse in cypress Screenshot from 2022-04-11 09-16-33 Opportunitties when lighthouse in cypress Screenshot from 2022-04-11 10-00-49

Environment (please complete the following information):

mfrachet commented 2 years ago

It's in the documentation https://github.com/mfrachet/cypress-audit/blob/master/packages/lighthouse/README.md#lighthouse-scores-may-be-different-between-local-run-and-cypress-audit

nazarbodan-indeema commented 1 year ago

It's in the documentation https://github.com/mfrachet/cypress-audit/blob/master/packages/lighthouse/README.md#lighthouse-scores-may-be-different-between-local-run-and-cypress-audit

The link is broken.

mfrachet commented 1 year ago

https://mfrachet.github.io/cypress-audit/guides/lighthouse/good-to-know.html#lighthouse-scores-may-be-different-between-local-run-and-cypress-audit