Run lighthouse report at each step in an Angular SPA
See original GitHub issueI am using Puppeteer to crawl through my SPA. On page load, there are only two radio buttons. On selecting either of them, new html is added to the DOM. How do I create a lighthouse report at each of these steps? One report on page load, and another report when puppeteer clicks the button and generates new html.
Here is the snippet -
await page.goto(opts.url);
await page.screenshot({
path: 'audit-images/before_audit.png',
fullPage: true
});
//Generate Lighthouse Report here.
//Click a radio option
await page.click('input[id=appt-yourself]');
console.log("Successfully clicked yourself");
await page.screenshot({
path: 'audit-images/after click yourself.png',
fullPage: true
});
//
Generate Lighthouse Report here.
//Currently, I have only this at the end -
await lighthouse(opts.url, opt, null).then(results => {
//this basically generates report when the url is loaded, but not at each step.
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Performance monitoring with Lighthouse CI - web.dev
A single Lighthouse report provides a snapshot of a web page's performance at the time that it is run; Lighthouse CI shows how...
Read more >Using Google Lighthouse to audit your web application
We will look at how you can use Google Lighthouse to effectively assess the performance of your web application and deliver a superior...
Read more >How to Enhance Your Angular App's Performance using ...
Here's how you generate a lighthouse report: Open the website you want to generate a report for, on Google chrome. Open Chrome DevTools...
Read more >Angular & Lighthouse & Pagespeed Insights - Daniel Kreider
We created a script to test our application with the Lighthouse library. We run the script after every build. If the performance metric...
Read more >Lighthouse/Service Worker, how to return http 200 when offline
My application currently uses webpack,angular js, and a service worker. ... Now when I run the lighthouse report I am getting the following...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@patrickhulce - That’s what I ended up doing. I made use of axe-puppeteer from https://github.com/dequelabs/axe-puppeteer to generate a11y report, when user interactions are performed after the page has loaded. My working example is like -
Would have loved to integrate this with lighthouse report. I now have two different reports - a perf report from lighthouse and a a11y report from axe.
You can write this sort of thing manually using a combination of addy’s repo and the Lighthouse accessibility gatherer.
EDIT: use the project @harish2rock mentioned (https://github.com/dequelabs/axe-puppeteer ), not my ugly example, included below for posterity if you’re curious though 😃
Show Example
Something sorta like
DISCLAIMER: untested, please don’t come after me with bugs 😅