Measure your website’s performance with Google Lighthouse in Automated pipelines

Ever Thought About It?

Note

Here it is — Google Lighthouse

  1. Use Lighthouse as command-line execution
  2. Use Lighthouse in integration with Test Automation Tool

Lighthouse Protractor Integration

You can find the Github project here.

npm install

Tweak Protractor Configuration

  • Set the remote debugging port of protractor to 4444.
  • Turn Off “directConnect : true”

Create Lighthouse Expectation File

{"accessibilityScore": 90,"performanceScore": 75,"bestPracticeScore": 75,"progressiveWebAppScore": 75}

Lighthouse Helper Methods

  • Perform lighthouse Audit
  • Fetch run time lighthouse scores of different segments
  • Assert the run time score with the expected data
  • Generate HTML report
const opts = {logLevel: "info",output: "json",port: 4444};
const lhr = await lighthouse(url, opts);

Create Your Specs Files

Lighthouse Protractor Runner

Parking Lot

--

--

Tech Lead Manager @Postman 🚀 | Space Movie Lover 🪐 | Coder 👨‍💻 | Traveller ⛰️

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhinaba Ghosh

Tech Lead Manager @Postman 🚀 | Space Movie Lover 🪐 | Coder 👨‍💻 | Traveller ⛰️