GithubHelp home page GithubHelp logo

geekwolverine / puppeteer-perf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from raharrison/puppeteer-perf

0.0 0.0 0.0 878 KB

Website performance testing with Headless Chrome & Puppeteer

JavaScript 65.09% HTML 34.91%

puppeteer-perf's Introduction

Puppeteer Perf

Measure and monitor website performance with Headless Chrome and Puppeteer

Key Features

  • Run performance tests within Chrome itself just as your users will. No emaulation or estimations
  • Measure key performance indicators for page load: DOM loaded, First Meaningful Paint, Full Page Loaded
  • Monitor page metrics: number of DOM nodes, number of restyle calculations etc
  • Track all requests made by type: how long your JS takes too load, how big is your bundle size, how many XHR requests are being made?
  • Write performance tests as standard Jest test cases
  • Automatic report creation to monitor key indicators over time
  • Save results to flat file or Sqlite database for easy analytics

Usage

  1. Clone repo
  2. npm install
  3. See example tests/load-homepage.test.js for sample which measures page load
  4. Run npm run test to being Jest test suite
  5. See generated/ directory for performance reports
describe("Load Homepage", () => {
    let runData;
    beforeAll(async () => {
        const url = "https://ryanharrison.co.uk";
        runData = await measurePageLoad(browser, "load-homepage", url, 3);
    });

    test("full page load should be within 1 second", () => {
        expect(runData.timings.fullTime).toBeLessThan(1000);
    });

    it("should have less than 1500 nodes", () => {
        expect(runData.metrics.nodes).toBeLessThan(1500);
    });
});

Reports

Each test run will also generate a report allowing you to track key indicators through time. See sample/ directory for example report.

Sample Page Load report

puppeteer-perf's People

Contributors

raharrison avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.