Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpagetest

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpagetest - npm Package Compare versions

Comparing version 0.2.5 to 0.3.0

test/fixtures/responses/testResults.json

4

lib/mapping.js

@@ -98,3 +98,3 @@ /**

bool: true,
info: 'clear SSL cetificate caches'
info: 'clear SSL certificate caches'
},

@@ -686,3 +686,3 @@ 'ignoressl': {

param: 'id',
info: 'get the HTTPS Archive (HAR) from test'
info: 'get the HTTP Archive (HAR) from test'
},

@@ -689,0 +689,0 @@ 'pagespeed': {

@@ -111,4 +111,3 @@ /**

// bail if test not complete
if (!err && (!data || data && data.response &&
data.response.statusCode !== 200)) {
if (!err && (!data || data.statusCode !== 200)) {
return callback(err, data);

@@ -145,3 +144,3 @@ }

err = err || specs;
} else if (!(data && data.response && data.response.data)) {
} else if (!(data && data.data)) {
err = err || new Error('no data');

@@ -154,3 +153,3 @@ }

defaults = specs.defaults || {};
traverse(specs, data.response.data);
traverse(specs, data.data);
}

@@ -157,0 +156,0 @@

@@ -24,3 +24,3 @@ /**

testStatus: 'testStatus.php',
testResults: 'xmlResult.php',
testResults: 'jsonResult.php',
locations: 'getLocations.php',

@@ -408,3 +408,3 @@ testers: 'getTesters.php',

if (options.pollResults && !options.dryRun) {
options.pollResults = (parseInt(options.pollResults, 10) || 5) * 1000;
options.pollResults = parseInt(options.pollResults * 1000, 10) || 5000;

@@ -411,0 +411,0 @@ return api.call(this, paths.test, testCallback.bind(this, poll),

{
"name": "webpagetest",
"version": "0.2.5",
"version": "0.3.0",
"description": "WebPageTest API wrapper for NodeJS",

@@ -37,3 +37,3 @@ "author": "Marcel Duran <github@marcelduran.com> (http://github.com/marcelduran)",

"commander": "~2.3.0",
"csv": "~0.4.0",
"csv": "~0.4.1",
"entities": "~1.1.1",

@@ -44,4 +44,4 @@ "mocha": "~1.21.4",

"devDependencies": {
"nock": "~0.48.0"
"nock": "~0.48.2"
}
}

@@ -50,3 +50,3 @@ ## WebPageTest API Wrapper for NodeJS

* **cancel** _\<id\>_: cancel running/pending test
* **har** _\<id\>_: get the HTTPS Archive (HAR) from test
* **har** _\<id\>_: get the HTTP Archive (HAR) from test
* **pagespeed** _[options] \<id\>_: get the Google Page Speed results (if available) from test

@@ -66,3 +66,3 @@ * **utilization** _[options] \<id\>_: get the CPU, bandwidth and memory utilization data from test

* **video** _[options] \<tests\>_: create a video from _\<tests\>_ (comma separated test ids)
* **player _\<id\>_: get a html5 player for a video _\<id\>_
* **player** _\<id\>_: get a html5 player for a video _\<id\>_
* **listen** _[options]_ _[port]_: start webpagetest-api server on port _[7791_]

@@ -90,3 +90,3 @@ * **batch** _\<file\>_: run commands in batch, i.e. one command per line from _\<file\>_ in parallel

* **-S, --noscript**: disable javascript (IE, Chrome, Firefox)
* **-C, --clearcerts**: clear SSL cetificate caches
* **-C, --clearcerts**: clear SSL certificate caches
* **-R, --ignoressl**: ignore SSL certificate errors, e.g. name mismatch, self-signed certificates, etc

@@ -414,3 +414,3 @@ * **-T, --standards**: forces all pages to load in standards mode (IE only)

* **disableJavaScript**: _Boolean_, disable javascript (IE, Chrome, Firefox)
* **clearCerts**: _Boolean_, clear SSL cetificate caches
* **clearCerts**: _Boolean_, clear SSL certificate caches
* **ignoreSSL**: _Boolean_, ignore SSL certificate errors, e.g. name mismatch, self-signed certificates, etc

@@ -677,2 +677,3 @@ * **disableCompatibilityView**: _Boolean_, forces all pages to load in standards mode (IE only)

* 0.3.0: Replaced xmlResult.php by jsonResult.php WPT API endpoint for fetching test results
* 0.2.5: Added test options: custom, chrometrace, callstack, tester; Added chrometrace command (`getChromeTraceData` method)

@@ -679,0 +680,0 @@ * 0.2.4: Added test options: clearcerts, medianvideo, datareduction, useragent and tsview; HTTPS support to listen/proxy server

@@ -44,3 +44,3 @@ /**

data = JSON.parse(data);
assert.equal(data.url, wptServer + 'xmlResult.php?test=120816_V2_2');
assert.equal(data.url, wptServer + 'jsonResult.php?test=120816_V2_2');
done();

@@ -55,3 +55,3 @@ });

assert.equal(data.url, wptServer +
'xmlResult.php?test=120816_V2_2&medianMetric=TTFB');
'jsonResult.php?test=120816_V2_2&medianMetric=TTFB');
done();

@@ -62,7 +62,7 @@ });

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) {
exec(mock('results 141106_8N_ZRC -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');
'jsonResult.php?test=141106_8N_ZRC&breakdown=1&domains=1&pagespeed=1&requests=1');
done();

@@ -334,3 +334,3 @@ });

assert.equal(data[0].url, wptServer + 'testStatus.php?test=120816_V2_2');
assert.equal(data[1].url, wptServer + 'xmlResult.php?test=120816_V2_2');
assert.equal(data[1].url, wptServer + 'jsonResult.php?test=120816_V2_2');
done();

@@ -337,0 +337,0 @@ });

@@ -39,3 +39,3 @@ /**

if (err) return done(err);
assert.equal(data.url, wptServer + 'xmlResult.php?test=120816_V2_2');
assert.equal(data.url, wptServer + 'jsonResult.php?test=120816_V2_2');
done();

@@ -51,3 +51,3 @@ });

if (err) return done(err);
assert.equal(data.url, wptServer + 'xmlResult.php?test=120816_V2_2&r=12345');
assert.equal(data.url, wptServer + 'jsonResult.php?test=120816_V2_2&r=12345');
done();

@@ -64,3 +64,3 @@ });

assert.equal(data.url, wptServer +
'xmlResult.php?test=120816_V2_2&medianMetric=TTFB');
'jsonResult.php?test=120816_V2_2&medianMetric=TTFB');
done();

@@ -71,3 +71,3 @@ });

it('gets a test results with extra data request', function(done) {
wpt.getTestResults('130724_YD_8JX', {
wpt.getTestResults('141106_8N_ZRC', {
breakDown: true,

@@ -81,3 +81,3 @@ domains: true,

assert.equal(data.url, wptServer +
'xmlResult.php?test=130724_YD_8JX&breakdown=1&domains=1&pagespeed=1&requests=1');
'jsonResult.php?test=141106_8N_ZRC&breakdown=1&domains=1&pagespeed=1&requests=1');
done();

@@ -84,0 +84,0 @@ });

@@ -17,3 +17,3 @@

-S, --noscript disable javascript (IE, Chrome, Firefox)
-C, --clearcerts clear SSL cetificate caches
-C, --clearcerts clear SSL certificate caches
-R, --ignoressl ignore SSL certificate errors, e.g. name mismatch, self-signed certificates, etc

@@ -20,0 +20,0 @@ -T, --standards forces all pages to load in standards mode (IE only)

@@ -25,3 +25,3 @@

har <id>
get the HTTPS Archive (HAR) from test
get the HTTP Archive (HAR) from test

@@ -28,0 +28,0 @@ pagespeed [options] <id>

{
"response": {
"statusCode": 404,
"statusText": "Invalid Test ID: 120816_V2_3"
}
}
"data": {
"statusCode": 400,
"statusText": "Test not found",
"id": "120816_V2_3"
},
"statusCode": 400,
"statusText": "Test not found"
}

@@ -1,1 +0,1 @@

{"statusCode":200,"statusText":"Ok","data":{"testId":"130619_KK_6A2","ownerKey":"a7c32f43d2fcc75a13f558c0e4b31499d270f267","jsonUrl":"http:\/\/www.example.com\/results.php?test=130619_KK_6A2&f=json","xmlUrl":"http:\/\/www.example.com\/xmlResult.php?test=130619_KK_6A2","userUrl":"http:\/\/www.example.com\/results.php?test=130619_KK_6A2","summaryCSV":"http:\/\/www.example.com\/csv.php?test=130619_KK_6A2","detailCSV":"http:\/\/www.example.com\/csv.php?test=130619_KK_6A2&amp;requests=1"}}
{"statusCode":200,"statusText":"Ok","data":{"testId":"141106_TM_ZFM","ownerKey":"a7c32f43d2fcc75a13f558c0e4b31499d270f267","jsonUrl":"http:\/\/www.example.com\/results.php?test=141106_TM_ZFM&f=json","xmlUrl":"http:\/\/www.example.com\/xmlResult.php?test=141106_TM_ZFM","userUrl":"http:\/\/www.example.com\/results.php?test=141106_TM_ZFM","summaryCSV":"http:\/\/www.example.com\/csv.php?test=141106_TM_ZFM","detailCSV":"http:\/\/www.example.com\/csv.php?test=141106_TM_ZFM&amp;requests=1"}}

@@ -8,10 +8,10 @@ {

"firstView": {
"requests": {
"min": 30,
"max": 50
"connections": {
"min": 3,
"max": 8
},
"render": 200,
"render": 800,
"loadTime": {
"text": "page load time: {actual} should be less than {expected}",
"max": 15000
"max": 5000
},

@@ -18,0 +18,0 @@ "foo": {

@@ -15,3 +15,3 @@ /**

'/testStatus.php?test=120816_V2_2': 'testStatus.json',
'/xmlResult.php?test=120816_V2_2': 'testResults.xml',
'/jsonResult.php?test=120816_V2_2': 'testResults.json',
'/getLocations.php': 'locations.xml',

@@ -45,7 +45,7 @@ '/getTesters.php': 'testers.xml',

// test results for multi runs with/without custom median metric
'/xmlResult.php?test=130619_KK_6A2': 'testResultsMultiRunsDefaultMedianMetric.xml',
'/xmlResult.php?test=130619_KK_6A2&medianMetric=TTFB': 'testResultsMultiRunsTTFBMedianMetric.xml',
'/jsonResult.php?test=141106_TM_ZFM': 'testResultsMultiRunsDefaultMedianMetric.json',
'/jsonResult.php?test=141106_TM_ZFM&medianMetric=TTFB': 'testResultsMultiRunsTTFBMedianMetric.json',
// test results with extra data
'/xmlResult.php?test=130724_YD_8JX&breakdown=1&domains=1&pagespeed=1&requests=1': 'testResultsExtraData.xml',
'/jsonResult.php?test=141106_8N_ZRC&breakdown=1&domains=1&pagespeed=1&requests=1': 'testResultsExtraData.json',

@@ -58,3 +58,3 @@ // sync

'/testStatus.php?test=120816_V2_3': 'testStatusNotFound.json',
'/xmlResult.php?test=120816_V2_3': 'testResultsNotFound.xml',
'/jsonResult.php?test=120816_V2_3': 'testResultsNotFound.json',
'/runtest.php?url=&f=json': 'runTestInvalid.json',

@@ -61,0 +61,0 @@ '/runtest.php?script=&f=json': 'runTestInvalid.json',

@@ -83,3 +83,3 @@ /**

it('gets a test results for multi runs with default median metric GET request then returns the test results JSON', function(done) {
get('/results/130619_KK_6A2', server, function (err, data) {
get('/results/141106_TM_ZFM', server, function (err, data) {
if (err) return done(err);

@@ -93,3 +93,3 @@ data = JSON.parse(data);

it('gets a test results for multi runs with custom median metric GET request then returns the test results JSON', function(done) {
get('/results/130619_KK_6A2?median=TTFB', server, function (err, data) {
get('/results/141106_TM_ZFM?median=TTFB', server, function (err, data) {
if (err) return done(err);

@@ -96,0 +96,0 @@ data = JSON.parse(data);

@@ -37,3 +37,3 @@ /**

it('gets a test results for multi runs with default median metric request then returns the test results object', function(done) {
wpt.getTestResults('130619_KK_6A2', function (err, data) {
wpt.getTestResults('141106_TM_ZFM', function (err, data) {
if (err) return done(err);

@@ -46,3 +46,3 @@ assert.deepEqual(data, ResponseObjects.testResultsMultiRunsDefaultMedianMetric);

it('gets a test results for multi runs with custom median metric request then returns the test results object', function(done) {
wpt.getTestResults('130619_KK_6A2', {medianMetric: 'TTFB'}, function (err, data) {
wpt.getTestResults('141106_TM_ZFM', {medianMetric: 'TTFB'}, function (err, data) {
if (err) return done(err);

@@ -55,3 +55,3 @@ assert.deepEqual(data, ResponseObjects.testResultsMultiRunsTTFBMedianMetric);

it('gets a test results with extra data request then returns the test results object', function(done) {
wpt.getTestResults('130724_YD_8JX', {
wpt.getTestResults('141106_8N_ZRC', {
breakDown: true,

@@ -58,0 +58,0 @@ domains: true,

@@ -16,3 +16,3 @@ /**

describe('Example WebPageTest', function() {
describe('Example WebPageTest for Specs', function() {
describe('Hits a Nock Server', function() {

@@ -44,4 +44,4 @@

http.get('http://' + server.hostname + ':' + server.port +
'/testdone?id=130619_KK_6A2');
}, 500);
'/testdone?id=141106_TM_ZFM');
}, 100);
});

@@ -48,0 +48,0 @@

@@ -15,3 +15,3 @@ /**

describe('Example WebPageTest', function() {
describe('Example WebPageTest for Sync', function() {
describe('Hits a Nock Server', function() {

@@ -31,3 +31,3 @@

wpt.runTest('http://twitter.com/marcelduran', {
pollResults: 1
pollResults: 0.1
}, function(err, data) {

@@ -51,3 +51,3 @@ if (err) return done(err);

'/testdone?id=120816_V2_2');
}, 500);
}, 100);
});

@@ -63,6 +63,6 @@

if (err) return done(err);
assert.equal(data.response.data.median.firstView.run, 2);
wpt.getTestResults('130619_KK_6A2', function(err, data) {
assert.equal(data.data.median.firstView.run, 3);
wpt.getTestResults('120816_V2_2', function(err, data) {
if (err) return done(err);
assert.equal(data.response.data.median.firstView.run, 3);
assert.equal(data.data.median.firstView.run, 1);
done();

@@ -73,4 +73,4 @@ });

http.get('http://' + server.hostname + ':' + server.port +
'/testdone?id=130619_KK_6A2');
}, 500);
'/testdone?id=141106_TM_ZFM');
}, 100);
});

@@ -77,0 +77,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc