abhinaba-ghosh / playwright-lighthouse

:performing_arts:: Playwright Lighthouse Audit
https://www.npmjs.com/package/playwright-lighthouse
MIT License
240 stars 28 forks source link

Suggestions: Make logs optional and improve logging #15

Closed badsyntax closed 2 years ago

badsyntax commented 3 years ago

Suggestion 1:

It would be useful to be able to hide the logs as they create a lot of noise and not very useful when running multiple lighthouse tests:

  1. Provide new config key "logReports" (true by default)
  2. If logReports is set to false then don't log the following:

https://github.com/abhinaba-ghosh/playwright-lighthouse/blob/dcc20d62977603f313d80a0470151fff385fa436/src/audit.js#L64-L70

(It should be noted that if a test fails an exception is thrown that let's us know why the lighthouse test is failing, and disabling logs should not affect this.)

Suggestion 2:

It would be helpful to identify the logs better, as it's hard to correlate logs to a certain test.

Perhaps we can add the page url into the following log?:

https://github.com/abhinaba-ghosh/playwright-lighthouse/blob/dcc20d62977603f313d80a0470151fff385fa436/src/audit.js#L65

I would have like to have proposed these changes with a PR but I ran out of time.