PizzaScript is a JavaScript browser automation framework with built-in performance monitoring.
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.
- Inspect page load times and HTTP traffic
- Wait on page load, HTTP traffic, elements to be visible
- Many useful CSS selector extensions (e.g. "a:contains(Click me!)" selects a link with the text "Click me!")
- Take screenshots
- Block/redirect certain URLs (e.g. block 3rd party beacon URLs)
- Modify request headers
- Emulate Mobile and Tablet devices
- Emulate network conditions (e.g. 3G/4G/Offline)
- Record WebSocket request/responses
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.
b = pizza.open("www.google.com");
b.verifyText("Search");
var b = pizza.open();
b.open("loadtestgo.com");
b.click("button:contains(Login)");
b.waitPageLoad();
b.type("#inputUsername", "demo@loadtestgo.com");
b.type("#inputPassword", "password");
b.click("button:contains(Login):nth(1)");
b.waitPageLoad();
var b = pizza.open();
b.emulateDevice("Apple iPhone 6")
b.open("cnn.com");
- 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.