watsonmw / pizzascript

Browser Automation & Performance Monitoring

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License

PizzaScript - Browser Automation & Performance Monitoring

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.

Features

  • 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

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(Login)");
b.waitPageLoad();
b.type("#inputUsername", "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.

About

Browser Automation & Performance Monitoring

License:Other


Languages

Language:Java 73.0%Language:JavaScript 23.4%Language:HTML 2.6%Language:CSS 0.9%Language:Shell 0.2%