Performance score is different in CLI execution and cypress-audit execution
surajmindcurv opened this issue · 4 comments
I tried to execute cypress audit using below configurations
cy.visit("https://www.guru99.com/")
const customThresholds = {
performance: 50,
accessibility: 50,
"best-practices": 50,
seo: 50
}
const desktopConfig = {
formFactor: 'desktop',
screenEmulation: {
width: 1350,
height: 940,
deviceScaleRatio: 1,
mobile: false,
disable: false,
},
throttling: {
rttMs: 40,
throughputKbps: 11024,
cpuSlowdownMultiplier: 1,
requestLatencyMs: 0,
downloadThroughputKbps: 0,
uploadThroughputKbps: 0,
}
output: "html"
}
cy.lighthouse(customThresholds, desktopConfig)
I got the performance result as "80" for this execution. Then I tried the below CLI command.
lighthouse https://www.guru99.com/ --output html --output-path ./report.html --preset=desktop
For the CLI execution, I got the performance result of "99". Google Chrome lighthouse plugin is also showing "99".
May I know why we are getting this difference in performance score in cypress audit results, can someone please help me to find a solution for this issue?
@mfrachet Do we have any solution for this issue? could you please support me?
I went through the below doc
https://mfrachet.github.io/cypress-audit/guides/lighthouse/good-to-know.html#lighthouse-scores-may-be-different-between-local-run-and-cypress-audit
I am also using configurations pointed out in the documentation but still, I can see the difference in performance score.
If the score is totally different in cypress-audit and actual lighthouse how can we use this cypress plugin to validate the performance?
I don't have this information. This plugin is a glue between lighthouse and Cypress and many things can happen between these. For instance, the browser run in cypress is a custom version of them, lighthouse may run in dev mode, lighthouse + cypress may be more heavy for a machine than just lighthouse alone in its own context that the browser is.
Remember that lighthouse score are an order of growth, and may vary depending on the situation, machine, network conditions etc...
Closing since I can't do much about it 😓