Skip to content

Commit c24dd6d

Browse files
committed
Updated deps and readme. Bumped version.
1 parent 62eaa3f commit c24dd6d

30 files changed

+118
-115
lines changed

README.md

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
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
2425
var WebPageTest = require('webpagetest');
2526
var 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&amp;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&amp;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-

lib/specs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function buildTest(metric, spec, actual, defaults) {
9191
result = actual === expected;
9292
operation = 'equal to';
9393
}
94-
94+
9595
// result
9696
text = text
9797
.replace('{metric}', metric)
@@ -153,7 +153,7 @@ function specsRunner(specs, reporter, callback, err, data) {
153153

154154
// run mocha suite
155155
var mocha = new Mocha({reporter: reporter});
156-
mocha.suite.emit('pre-require', global);
156+
mocha.suite.emit('pre-require', global, null, mocha);
157157
buildSuite(defaults, tests);
158158
mocha.run(callback || function(failures) {
159159
process.exit(failures);

lib/webpagetest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function get(config, pathname, proxy, callback, encoding) {
6565
headers: {
6666
Host: config.hostname
6767
}
68-
} :
68+
} :
6969
{
7070
path: pathname,
7171
host: config.hostname,
@@ -132,7 +132,7 @@ function get(config, pathname, proxy, callback, encoding) {
132132
});
133133
}
134134

135-
// execute callback properly normalizing optional args
135+
// execute callback properly normalizing optional args
136136
function callbackYield(callback, err, data, options) {
137137
if (typeof callback === 'function') {
138138
callback.apply(callback, [err, data].concat(options.args));

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpagetest",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "WebPageTest API wrapper for NodeJS",
55
"author": "Marcel Duran <[email protected]> (http://github.com/marcelduran)",
66
"homepage": "http://github.com/marcelduran/webpagetest-api",
@@ -33,13 +33,13 @@
3333
"node": ">=0.10.1"
3434
},
3535
"dependencies": {
36-
"commander": "^2.5.1",
36+
"commander": "^2.7.1",
3737
"csv": "^0.4.1",
3838
"entities": "^1.1.1",
39-
"mocha": "^2.0.1",
40-
"xml2js": "^0.4.4"
39+
"mocha": "^2.2.4",
40+
"xml2js": "^0.4.6"
4141
},
4242
"devDependencies": {
43-
"nock": "~0.48.2"
43+
"nock": "~1.5.0"
4444
}
4545
}

test/fixtures/command-line/help-batch.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
Usage: batch [options] <file>
33

4+
run commands in batch, i.e. one command per line from <file> in parallel
5+
46
Options:
57

68
-h, --help output usage information

test/fixtures/command-line/help-cancel.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
Usage: cancel [options] <id>
33

4+
cancel running/pending test
5+
46
Options:
57

68
-h, --help output usage information

test/fixtures/command-line/help-chrometrace.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
Usage: chrometrace [options] <id>
33

4+
get the Chrome Trace data (if available) from test
5+
46
Options:
57

68
-h, --help output usage information

test/fixtures/command-line/help-console.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
Usage: console [options] <id>
33

4+
get the browser console log data (if available) from test
5+
46
Options:
57

68
-h, --help output usage information

test/fixtures/command-line/help-googlecsi.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
Usage: googlecsi [options] <id>
33

4+
get Google CSI data (Client Side Instrumentation)
5+
46
Options:
57

68
-h, --help output usage information

test/fixtures/command-line/help-har.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
Usage: har [options] <id>
33

4+
get the HTTP Archive (HAR) from test
5+
46
Options:
57

68
-h, --help output usage information

0 commit comments

Comments
 (0)