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

Light House: Save Trace File after audit #188

Open varghesevarampi opened 1 year ago

varghesevarampi commented 1 year ago

What would you like to see in the library? Lighthouse saves the trace file when the saveAudits flag has been set to true. Ideally, we should be able to pass in saveAssets: true and this should generate back a trace file.

e.g. something like below: `const lighthouseConfig = { formFactor: 'desktop', saveAssets: true, screenEmulation: { disabled: true, }, }

cy.lighthouse(thresholds, lighthouseConfig);`

Why? This is very useful in diagnosing why certain lighthouse reports have a skewed values of FCP,LCP etc. by looking at the trace.

Any other information that may help understanding the need When run manually, lighthouse generates and option to view the original trace. The core light house produce allows saving trace by running the following command lighthouse https://airhorner.com/ --chrome-flags="--window-size=1280,700" --output-path=/Users/test/lighthouse --save-assets

image
mfrachet commented 1 year ago

From what I see, the flags are passed down to lighthouse. Isnt your config working? Can you provide a repro?