11## WebPageTest API Wrapper for NodeJS
22
3- [ ![ NPM] ( https://nodei.co/npm/webpagetest.png?downloads=true&downloadRank=true&stars=true )] ( https://nodei.co/npm/webpagetest/ )
4- [ ![ Build Status] ( https://secure.travis-ci.org/marcelduran/webpagetest-api.png?branch=master )] ( http://travis-ci.org/marcelduran/webpagetest-api )
3+ [ ![ Build Status] ( https://secure.travis-ci.org/marcelduran/webpagetest-api.png?branch=master )] ( https://travis-ci.org/marcelduran/webpagetest-api )
4+ [ ![ NPM Version] ( https://img.shields.io/npm/v/webpagetest.svg?style=flat )] ( https://www.npmjs.org/package/webpagetest )
5+ [ ![ NPM Downloads] ( https://img.shields.io/npm/dm/webpagetest.svg?style=flat )] ( https://www.npmjs.org/package/webpagetest )
56[ ![ Dependencies Status] ( https://david-dm.org/marcelduran/webpagetest-api.png )] ( https://david-dm.org/marcelduran/webpagetest-api )
67
7- [ WebPageTest API Wrapper] ( http ://marcelduran.com/webpagetest-api) is a [ NPM] ( http ://npmjs.org) package that wraps [ WebPageTest] ( https://github.com/WPO-Foundation/webpagetest ) API for [ NodeJS] ( http ://nodejs.org) as a module and a command-line tool.
8+ [ WebPageTest API Wrapper] ( https ://marcelduran.com/webpagetest-api) is a [ NPM] ( https ://npmjs.org) package that wraps [ WebPageTest] ( https://github.com/WPO-Foundation/webpagetest ) API for [ NodeJS] ( https ://nodejs.org) as a module and a command-line tool.
89
910## Getting started
1011
@@ -16,15 +17,15 @@ $ npm install webpagetest -g
1617
1718### Command line
1819``` bash
19- $ webpagetest test http ://twitter.com/marcelduran
20+ $ webpagetest test https ://twitter.com/marcelduran
2021```
2122
2223### Module
2324``` javascript
2425var WebPageTest = require (' webpagetest' );
2526var wpt = new WebPageTest (' www.webpagetest.org' );
2627
27- wpt .runTest (' http ://twitter.com/marcelduran' , function (err , data ) {
28+ wpt .runTest (' https ://twitter.com/marcelduran' , function (err , data ) {
2829 console .log (err || data);
2930});
3031```
@@ -135,7 +136,7 @@ _The default WPT server can also be specified via environment variable `WEBPAGET
135136* ** --timeout** _ \< seconds\> _ : timeout for polling and waiting results [ no timeout]
136137
137138#### API Key (works for ** test** and ** cancel** commands)
138- * ** -k, --key** _ \< api_key\> _ : API key (if assigned). Contact the WebPageTest server administrator for a key if required or request an API key for limited testing at [ webpagetest.org/getkey.php] ( http ://www.webpagetest.org/getkey.php)
139+ * ** -k, --key** _ \< api_key\> _ : API key (if assigned). Contact the WebPageTest server administrator for a key if required or request an API key for limited testing at [ webpagetest.org/getkey.php] ( https ://www.webpagetest.org/getkey.php)
139140
140141#### Request (works for ** status** , ** results** , ** locations** , ** testers** and ** test** commands)
141142* ** -e, --request** _ \< id\> _ : echo request ID, useful to track asynchronous requests
@@ -214,9 +215,9 @@ $ webpagetest locations
214215}
215216```
216217
217- #### 2. Run test on http ://twitter.com/marcelduran from San Jose on IE9
218+ #### 2. Run test on https ://twitter.com/marcelduran from San Jose on IE9
218219``` bash
219- $ webpagetest test http ://twitter.com/marcelduran --key 1F2A3K4E5 --location SanJose_IE9
220+ $ webpagetest test https ://twitter.com/marcelduran --key 1F2A3K4E5 --location SanJose_IE9
220221```
221222``` javascript
222223{
@@ -225,11 +226,11 @@ $ webpagetest test http://twitter.com/marcelduran --key 1F2A3K4E5 --location San
225226 " data" : {
226227 " testId" : " 121025_PT_N8K" ,
227228 " ownerKey" : " 868cb2813a0f376a977dd1a24ab041b4f12361b3" ,
228- " jsonUrl" : " http ://localhost /results.php?test=121025_PT_N8K&f=json" ,
229- " xmlUrl" : " http ://localhost /xmlResult.php?test=121025_PT_N8K" ,
230- " userUrl" : " http ://localhost /results.php?test=121025_PT_N8K" ,
231- " summaryCSV" : " http ://localhost /csv.php?test=121025_PT_N8K" ,
232- " detailCSV" : " http ://localhost /csv.php?test=121025_PT_N8K&requests=1"
229+ " jsonUrl" : " https ://www.webpagetest.org /results.php?test=121025_PT_N8K&f=json" ,
230+ " xmlUrl" : " https ://www.webpagetest.org /xmlResult.php?test=121025_PT_N8K" ,
231+ " userUrl" : " https ://www.webpagetest.org /results.php?test=121025_PT_N8K" ,
232+ " summaryCSV" : " https ://www.webpagetest.org /csv.php?test=121025_PT_N8K" ,
233+ " detailCSV" : " https ://www.webpagetest.org /csv.php?test=121025_PT_N8K&requests=1"
233234 }
234235}
235236```
@@ -263,8 +264,8 @@ $ webpagetest results 121025_PT_N8K
263264 " statusCode" : 200 , " statusText" : " Ok" ,
264265 " data" : {
265266 " testId" : " 121025_PT_N8K" ,
266- " summary" : " http ://www.webpagetest.org/result/121025_PT_N8K/" ,
267- " testUrl" : " http ://twitter.com/marcelduran" ,
267+ " summary" : " https ://www.webpagetest.org/result/121025_PT_N8K/" ,
268+ " testUrl" : " https ://twitter.com/marcelduran" ,
268269 " location" : " SanJose_IE9" ,
269270 " connectivity" : " DSL" ,
270271 " bwDown" : 1500 , " bwUp" : 384 , " latency" : 50 , " plr" : 0 ,
@@ -297,21 +298,21 @@ $ webpagetest waterfall 121025_PT_N8K --thumbnail --cached --uri
297298}
298299```
299300
300- #### Run test on http ://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds
301+ #### Run test on https ://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds
301302``` bash
302- $ webpagetest test http ://twitter.com/marcelduran --poll 5 --timeout 60
303+ $ webpagetest test https ://twitter.com/marcelduran --poll 5 --timeout 60
303304```
304- #### Or run test on http ://twitter.com/marcelduran and wait for results listening on localhost\* port 8000\* *
305+ #### Or run test on https ://twitter.com/marcelduran and wait for results listening on localhost\* port 8000\* *
305306``` bash
306- $ webpagetest test http ://twitter.com/marcelduran --wait 8000
307+ $ webpagetest test https ://twitter.com/marcelduran --wait 8000
307308```
308309``` javascript
309310{
310311 " response" : {
311312 " statusCode" : 200 , " statusText" : " Ok" ,
312313 " data" : {
313314 " testId" : " 121025_PT_N8K" ,
314- " testUrl" : " http ://twitter.com/marcelduran" ,
315+ " testUrl" : " https ://twitter.com/marcelduran" ,
315316 ...
316317 " median" : {
317318 " firstView" : {
@@ -525,9 +526,9 @@ wpt.getLocations(function(err, data) {
525526});
526527```
527528
528- #### 3. Run test on http ://twitter.com/marcelduran from San Jose on IE9
529+ #### 3. Run test on https ://twitter.com/marcelduran from San Jose on IE9
529530``` javascript
530- wpt .runTest (' http ://twitter.com/marcelduran' , {location: ' SanJose_IE9' }, function (err , data ) {
531+ wpt .runTest (' https ://twitter.com/marcelduran' , {location: ' SanJose_IE9' }, function (err , data ) {
531532 console .log (err || data);
532533});
533534```
@@ -557,16 +558,16 @@ wpt.getWaterfallImage('121025_PT_N8K', {
557558});
558559```
559560
560- #### Run test on http ://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds
561+ #### Run test on https ://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds
561562``` javascript
562- wpt .runTest (' http ://twitter.com/marcelduran' , {pollResults: 5 , timeout: 60 }, function (err , data ) {
563+ wpt .runTest (' https ://twitter.com/marcelduran' , {pollResults: 5 , timeout: 60 }, function (err , data ) {
563564 console .log (err || data);
564565});
565566```
566567
567- #### Or run test on http ://twitter.com/marcelduran and wait results listening on localhost\* port 8000\*\*
568+ #### Or run test on https ://twitter.com/marcelduran and wait results listening on localhost\* port 8000\*\*
568569``` javascript
569- wpt .runTest (' http ://twitter.com/marcelduran' , {waitResults: ' localhost:8000' }, function (err , data ) {
570+ wpt .runTest (' https ://twitter.com/marcelduran' , {waitResults: ' localhost:8000' }, function (err , data ) {
570571 console .log (err || data);
571572});
572573```
@@ -674,13 +675,14 @@ $ npm test
674675
675676# # Changelog
676677
678+ * 0.3.2: Updated deps and fixed test runs with specs
677679* 0.3.1: Added dummy url when scripting, needed for webdriver scripting on mobbile agents
678680* 0.3.0: Replaced xmlResult.php by jsonResult.php WPT API endpoint for fetching test results
679681* 0.2.5: Added test options: custom, chrometrace, callstack, tester; Added chrometrace command (` getChromeTraceData` method)
680682* 0.2.4: Added test options: clearcerts, medianvideo, datareduction, useragent and tsview; HTTPS support to listen/proxy server
681683* 0.2.3: Updated DevTools Timeline API url endpoint for timeline command
682684* 0.2.2: Added response body command/method
683- * 0.2.1: Added history, video, player, googleCsi commands and continuous option
685+ * 0.2.1: Added history, video, player, googleCsi commands and continuous option
684686* 0.2.0: Replaced jsonml by xml2js dependency
685687* 0.1.3: Test results extra data (breakdown, domains, requests, pagespeed)
686688* 0.1.0: Specs (CI); Run in batch; Node methods/options as command aliases; new Chrome test options
@@ -699,16 +701,15 @@ https://github.com/marcelduran/webpagetest-api/issues
699701
700702** Marcel Duran**
701703
702- + http ://github.com/marcelduran
704+ + https ://github.com/marcelduran
703705
704706# # License
705707
706- Copyright 2013 Twitter Inc.
707- Copyright 2014 Google Inc.
708- Copyright 2014 Marcel Duran and other contributors
708+ Copyright 2013 Twitter Inc.
709+ Copyright 2015 Google Inc.
710+ Copyright 2015 Marcel Duran and other contributors
709711
710- Licensed under the [MIT License](http ://github.com/marcelduran/webpagetest-api/raw/master/LICENSE)
712+ Licensed under the [MIT License](https ://github.com/marcelduran/webpagetest-api/raw/master/LICENSE)
711713
712714
713715[! [Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/marcelduran/webpagetest-api/trend.png)](https://bitdeli.com/free " Bitdeli Badge" )
714-
0 commit comments