Skip to content

Commit

Permalink
Update dependencies, tests, readme, and copyright info.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelduran committed Jun 17, 2020
1 parent 211349e commit 86a40a5
Show file tree
Hide file tree
Showing 46 changed files with 495 additions and 435 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright (c) 2013 Twitter Inc.
Copyright (c) 2015 Google Inc.
Copyright (c) 2015 Marcel Duran and other contributors
Copyright (c) 2020 Google Inc.
Copyright (c) 2020 Marcel Duran and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
22 changes: 16 additions & 6 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------- WebPagetest (http://code.google.com/p/webpagetest/) -------------
---------- WebPagetest (https://github.com/WPO-Foundation/webpagetest) ---------

Copyright (c) 2005-2010, AOL, LLC. All rights reserved.
Copyrights licensed under the BSD License.
Expand All @@ -8,17 +8,27 @@ Copyrights licensed under the BSD License.
Copyright 2010, 2011, 2012, 2013. All rights reserved.
Licensed under the MIT License.

---------- commander (http://visionmedia.github.com/commander.js/) -------------
--------------- commander (https://github.com/tj/commander.js) -----------------

Copyright (c) 2011 TJ Holowaychuk <[email protected]>.
Licensed under the MIT License.

-------------- mocha (http://visionmedia.github.com/mocha/) --------------------
---------------- mocha (https://github.com/mochajs/mocha) ----------------------

Copyright (c) 2011-2013 TJ Holowaychuk <[email protected]>.
Copyright (c) 2011-2020 OpenJS Foundation and contributors, https://openjsf.org
Licensed under the MIT License.

------------------- nock (https://github.com/flatiron/nock) --------------------
--------------------- nock (https://github.com/nock/nock) ----------------------

Copyright (c) 2011 Pedro Teixeira. http://about.me/pedroteixeira
Copyright (c) 2011-2019 Pedro Teixeira and other contributors
Licensed under the MIT License.

------------------- csv (https://github.com/adaltas/node-csv) ------------------

Copyright (c) 2010 Adaltas
Licensed under the MIT License.

----------------- entities (https://github.com/fb55/entities) ------------------

Copyright (c) Felix Böhm. All rights reserved.
Licensed under BSD 2-Clause "Simplified" License.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $ npm install webpagetest -g

### Command line
```bash
$ webpagetest test https://twitter.com/marcelduran
$ webpagetest test http://marcelduran.com/webpagetest-api
```

### Docker
Expand All @@ -27,15 +27,15 @@ $ docker build -t webpagetest-api .
```
#### Run
```bash
$ docker run -it --rm webpagetest-api -k YOURAPIKEY test https://twitter.com/marcelduran
$ docker run -it --rm webpagetest-api -k YOURAPIKEY test http://marcelduran.com/webpagetest-api
```

### Module
```javascript
const WebPageTest = require('webpagetest');
const wpt = new WebPageTest('www.webpagetest.org');

wpt.runTest('https://twitter.com/marcelduran', (err, data) => {
wpt.runTest('http://marcelduran.com/webpagetest-api', (err, data) => {
console.log(err || data);
});
```
Expand Down Expand Up @@ -229,9 +229,9 @@ $ webpagetest locations
}
```

#### 2. Run test on https://twitter.com/marcelduran from San Jose on IE9
#### 2. Run test on http://marcelduran.com/webpagetest-api from San Jose on IE9
```bash
$ webpagetest test https://twitter.com/marcelduran --key 1F2A3K4E5 --location SanJose_IE9
$ webpagetest test http://marcelduran.com/webpagetest-api --key 1F2A3K4E5 --location SanJose_IE9
```
```javascript
{
Expand Down Expand Up @@ -279,7 +279,7 @@ $ webpagetest results 121025_PT_N8K
"data": {
"testId": "121025_PT_N8K",
"summary": "https://www.webpagetest.org/result/121025_PT_N8K/",
"testUrl": "https://twitter.com/marcelduran",
"testUrl": "http://marcelduran.com/webpagetest-api",
"location": "SanJose_IE9",
"connectivity": "DSL",
"bwDown": 1500, "bwUp": 384, "latency": 50, "plr": 0,
Expand Down Expand Up @@ -312,21 +312,21 @@ $ webpagetest waterfall 121025_PT_N8K --thumbnail --cached --uri
}
```

#### Run test on https://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds
#### Run test on http://marcelduran.com/webpagetest-api and poll results every 5 seconds timing out in 60 seconds
```bash
$ webpagetest test https://twitter.com/marcelduran --poll 5 --timeout 60
$ webpagetest test http://marcelduran.com/webpagetest-api --poll 5 --timeout 60
```
#### Or run test on https://twitter.com/marcelduran and wait for results listening on localhost\* port 8000\**
#### Or run test on http://marcelduran.com/webpagetest-api and wait for results listening on localhost\* port 8000\**
```bash
$ webpagetest test https://twitter.com/marcelduran --wait 8000
$ webpagetest test http://marcelduran.com/webpagetest-api --wait 8000
```
```javascript
{
"response": {
"statusCode": 200, "statusText": "Ok",
"data": {
"testId": "121025_PT_N8K",
"testUrl": "https://twitter.com/marcelduran",
"testUrl": "http://marcelduran.com/webpagetest-api",
...
"median": {
"firstView": {
Expand Down Expand Up @@ -543,9 +543,9 @@ wpt.getLocations((err, data) => {
});
```

#### 3. Run test on https://twitter.com/marcelduran from San Jose on IE9
#### 3. Run test on http://marcelduran.com/webpagetest-api from San Jose on IE9
```javascript
wpt.runTest('https://twitter.com/marcelduran', {location: 'SanJose_IE9'}, (err, data) => {
wpt.runTest('http://marcelduran.com/webpagetest-api', {location: 'SanJose_IE9'}, (err, data) => {
console.log(err || data);
});
```
Expand Down Expand Up @@ -575,16 +575,16 @@ wpt.getWaterfallImage('121025_PT_N8K', {
});
```

#### Run test on https://twitter.com/marcelduran and poll results every 5 seconds timing out in 60 seconds
#### Run test on http://marcelduran.com/webpagetest-api and poll results every 5 seconds timing out in 60 seconds
```javascript
wpt.runTest('https://twitter.com/marcelduran', {pollResults: 5, timeout: 60}, (err, data) => {
wpt.runTest('http://marcelduran.com/webpagetest-api', {pollResults: 5, timeout: 60}, (err, data) => {
console.log(err || data);
});
```

#### Or run test on https://twitter.com/marcelduran and wait results listening on localhost\* port 8000\*\*
#### Or run test on http://marcelduran.com/webpagetest-api and wait results listening on localhost\* port 8000\*\*
```javascript
wpt.runTest('https://twitter.com/marcelduran', {waitResults: 'localhost:8000'}, (err, data) => {
wpt.runTest('http://marcelduran.com/webpagetest-api', {waitResults: 'localhost:8000'}, (err, data) => {
console.log(err || data);
});
```
Expand All @@ -605,7 +605,7 @@ http://localhost:8080
```
```bash
$ curl http://localhost:8080/help
$ curl http://localhost:8080/test/twitter.com/?location=SanJose_IE9
$ curl http://localhost:8080/test/marcelduran.com/?location=SanJose_IE9
```
```bash
$ webpagetest listen 8443 --key key.pem --cert cert.pem --server wpt.foo.com
Expand Down Expand Up @@ -643,8 +643,8 @@ $ webpagetest batch commands.txt
```
where `commands.txt` contains:
```
test twitter.com/marcelduran --first --location foo
test twitter.com/marcelduran --first --location bar
test marcelduran.com --first --location foo
test marcelduran.com --first --location bar
```
It schedules the 2 tests above returning an array of size 2 in the same order as in `commands.txt` file:
```javascript
Expand Down Expand Up @@ -675,8 +675,8 @@ By running multiple sync tests, i.e. with either `--poll` or `--wait`, all tests

`commands.txt`:
```
test twitter.com/marcelduran --first --location foo --poll --timeout 60
test twitter.com/marcelduran --first --location bar --poll --timeout 60
test marcelduran.com --first --location foo --poll --timeout 60
test marcelduran.com --first --location bar --poll --timeout 60
```

## Test Specs (Continuous Integration)
Expand Down Expand Up @@ -705,7 +705,7 @@ https://github.com/marcelduran/webpagetest-api/issues
## License

Copyright 2013 Twitter Inc.
Copyright 2017 Google Inc.
Copyright 2017 Marcel Duran and other contributors
Copyright 2020 Google Inc.
Copyright 2020 Marcel Duran and other contributors

Licensed under the [MIT License](https://github.com/marcelduran/webpagetest-api/raw/master/LICENSE)
4 changes: 2 additions & 2 deletions bin/webpagetest
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

/**
* Copyright (c) 2013, Twitter Inc.
* Copyright (c) 2015, Google Inc.
* Copyright (c) 2015, Marcel Duran and other contributors
* Copyright (c) 2020, Google Inc.
* Copyright (c) 2020, Marcel Duran and other contributors
* Released under the MIT License
*/

Expand Down
4 changes: 2 additions & 2 deletions lib/helper.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2013, Twitter Inc.
* Copyright (c) 2015, Google Inc.
* Copyright (c) 2015, Marcel Duran and other contributors
* Copyright (c) 2020, Google Inc.
* Copyright (c) 2020, Marcel Duran and other contributors
* Released under the MIT License
*/

Expand Down
4 changes: 2 additions & 2 deletions lib/mapping.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2013, Twitter Inc.
* Copyright (c) 2015, Google Inc.
* Copyright (c) 2015, Marcel Duran and other contributors
* Copyright (c) 2020, Google Inc.
* Copyright (c) 2020, Marcel Duran and other contributors
* Released under the MIT License
*/

Expand Down
4 changes: 2 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2013, Twitter Inc.
* Copyright (c) 2015, Google Inc.
* Copyright (c) 2015, Marcel Duran and other contributors
* Copyright (c) 2020, Google Inc.
* Copyright (c) 2020, Marcel Duran and other contributors
* Released under the MIT License
*/

Expand Down
4 changes: 2 additions & 2 deletions lib/specs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2013, Twitter Inc.
* Copyright (c) 2015, Google Inc.
* Copyright (c) 2015, Marcel Duran and other contributors
* Copyright (c) 2020, Google Inc.
* Copyright (c) 2020, Marcel Duran and other contributors
* Released under the MIT License
*/

Expand Down
4 changes: 2 additions & 2 deletions lib/webpagetest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2013, Twitter Inc.
* Copyright (c) 2015, Google Inc.
* Copyright (c) 2015, Marcel Duran and other contributors
* Copyright (c) 2020, Google Inc.
* Copyright (c) 2020, Marcel Duran and other contributors
* Released under the MIT License
*/

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webpagetest",
"version": "0.3.10",
"version": "0.4.0",
"description": "WebPageTest API wrapper for NodeJS",
"author": "Marcel Duran <[email protected]> (http://github.com/marcelduran)",
"homepage": "http://github.com/marcelduran/webpagetest-api",
Expand Down Expand Up @@ -28,13 +28,13 @@
"node": ">=4.9.1 "
},
"dependencies": {
"commander": "2.10.0",
"csv": "^5.3.0",
"entities": "^1.1.1",
"mocha": "^5.2.0",
"xml2js": "^0.4.19"
"commander": "^5.1.0",
"csv": "^5.3.2",
"entities": "^2.0.3",
"mocha": "^8.0.1",
"xml2js": "^0.4.23"
},
"devDependencies": {
"nock": "~9.0.13"
"nock": "^12.0.3"
}
}
4 changes: 2 additions & 2 deletions test/command-line-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2013, Twitter Inc.
* Copyright (c) 2015, Google Inc.
* Copyright (c) 2015, Marcel Duran and other contributors
* Copyright (c) 2020, Google Inc.
* Copyright (c) 2020, Marcel Duran and other contributors
* Released under the MIT License
*/

Expand Down
4 changes: 2 additions & 2 deletions test/dryrun-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2013, Twitter Inc.
* Copyright (c) 2015, Google Inc.
* Copyright (c) 2015, Marcel Duran and other contributors
* Copyright (c) 2020, Google Inc.
* Copyright (c) 2020, Marcel Duran and other contributors
* Released under the MIT License
*/

Expand Down
4 changes: 2 additions & 2 deletions test/edge-cases-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2013, Twitter Inc.
* Copyright (c) 2015, Google Inc.
* Copyright (c) 2015, Marcel Duran and other contributors
* Copyright (c) 2020, Google Inc.
* Copyright (c) 2020, Marcel Duran and other contributors
* Released under the MIT License
*/

Expand Down
11 changes: 4 additions & 7 deletions test/fixtures/command-line/help-batch.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
Usage: webpagetest batch [options] <file>

Usage: batch [options] <file>

run commands in batch, i.e. one command per line from <file> in parallel

Options:

-h, --help output usage information
run commands in batch, i.e. one command per line from <file> in parallel

Options:
-h, --help display help for command
14 changes: 6 additions & 8 deletions test/fixtures/command-line/help-cancel.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Usage: webpagetest cancel [options] <id>

Usage: cancel [options] <id>

cancel running/pending test

Options:

-h, --help output usage information
-k, --key <api_key> API key (if assigned). Contact the WebPageTest server administrator for a key if required
cancel running/pending test

Options:
-k, --key <api_key> API key (if assigned). Contact the WebPageTest server
administrator for a key if required
-h, --help display help for command
16 changes: 7 additions & 9 deletions test/fixtures/command-line/help-chrometrace.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
Usage: webpagetest chrometrace [options] <id>

Usage: chrometrace [options] <id>

get the Chrome Trace data (if available) from test

Options:

-h, --help output usage information
-r, --run <number> which run number on a multiple runs test [1]
-c, --cached get the Repeat View (cached view) instead of default First View (primed cache)
get the Chrome Trace data (if available) from test

Options:
-r, --run <number> which run number on a multiple runs test [1]
-c, --cached get the Repeat View (cached view) instead of default
First View (primed cache)
-h, --help display help for command
16 changes: 7 additions & 9 deletions test/fixtures/command-line/help-console.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
Usage: webpagetest console [options] <id>

Usage: console [options] <id>

get the browser console log data (if available) from test

Options:

-h, --help output usage information
-r, --run <number> which run number on a multiple runs test [1]
-c, --cached get the Repeat View (cached view) instead of default First View (primed cache)
get the browser console log data (if available) from test

Options:
-r, --run <number> which run number on a multiple runs test [1]
-c, --cached get the Repeat View (cached view) instead of default
First View (primed cache)
-h, --help display help for command
Loading

0 comments on commit 86a40a5

Please sign in to comment.