You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61-4Lines changed: 61 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,8 @@ $ webpagetest --help
53
53
***testinfo**_\<id\>_: get test request info/details
54
54
***waterfall**_[options]\<id\>_: get the waterfall PNG image
55
55
***screenshot**_[options]\<id\>_: get the fully loaded page screenshot in JPG format (PNG if in full resolution)
56
-
***listen**_[port]_: start webpagetest-api server on port [7791]
56
+
***listen**_[port]_: start webpagetest-api server on port _[7791_]
57
+
***batch**_\<file\>_: run commands in batch, i.e. one command per line from _\<file\>_ in parallel
57
58
58
59
### Options
59
60
@@ -110,15 +111,17 @@ _The default WPT server can also be specified via environment variable `WEBPAGET
110
111
***-Q, --noparser**: disable threaded HTML parser (Chrome only)
111
112
***-q, --spdynossl**: use SPDY without SSL (Chrome only)
112
113
***--cmdline**_\<switches\>_: use a list of custom command line switches (Chrome only)
113
-
***--poll**_[interval]_: poll for results after test is scheduled at every <interval> seconds [5]
114
-
***--wait**_[hostname:port]_: wait for test results informed by agent once complete listening on <hostname>:<port> [hostname:first port available above 8000]
114
+
***--poll**_[interval]_: poll for results after test is scheduled at every \<interva\l> seconds [5]
115
+
***--wait**_[hostname:port]_: wait for test results informed by agent once complete listening on \<hostname\>:\<port\>[hostname:first port available above 8000]
115
116
***--timeout**_\<seconds\>_: timeout for polling and waiting results [no timeout]
116
117
117
118
#### Request (works for **status**, **results**, **locations**, **testers** and **test** commands)
118
119
***-e, --request**_\<id\>_: echo request ID, useful to track asynchronous requests
119
120
120
121
#### Results (works for **results** and **test** commands)
121
-
***-m, --median**_\<metric\>_: set the metric used to calculate median for multiple runs tests [loadTime]
122
+
***--median**_\<metric\>_: set the metric used to calculate median for multiple runs tests [loadTime]
123
+
***--specs**_\<json_or_file\>_: set the specs for performance test suite
124
+
***--reporter**_\<name\>_: set performance test suite reporter output: [dot]|spec|tap|xunit|list|progress|min|nyan|landing|json|doc|markdown|teamcity
122
125
123
126
#### Run (works for **pagespeed**, **utilization**, **request**, **timeline**, **netlog**, **console**, **waterfall** and **screenshot** commands)
124
127
***-r, --run**_\<number\>_: which run number on a multiple runs test [1]
#### Results (works for **getResults** and **runTest** methods)
411
414
***medianMetric**: _String_, set the metric used to calculate median for multiple runs tests (default: loadTime)
415
+
***specs**: _String_, set the specs for performance test suite
416
+
***reporter**: _String_, set performance test suite reporter output: [dot]|spec|tap|xunit|list|progress|min|nyan|landing|json|doc|markdown|teamcity
412
417
413
418
#### Run (works for `getPageSpeedData`, `getUtilizationData`, `getRequestData`, `getTimelineData`, `getNetLogData`, `getConsoleLogData`, `getWaterfallImage` and `getScreenshotImage` methods)
414
419
***run**: _Number_, the test run number for multiple runs tests (default: 1, first test)
@@ -534,13 +539,65 @@ setTimeout(function() {
534
539
}, 10000); // wait for 10s before stop listening
535
540
```
536
541
542
+
## Batch
543
+
Batch command is available as command line only and loads a batch file containing one WebPageTest CLI command with options per line. It runs all commands in paralell but returns and array of results in order as they appear in the batch file once all results are ready. The exit status code is the sum of all individual commands exit status code.
544
+
545
+
By running
546
+
```bash
547
+
$ webpagetest batch commands.txt
548
+
```
549
+
where `commands.txt` contains:
550
+
```
551
+
test twitter.com/marcelduran --first --location foo
552
+
test twitter.com/marcelduran --first --location bar
553
+
```
554
+
It schedules the 2 tests above returning an array of size 2 in the same order as in `commands.txt` file:
555
+
```javascript
556
+
[
557
+
{
558
+
"statusCode":200, "statusText":"Ok",
559
+
"data": {
560
+
"testId":"130715_AB_C1D",
561
+
...
562
+
}
563
+
},
564
+
{
565
+
"statusCode":200, "statusText":"Ok",
566
+
"data": {
567
+
"testId":"130715_CD_E2F",
568
+
...
569
+
}
570
+
}
571
+
]
572
+
```
573
+
With exit status 0 in case none of commands returns an error:
574
+
```bash
575
+
$ echo$?
576
+
0
577
+
````
578
+
579
+
By running multiple sync tests, i.e. with either `--poll` or `--wait`, all tests are schedule and results are pulled or waitin paralell, it means if tests are set to run in different locations of same location with multiple agents, the final result might come together but the result array will only return once all tests are done. e.g.:
580
+
581
+
`commands.txt`:
582
+
```
583
+
test twitter.com/marcelduran --first --location foo --poll --timeout 60
584
+
test twitter.com/marcelduran --first --location bar --poll --timeout 60
585
+
```
586
+
587
+
## Test Specs (Continuous Integration)
588
+
589
+
WebPageTest API Wrapper provides a simple seamless way to integrate WebPageTest with Continuous Integration tools.
0 commit comments