https://github.com/raharrison/puppeteer-perf
Website performance testing with Headless Chrome & Puppeteer
https://github.com/raharrison/puppeteer-perf
headless-chrome nodejs performance puppeteer
Last synced: 9 months ago
JSON representation
Website performance testing with Headless Chrome & Puppeteer
- Host: GitHub
- URL: https://github.com/raharrison/puppeteer-perf
- Owner: raharrison
- Created: 2019-07-27T21:30:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-29T17:39:11.000Z (over 3 years ago)
- Last Synced: 2025-03-18T22:27:46.311Z (about 1 year ago)
- Topics: headless-chrome, nodejs, performance, puppeteer
- Language: JavaScript
- Size: 1.15 MB
- Stars: 27
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```js
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.
