Skip to content

Commit 49444f2

Browse files
committed
fixed in command line
1 parent 0817f40 commit 49444f2

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

bin/webpagetest

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ function cleanupProgram() {
269269
delete program.server;
270270
delete program.dryrun;
271271
delete program.out;
272+
delete program.http_method;
272273
}
273274

274275
function execCommand() {
@@ -277,6 +278,7 @@ function execCommand() {
277278
// options
278279
if (options) {
279280
options.dryRun = program.dryrun;
281+
options.http_method = program.http_method;
280282
args.push(options);
281283
}
282284

test/command-line-test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,4 +352,15 @@ describe('WebPageTest Command Line', function() {
352352
});
353353
});
354354

355+
it('gets a test with long custom metrics script then returns API url and payload with custom metrics data', function (done) {
356+
let script = '"[example]\n\\\\' + 'X'.repeat(10000) + '\nreturn 1;"'
357+
exec(mock('test http://foobar.com --http_method POST --custom ' + script), function (err, data) {
358+
if (err) return done(err);
359+
data = JSON.parse(data);
360+
assert.equal(data.url, wptServer + 'runtest.php');
361+
assert.equal(data.form.length, 10089);
362+
done();
363+
});
364+
});
365+
355366
});

test/edge-cases-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ describe('Edge Cases of', function() {
8585
});
8686
});
8787

88-
it('gets a test with custom metrics then returns API url and payload with custom metrics data present', function (done) {
88+
it('gets a test with long custom metrics script then returns API url and payload with custom metrics data', function (done) {
8989
wpt.runTest('http://foobar.com', {
9090
dryRun: true,
9191
mobile: 1,
9292
http_method: 'POST',
93-
custom: '[example]\n\\\\' + 'X'.repeat(6 * 1024) + '\nreturn 1;'
93+
custom: '[example]\n\\\\' + 'X'.repeat(10000) + '\nreturn 1;'
9494
}, function (err, data) {
9595
if (err) return done(err);
9696
assert.equal(data.url, wptServer + 'runtest.php');
97-
assert.equal(data.form.length, 6233);
97+
assert.equal(data.form.length, 10089);
9898
done();
9999
});
100100
});

0 commit comments

Comments
 (0)