Skip to content

loadtestgo/pizzascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis CircleCI Appveyor License Chat

PizzaScript - Browser Automation & Webpage Performance Testing

PizzaScript is a JavaScript browser automation framework that records detailed webpage performance metrics.

It uses the Chrome DevTools Extensions API, so no external driver is required.

It includes:

  • A script recorder / editor, with a REPL and debugger for interactively writing tests.
  • A standalone script runner, for running a set of tests, capturing screenshots & performance metrics.
  • A Java API, for embedding the script runner in your own projects.

Features

  • Inspect page load times and HTTP traffic.
  • Wait on page load, HTTP traffic, elements to be visible
  • Block/redirect certain URLs (e.g. block 3rd party beacon URLs)
  • Modify request headers
  • HTTP authentication support (Basic/Digest/NTLM)
  • Emulate Mobile and Tablet devices
  • Emulate network conditions (e.g. 3G/4G/Offline)
  • Record WebSocket request/responses
  • Take screenshots / Record video of page load
  • Many useful CSS selector extensions (e.g. "a:contains(Click me!)" selects a link with the text "Click me!")
  • Easy integration with Jenkins / CircleCI / Appveyor / Travis

Try It!

First make sure the following are installed:

  • Chrome 40+
  • Java 8 JRE

Then download the latest PizzaScript release.

To open the script recorder:

bin/pizzascript-ide

To run a script and generate a report:

bin/pizzascript scripts/basic.js

To run a performance test as a continuous integration job see Jenkins Setup

The Chrome executable will be picked up from well-known Chrome install locations, if not found there then the PATH is searched. See Chrome Setup for troubleshooting and/or manually configuring the Chrome location.

Tested on Linux, OSX and Windows.

Runner

PizzaScript

Script Recorder

PizzaScript Editor

Examples

Load Page

b = pizza.open("www.google.com");
b.verifyText("Search");

Site Login

var b = pizza.open();
b.open("loadtestgo.com");
b.click("button:contains(Sign In)");
b.waitPageLoad();
b.type("#inputEmail", "demo@loadtestgo.com");
b.type("#inputPassword", "password");
b.click("button:contains(Login):nth(1)");
b.waitPageLoad();

Load Mobile Site

var b = pizza.open();
b.emulateDevice("Apple iPhone 6")
b.open("cnn.com");

Alternatives

  • Browsertime - "Access the Web Performance Timeline, from your browser, in your terminal!"
  • Lighthouse - "Auditing and performance metrics for Progressive Web Apps."
  • PhantomJS - "Drive a headless browser using JavaScript, take screenshots and capture performance metrics."
  • WebPageTest - "Test a site's peformance from many different locations with a wide variety of browsers."
  • ChromeDP - "Faster, simpler way to drive browsers that support Chrome Debugger Protocol."