webpagetest
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -374,2 +374,8 @@ /** | ||
}, | ||
'tsviewconfigs': { | ||
name: 'tsViewConfigs', | ||
api: 'tsview_configs', | ||
param: 'string', | ||
info: 'configs to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb)' | ||
}, | ||
'affinity': { | ||
@@ -381,3 +387,9 @@ name: 'affinity', | ||
}, | ||
'priority': { | ||
name: 'priority', | ||
api: 'priority', | ||
param: 'number', | ||
info: 'change test priority (0-9) [enforced by API key, otherwise 5]', | ||
valid: /^\d$/ | ||
}, | ||
// Undocumented/experimental/transitent/deprecated | ||
@@ -384,0 +396,0 @@ 'noads': { |
@@ -94,3 +94,3 @@ /** | ||
} | ||
// result | ||
@@ -157,3 +157,3 @@ text = text | ||
var mocha = new Mocha({reporter: reporter}); | ||
mocha.suite.emit('pre-require', global); | ||
mocha.suite.emit('pre-require', global, null, mocha); | ||
buildSuite(defaults, tests); | ||
@@ -160,0 +160,0 @@ mocha.run(callback || function(failures) { |
@@ -68,3 +68,3 @@ /** | ||
} | ||
} : | ||
} : | ||
{ | ||
@@ -136,3 +136,3 @@ path: pathname, | ||
// execute callback properly normalizing optional args | ||
// execute callback properly normalizing optional args | ||
function callbackYield(callback, err, data, options) { | ||
@@ -340,4 +340,4 @@ if (typeof callback === 'function') { | ||
// and not when specs are done testing | ||
if (!err && (!data || data && data.response && | ||
data.response.statusCode !== 200) && | ||
if (!err && (!data || data && data.data && | ||
data.statusCode !== 200) && | ||
!(typeof err === 'number' && data === undefined)) { | ||
@@ -344,0 +344,0 @@ polling = setTimeout(getTestResults.bind(this, testId, |
{ | ||
"name": "webpagetest", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "WebPageTest API wrapper for NodeJS", | ||
@@ -36,11 +36,11 @@ "author": "Marcel Duran <github@marcelduran.com> (http://github.com/marcelduran)", | ||
"dependencies": { | ||
"commander": "~2.3.0", | ||
"csv": "~0.4.1", | ||
"entities": "~1.1.1", | ||
"mocha": "~1.21.4", | ||
"xml2js": "~0.4.4" | ||
"commander": "^2.7.1", | ||
"csv": "^0.4.1", | ||
"entities": "^1.1.1", | ||
"mocha": "^2.2.4", | ||
"xml2js": "^0.4.6" | ||
}, | ||
"devDependencies": { | ||
"nock": "~0.48.2" | ||
"nock": "~1.5.0" | ||
} | ||
} |
## WebPageTest API Wrapper for NodeJS | ||
[![NPM](https://nodei.co/npm/webpagetest.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/webpagetest/) | ||
[![Build Status](https://secure.travis-ci.org/marcelduran/webpagetest-api.png?branch=master)](http://travis-ci.org/marcelduran/webpagetest-api) | ||
[![Build Status](https://secure.travis-ci.org/marcelduran/webpagetest-api.png?branch=master)](https://travis-ci.org/marcelduran/webpagetest-api) | ||
[![NPM Version](https://img.shields.io/npm/v/webpagetest.svg?style=flat)](https://www.npmjs.org/package/webpagetest) | ||
[![NPM Downloads](https://img.shields.io/npm/dm/webpagetest.svg?style=flat)](https://www.npmjs.org/package/webpagetest) | ||
[![Dependencies Status](https://david-dm.org/marcelduran/webpagetest-api.png)](https://david-dm.org/marcelduran/webpagetest-api) | ||
[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. | ||
[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. | ||
@@ -19,3 +20,3 @@ ## Getting started | ||
```bash | ||
$ webpagetest test http://twitter.com/marcelduran | ||
$ webpagetest test https://twitter.com/marcelduran | ||
``` | ||
@@ -28,3 +29,3 @@ | ||
wpt.runTest('http://twitter.com/marcelduran', function(err, data) { | ||
wpt.runTest('https://twitter.com/marcelduran', function(err, data) { | ||
console.log(err || data); | ||
@@ -128,3 +129,5 @@ }); | ||
* **--tsview** _\<id\>_: test name to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb) | ||
* **--tsviewconfigs** _\<string\>_: configs to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb) | ||
* **--affinity** _\<string\>_: string to hash test to a specific test agent. tester will be picked by index among available testers | ||
* **--priority** _\<number\>_: change test priority (0-9) [enforced by API key, otherwise 5] | ||
* **--noads**: block ads defined by adblockrules.org | ||
@@ -139,3 +142,3 @@ * **--continuous**: capture video continuously (unstable/experimental, may cause tests to fail) | ||
#### API Key (works for **test** and **cancel** commands) | ||
* **-k, --key** _\<api_key\>_:API key (if assigned). Contact the WebPageTest server administrator for a key if required | ||
* **-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) | ||
@@ -219,5 +222,5 @@ #### Request (works for **status**, **results**, **locations**, **testers** and **test** commands) | ||
#### 2. Run test on http://twitter.com/marcelduran from San Jose on IE9 | ||
#### 2. Run test on https://twitter.com/marcelduran from San Jose on IE9 | ||
```bash | ||
$ webpagetest test http://twitter.com/marcelduran --key 1F2A3K4E5 --location SanJose_IE9 | ||
$ webpagetest test https://twitter.com/marcelduran --key 1F2A3K4E5 --location SanJose_IE9 | ||
``` | ||
@@ -231,7 +234,7 @@ ```javascript | ||
"ownerKey": "868cb2813a0f376a977dd1a24ab041b4f12361b3", | ||
"jsonUrl": "http://localhost/results.php?test=121025_PT_N8K&f=json", | ||
"xmlUrl": "http://localhost/xmlResult.php?test=121025_PT_N8K", | ||
"userUrl": "http://localhost/results.php?test=121025_PT_N8K", | ||
"summaryCSV": "http://localhost/csv.php?test=121025_PT_N8K", | ||
"detailCSV": "http://localhost/csv.php?test=121025_PT_N8K&requests=1" | ||
"jsonUrl": "https://www.webpagetest.org/results.php?test=121025_PT_N8K&f=json", | ||
"xmlUrl": "https://www.webpagetest.org/xmlResult.php?test=121025_PT_N8K", | ||
"userUrl": "https://www.webpagetest.org/results.php?test=121025_PT_N8K", | ||
"summaryCSV": "https://www.webpagetest.org/csv.php?test=121025_PT_N8K", | ||
"detailCSV": "https://www.webpagetest.org/csv.php?test=121025_PT_N8K&requests=1" | ||
} | ||
@@ -270,4 +273,4 @@ } | ||
"testId": "121025_PT_N8K", | ||
"summary": "http://www.webpagetest.org/result/121025_PT_N8K/", | ||
"testUrl": "http://twitter.com/marcelduran", | ||
"summary": "https://www.webpagetest.org/result/121025_PT_N8K/", | ||
"testUrl": "https://twitter.com/marcelduran", | ||
"location": "SanJose_IE9", | ||
@@ -305,9 +308,9 @@ "connectivity": "DSL", | ||
#### Run test on http://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds | ||
#### Run test on https://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds | ||
```bash | ||
$ webpagetest test http://twitter.com/marcelduran --poll 5 --timeout 60 | ||
$ webpagetest test https://twitter.com/marcelduran --poll 5 --timeout 60 | ||
``` | ||
#### Or run test on http://twitter.com/marcelduran and wait for results listening on localhost\* port 8000\** | ||
#### Or run test on https://twitter.com/marcelduran and wait for results listening on localhost\* port 8000\** | ||
```bash | ||
$ webpagetest test http://twitter.com/marcelduran --wait 8000 | ||
$ webpagetest test https://twitter.com/marcelduran --wait 8000 | ||
``` | ||
@@ -320,3 +323,3 @@ ```javascript | ||
"testId": "121025_PT_N8K", | ||
"testUrl": "http://twitter.com/marcelduran", | ||
"testUrl": "https://twitter.com/marcelduran", | ||
... | ||
@@ -458,3 +461,5 @@ "median": { | ||
* **tsView**: _String_, test name to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb) | ||
* **tsViewConfigs**: _String_, configs to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb) | ||
* **affinity**: _String_, string to hash test to a specific test agent. tester will be picked by index among available testers | ||
* **priority**: _Number_, change test priority (0-9) [enforced by API key, otherwise 5] | ||
* **blockAds**: _Boolean_, block ads defined by adblockrules.org | ||
@@ -534,5 +539,5 @@ * **continuousVideoCapture**: _Boolean_, capture video continuously (unstable/experimental, may cause tests to fail) | ||
#### 3. Run test on http://twitter.com/marcelduran from San Jose on IE9 | ||
#### 3. Run test on https://twitter.com/marcelduran from San Jose on IE9 | ||
```javascript | ||
wpt.runTest('http://twitter.com/marcelduran', {location: 'SanJose_IE9'}, function(err, data) { | ||
wpt.runTest('https://twitter.com/marcelduran', {location: 'SanJose_IE9'}, function(err, data) { | ||
console.log(err || data); | ||
@@ -567,5 +572,5 @@ }); | ||
#### Run test on http://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds | ||
#### Run test on https://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds | ||
```javascript | ||
wpt.runTest('http://twitter.com/marcelduran', {pollResults: 5, timeout: 60}, function(err, data) { | ||
wpt.runTest('https://twitter.com/marcelduran', {pollResults: 5, timeout: 60}, function(err, data) { | ||
console.log(err || data); | ||
@@ -575,5 +580,5 @@ }); | ||
#### Or run test on http://twitter.com/marcelduran and wait results listening on localhost\* port 8000\*\* | ||
#### Or run test on https://twitter.com/marcelduran and wait results listening on localhost\* port 8000\*\* | ||
```javascript | ||
wpt.runTest('http://twitter.com/marcelduran', {waitResults: 'localhost:8000'}, function(err, data) { | ||
wpt.runTest('https://twitter.com/marcelduran', {waitResults: 'localhost:8000'}, function(err, data) { | ||
console.log(err || data); | ||
@@ -686,2 +691,3 @@ }); | ||
* 0.3.2: Updated deps and fixed test runs with specs | ||
* 0.3.1: Added dummy url when scripting, needed for webdriver scripting on mobbile agents | ||
@@ -693,3 +699,3 @@ * 0.3.0: Replaced xmlResult.php by jsonResult.php WPT API endpoint for fetching test results | ||
* 0.2.2: Added response body command/method | ||
* 0.2.1: Added history, video, player, googleCsi commands and continuous option | ||
* 0.2.1: Added history, video, player, googleCsi commands and continuous option | ||
* 0.2.0: Replaced jsonml by xml2js dependency | ||
@@ -713,14 +719,13 @@ * 0.1.3: Test results extra data (breakdown, domains, requests, pagespeed) | ||
+ http://github.com/marcelduran | ||
+ https://github.com/marcelduran | ||
## License | ||
Copyright 2013 Twitter Inc. | ||
Copyright 2014 Google Inc. | ||
Copyright 2014 Marcel Duran and other contributors | ||
Copyright 2013 Twitter Inc. | ||
Copyright 2015 Google Inc. | ||
Copyright 2015 Marcel Duran and other contributors | ||
Licensed under the [MIT License](http://github.com/marcelduran/webpagetest-api/raw/master/LICENSE) | ||
Licensed under the [MIT License](https://github.com/marcelduran/webpagetest-api/raw/master/LICENSE) | ||
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/marcelduran/webpagetest-api/trend.png)](https://bitdeli.com/free "Bitdeli Badge") | ||
Usage: batch [options] <file> | ||
run commands in batch, i.e. one command per line from <file> in parallel | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: cancel [options] <id> | ||
cancel running/pending test | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: chrometrace [options] <id> | ||
get the Chrome Trace data (if available) from test | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: console [options] <id> | ||
get the browser console log data (if available) from test | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: googlecsi [options] <id> | ||
get Google CSI data (Client Side Instrumentation) | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: har [options] <id> | ||
get the HTTP Archive (HAR) from test | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: history [options] [days] | ||
get history of previously run tests | ||
Options: | ||
-h, --help output usage information | ||
-h, --help output usage information | ||
Usage: listen [options] [hostname:port] | ||
start webpagetest-api proxy server on <hostname>:<port> [hostname:7791] | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: locations [options] | ||
list locations and the number of pending tests | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: netlog [options] <id> | ||
get the Chrome Developer Tools Net log data (if available) from test | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: pagespeed [options] <id> | ||
get the Google Page Speed results (if available) from test | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: player [options] <id> | ||
get a html5 player for a video <id> | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: request [options] <id> | ||
get the request data from test | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: response [options] <id> | ||
get response body for text resources | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: results [options] <id> | ||
get test results | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: screenshot [options] <id> | ||
get the fully loaded page screenshot in JPG format (PNG if in full resolution) | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: status [options] <id> | ||
check test status | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: test [options] <url_or_script> | ||
run test | ||
Options: | ||
@@ -55,3 +57,5 @@ | ||
--tsview <id> test name to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb) | ||
--tsviewconfigs <string> configs to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb) | ||
--affinity <string> string to hash test to a specific test agent. tester will be picked by index among available testers | ||
--priority <number> change test priority (0-9) [enforced by API key, otherwise 5] | ||
--noads block ads defined by adblockrules.org | ||
@@ -58,0 +62,0 @@ --continuous capture video continuously (unstable/experimental, may cause tests to fail) |
Usage: testers [options] | ||
list testers status and details | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: testinfo [options] <id> | ||
get test request info/details | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: timeline [options] <id> | ||
get the Chrome Developer Tools Timeline data (if available) from test | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: utilization [options] <id> | ||
get the CPU, bandwidth and memory utilization data from test | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: video [options] <tests> | ||
create a video from <tests> (comma separated test ids) | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: waterfall [options] <id> | ||
get the waterfall PNG image | ||
Options: | ||
@@ -5,0 +7,0 @@ |
Usage: webpagetest [options] [command] | ||
Commands: | ||
status [options] <id> | ||
check test status | ||
results [options] <id> | ||
get test results | ||
locations [options] | ||
list locations and the number of pending tests | ||
testers [options] | ||
list testers status and details | ||
test [options] <url_or_script> | ||
run test | ||
cancel [options] <id> | ||
cancel running/pending test | ||
har <id> | ||
get the HTTP Archive (HAR) from test | ||
pagespeed [options] <id> | ||
get the Google Page Speed results (if available) from test | ||
utilization [options] <id> | ||
get the CPU, bandwidth and memory utilization data from test | ||
request [options] <id> | ||
get the request data from test | ||
timeline [options] <id> | ||
get the Chrome Developer Tools Timeline data (if available) from test | ||
netlog [options] <id> | ||
get the Chrome Developer Tools Net log data (if available) from test | ||
chrometrace [options] <id> | ||
get the Chrome Trace data (if available) from test | ||
console [options] <id> | ||
get the browser console log data (if available) from test | ||
testinfo <id> | ||
get test request info/details | ||
history [days] | ||
get history of previously run tests | ||
googlecsi [options] <id> | ||
get Google CSI data (Client Side Instrumentation) | ||
response [options] <id> | ||
get response body for text resources | ||
waterfall [options] <id> | ||
get the waterfall PNG image | ||
screenshot [options] <id> | ||
get the fully loaded page screenshot in JPG format (PNG if in full resolution) | ||
video [options] <tests> | ||
create a video from <tests> (comma separated test ids) | ||
player <id> | ||
get a html5 player for a video <id> | ||
listen [options] [hostname:port] | ||
start webpagetest-api proxy server on <hostname>:<port> [hostname:7791] | ||
batch <file> | ||
run commands in batch, i.e. one command per line from <file> in parallel | ||
status [options] <id> check test status | ||
results [options] <id> get test results | ||
locations [options] list locations and the number of pending tests | ||
testers [options] list testers status and details | ||
test [options] <url_or_script> run test | ||
cancel [options] <id> cancel running/pending test | ||
har <id> get the HTTP Archive (HAR) from test | ||
pagespeed [options] <id> get the Google Page Speed results (if available) from test | ||
utilization [options] <id> get the CPU, bandwidth and memory utilization data from test | ||
request [options] <id> get the request data from test | ||
timeline [options] <id> get the Chrome Developer Tools Timeline data (if available) from test | ||
netlog [options] <id> get the Chrome Developer Tools Net log data (if available) from test | ||
chrometrace [options] <id> get the Chrome Trace data (if available) from test | ||
console [options] <id> get the browser console log data (if available) from test | ||
testinfo <id> get test request info/details | ||
history [days] get history of previously run tests | ||
googlecsi [options] <id> get Google CSI data (Client Side Instrumentation) | ||
response [options] <id> get response body for text resources | ||
waterfall [options] <id> get the waterfall PNG image | ||
screenshot [options] <id> get the fully loaded page screenshot in JPG format (PNG if in full resolution) | ||
video [options] <tests> create a video from <tests> (comma separated test ids) | ||
player <id> get a html5 player for a video <id> | ||
listen [options] [hostname:port] start webpagetest-api proxy server on <hostname>:<port> [hostname:7791] | ||
batch <file> run commands in batch, i.e. one command per line from <file> in parallel | ||
@@ -79,0 +32,0 @@ Options: |
@@ -87,2 +87,3 @@ /** | ||
server = nock(host || 'http://www.webpagetest.org'); | ||
nock.enableNetConnect(); | ||
@@ -89,0 +90,0 @@ // request/response mapping |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5781098
116424
716
+ Addedcommander@2.20.3(transitive)
+ Addeddebug@2.2.0(transitive)
+ Addeddiff@1.4.0(transitive)
+ Addedglob@3.2.11(transitive)
+ Addedgrowl@1.9.2(transitive)
+ Addedminimatch@0.3.0(transitive)
+ Addedmkdirp@0.5.1(transitive)
+ Addedmocha@2.5.3(transitive)
+ Addedms@0.7.1(transitive)
+ Addedsupports-color@1.2.0(transitive)
+ Addedto-iso-string@0.0.2(transitive)
- Removeddebug@2.0.0(transitive)
- Removeddiff@1.0.8(transitive)
- Removedglob@3.2.3(transitive)
- Removedgraceful-fs@2.0.3(transitive)
- Removedgrowl@1.8.1(transitive)
- Removedminimatch@0.2.14(transitive)
- Removedmkdirp@0.5.0(transitive)
- Removedmocha@1.21.5(transitive)
- Removedms@0.6.2(transitive)
Updatedcommander@^2.7.1
Updatedcsv@^0.4.1
Updatedentities@^1.1.1
Updatedmocha@^2.2.4
Updatedxml2js@^0.4.6