webpagetest
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -49,4 +49,8 @@ /** | ||
} | ||
newObj = {}; | ||
o[a[0]].push(newObj); | ||
if (len === 2) { | ||
return rec([o[a[0]].length, a[1]], o[a[0]]); | ||
} else { | ||
newObj = {}; | ||
o[a[0]].push(newObj); | ||
} | ||
} else { | ||
@@ -58,2 +62,6 @@ o[a[0]] = {}; | ||
} | ||
} else if (len === undefined && typeof a === 'object') { | ||
Object.keys(a).forEach(function(key) { | ||
o[key] = a[key]; | ||
}); | ||
} | ||
@@ -60,0 +68,0 @@ }; |
@@ -416,2 +416,30 @@ /** | ||
results: { | ||
'breakdown': { | ||
name: 'breakDown', | ||
key: 'b', | ||
api: 'breakdown', | ||
bool: true, | ||
info: 'include the breakdown of requests and bytes by mime type' | ||
}, | ||
'domains': { | ||
name: 'domains', | ||
key: 'D', | ||
api: 'domains', | ||
bool: true, | ||
info: 'include the breakdown of requests and bytes by domain' | ||
}, | ||
'pagespeed': { | ||
name: 'pageSpeed', | ||
key: 'p', | ||
api: 'pagespeed', | ||
bool: true, | ||
info: 'include the PageSpeed score in the response (may be slower)' | ||
}, | ||
'requests': { | ||
name: 'requests', | ||
key: 'R', | ||
api: 'requests', | ||
bool: true, | ||
info: 'include the request data in the response (slower and results in much larger responses)' | ||
}, | ||
'median': { | ||
@@ -418,0 +446,0 @@ name: 'medianMetric', |
{ | ||
"name": "webpagetest", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "WebPageTest API wrapper for NodeJS", | ||
@@ -37,3 +37,3 @@ "author": "Marcel Duran <github@marcelduran.com> (http://github.com/marcelduran)", | ||
"jsonml": "~0.0.4", | ||
"commander": "~1.3.0", | ||
"commander": "~1.3.2", | ||
"mocha": "~1.12.0" | ||
@@ -40,0 +40,0 @@ }, |
@@ -122,5 +122,9 @@ ## WebPageTest API Wrapper for NodeJS [![Build Status](https://secure.travis-ci.org/marcelduran/webpagetest-api.png?branch=master)](http://travis-ci.org/marcelduran/webpagetest-api) [![Dependencies Status](https://david-dm.org/marcelduran/webpagetest-api.png)](https://david-dm.org/marcelduran/webpagetest-api) | ||
#### Results (works for **results** and **test** commands) | ||
* **--median** _\<metric\>_: set the metric used to calculate median for multiple runs tests [loadTime] | ||
* **--specs** _\<json_or_file\>_: set the specs for performance test suite | ||
* **--reporter** _\<name\>_: set performance test suite reporter output: [dot]|spec|tap|xunit|list|progress|min|nyan|landing|json|doc|markdown|teamcity | ||
* **-b, --breakdown**: include the breakdown of requests and bytes by mime type | ||
* **-D, --domains**: include the breakdown of requests and bytes by domain | ||
* **-p, --pagespeed**: include the PageSpeed score in the response (may be slower) | ||
* **-R, --requests**: include the request data in the response (slower and results in much larger responses) | ||
* **-m, --median** _\<metric\>_: set the metric used to calculate median for multiple runs tests [loadTime] | ||
* **-S, --specs** _\<json_or_file\>_: set the specs for performance test suite | ||
* **-r, --reporter** _\<name\>_: set performance test suite reporter output: [dot]|spec|tap|xunit|list|progress|min|nyan|landing|json|doc|markdown|teamcity | ||
@@ -415,2 +419,6 @@ #### Run (works for **pagespeed**, **utilization**, **request**, **timeline**, **netlog**, **console**, **waterfall** and **screenshot** commands) | ||
#### Results (works for **getResults** and **runTest** methods) | ||
* **breakDown**: _Boolean_, include the breakdown of requests and bytes by mime type | ||
* **domains**: _Boolean_, include the breakdown of requests and bytes by domain | ||
* **pageSpeed**: _Boolean_, include the PageSpeed score in the response (may be slower) | ||
* **requests**: _Boolean_, include the request data in the response (slower and results in much larger responses) | ||
* **medianMetric**: _String_, set the metric used to calculate median for multiple runs tests (default: loadTime) | ||
@@ -602,2 +610,3 @@ * **specs**: _String_, set the specs for performance test suite | ||
* 0.1.3: Test results extra data (breakdown, domains, requests, pagespeed) | ||
* 0.1.0: Specs (CI); Run in batch; Node methods/options as command aliases; new Chrome test options | ||
@@ -604,0 +613,0 @@ * 0.0.4: Sync test with results via `--poll` or `--wait` |
@@ -57,2 +57,12 @@ /** | ||
it('gets a test results with extra data input returns the API url', function(done) { | ||
exec(mock('results 130724_YD_8JX -bDpR'), function(err, data) { | ||
if (err) return done(err); | ||
data = JSON.parse(data); | ||
assert.equal(data.url, wptServer + | ||
'xmlResult.php?test=130724_YD_8JX&breakdown=1&domains=1&pagespeed=1&requests=1'); | ||
done(); | ||
}); | ||
}); | ||
it('gets the locations list input returns the API url', function(done) { | ||
@@ -59,0 +69,0 @@ exec(mock('locations'), function(err, data) { |
@@ -65,2 +65,17 @@ /** | ||
it('gets a test results with extra data request', function(done) { | ||
wpt.getTestResults('130724_YD_8JX', { | ||
breakDown: true, | ||
domains: true, | ||
pageSpeed: true, | ||
requests: true, | ||
dryRun: true | ||
}, function (err, data) { | ||
if (err) return done(err); | ||
assert.equal(data.url, wptServer + | ||
'xmlResult.php?test=130724_YD_8JX&breakdown=1&domains=1&pagespeed=1&requests=1'); | ||
done(); | ||
}); | ||
}); | ||
it('gets the locations list request', function(done) { | ||
@@ -67,0 +82,0 @@ wpt.getLocations({dryRun: true}, function (err, data) { |
@@ -7,2 +7,6 @@ | ||
-h, --help output usage information | ||
-b, --breakdown include the breakdown of requests and bytes by mime type | ||
-D, --domains include the breakdown of requests and bytes by domain | ||
-p, --pagespeed include the PageSpeed score in the response (may be slower) | ||
-R, --requests include the request data in the response (slower and results in much larger responses) | ||
-m, --median <metric> set the metric used to calculate median for multiple runs tests [loadTime] | ||
@@ -9,0 +13,0 @@ -S, --specs <json_or_file> set the specs for performance test suite |
@@ -56,2 +56,6 @@ | ||
-e, --request <id> echo request ID, useful to track asynchronous requests | ||
--breakdown include the breakdown of requests and bytes by mime type | ||
--domains include the breakdown of requests and bytes by domain | ||
--pagespeed include the PageSpeed score in the response (may be slower) | ||
--requests include the request data in the response (slower and results in much larger responses) | ||
--median <metric> set the metric used to calculate median for multiple runs tests [loadTime] | ||
@@ -58,0 +62,0 @@ --specs <json_or_file> set the specs for performance test suite |
@@ -39,2 +39,5 @@ /** | ||
// test results with extra data | ||
'/xmlResult.php?test=130724_YD_8JX&breakdown=1&domains=1&pagespeed=1&requests=1': 'testResultsExtraData.xml', | ||
// sync | ||
@@ -41,0 +44,0 @@ '/runtest.php?url=http%3A%2F%2Ftwitter.com%2Fmarcelduran&f=json&pingback=http%3A%2F%2F127.0.0.1%3A8000%2Ftestdone': 'runTest.json', |
@@ -50,2 +50,15 @@ /** | ||
it('gets a test results with extra data request then returns the test results object', function(done) { | ||
wpt.getTestResults('130724_YD_8JX', { | ||
breakDown: true, | ||
domains: true, | ||
pageSpeed: true, | ||
requests: true | ||
}, function (err, data) { | ||
if (err) return done(err); | ||
assert.deepEqual(data, ResponseObjects.testResultsExtraData); | ||
done(); | ||
}); | ||
}); | ||
it('gets the locations list request then returns the locations list object', function(done) { | ||
@@ -52,0 +65,0 @@ wpt.getLocations(function (err, data) { |
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
24126964
105
53130
632
Updatedcommander@~1.3.2