Skip to content

Commit c598504

Browse files
committed
Added test options: clearcerts, medianvideo, datareduction, useragent and tsview
1 parent 1afec02 commit c598504

4 files changed

Lines changed: 52 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ $ npm test
633633

634634
## Changelog
635635

636+
* 0.2.4: Added test options: clearcerts, medianvideo, datareduction, useragent and tsview
636637
* 0.2.3: Updated DevTools Timeline API url endpoint for timeline command
637638
* 0.2.2: Added response body command/method
638639
* 0.2.1: Added history, video, player, googleCsi commands and continuous option

lib/mapping.js

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,36 @@ var options = {
277277
array: true,
278278
info: 'space-delimited list of domains to simulate failure by re-routing to blackhole.webpagetest.org to silently drop all requests'
279279
},
280+
'htmlbody': {
281+
name: 'htmlBody',
282+
api: 'htmlbody',
283+
bool: true,
284+
info: 'save the content of only the base HTML response'
285+
},
286+
'continuous': {
287+
name: 'continuousVideoCapture',
288+
api: 'continuousVideo',
289+
bool: true,
290+
info: 'capture video continuously (unstable/experimental, may cause tests to fail)'
291+
},
292+
'clearcerts': {
293+
name: 'clearCerts',
294+
api: 'clearcerts',
295+
bool: true,
296+
info: 'clear the OS certificate caches (causes IE to do OCSP/CRL checks during SSL negotiation if the certificates are not already cached)'
297+
},
298+
'medianvideo': {
299+
name: 'medianVideo',
300+
api: 'mv',
301+
bool: true,
302+
info: 'store the video from the median run when capturing video is enabled'
303+
},
304+
'tsview': {
305+
name: 'tsView',
306+
api: 'tsview_id',
307+
param: 'id',
308+
info: 'test name to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb)'
309+
},
280310
'mobile': {
281311
name: 'emulateMobile',
282312
key: 'W',
@@ -326,24 +356,24 @@ var options = {
326356
bool: true,
327357
info: 'use SPDY without SSL (Chrome only)'
328358
},
359+
'datareduction': {
360+
name: 'dataReduction',
361+
api: 'dataReduction',
362+
bool: true,
363+
info: 'enable data reduction on Chrome 34+ Android (Chrome only)'
364+
},
365+
'useragent': {
366+
name: 'userAgent',
367+
api: 'uastring',
368+
param: 'string',
369+
info: 'custom user agent string (Chrome only)'
370+
},
329371
'cmdline': {
330372
name: 'commandLine',
331373
api: 'cmdline',
332374
param: 'switches',
333375
info: 'use a list of custom command line switches (Chrome only)'
334376
},
335-
'htmlbody': {
336-
name: 'htmlBody',
337-
api: 'htmlbody',
338-
bool: true,
339-
info: 'save the content of only the base HTML response'
340-
},
341-
'continuous': {
342-
name: 'continuousVideoCapture',
343-
api: 'continuousVideo',
344-
bool: true,
345-
info: 'capture video continuously (unstable/experimental, may cause tests to fail)'
346-
},
347377
'poll': {
348378
name: 'pollResults',
349379
param: 'interval',
@@ -730,7 +760,7 @@ function setOptions(command, query) {
730760

731761
if (query.hasOwnProperty(key)) {
732762
if (options[key].bool) {
733-
opts[options[key].name] = !reBool.test(query[key])
763+
opts[options[key].name] = !reBool.test(query[key]);
734764
} else if (!valid || (valid && valid.test(query[key]))) {
735765
opts[options[key].name] = decodeURIComponent(query[key]);
736766
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpagetest",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "WebPageTest API wrapper for NodeJS",
55
"author": "Marcel Duran <github@marcelduran.com> (http://github.com/marcelduran)",
66
"homepage": "http://github.com/marcelduran/webpagetest-api",

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,21 @@
4141
-A, --noads block ads defined by adblockrules.org
4242
-E, --aft (experimental) measure above-the-fold rendering time
4343
-Z, --spof <domains> space-delimited list of domains to simulate failure by re-routing to blackhole.webpagetest.org to silently drop all requests
44+
--htmlbody save the content of only the base HTML response
45+
--continuous capture video continuously (unstable/experimental, may cause tests to fail)
46+
--clearcerts clear the OS certificate caches (causes IE to do OCSP/CRL checks during SSL negotiation if the certificates are not already cached)
47+
--medianvideo store the video from the median run when capturing video is enabled
48+
--tsview <id> test name to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb)
4449
-W, --mobile (experimental) emulate mobile browser: Chrome mobile user agent, 640x960 screen, 2x scaling and fixed viewport (Chrome only)
4550
-M, --timeline capture Developer Tools Timeline (Chrome only)
4651
-G, --netlog capture Network Log (Chrome only)
4752
-C, --spdy3 force SPDY version 3 (Chrome only)
4853
-J, --swrender force software rendering, disable GPU acceleration (Chrome only)
4954
-Q, --noparser disable threaded HTML parser (Chrome only)
5055
-q, --spdynossl use SPDY without SSL (Chrome only)
56+
--datareduction enable data reduction on Chrome 34+ Android (Chrome only)
57+
--useragent <string> custom user agent string (Chrome only)
5158
--cmdline <switches> use a list of custom command line switches (Chrome only)
52-
--htmlbody save the content of only the base HTML response
53-
--continuous capture video continuously (unstable/experimental, may cause tests to fail)
5459
--poll [interval] poll for results after test is scheduled at every <interval> seconds [5]
5560
--wait [hostname:port] wait for test results informed by agent once complete listening on <hostname>:<port> [hostname:first port available above 8000]
5661
--timeout <seconds> timeout for polling and waiting results [no timeout]

0 commit comments

Comments
 (0)