Skip to content

Commit 8edf823

Browse files
authored
Merge pull request #86 from gshenar/fix-batch
Fix batch to run with more than 2 commands at a time
2 parents 882f56a + 507fd95 commit 8edf823

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

bin/webpagetest

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function parseBatch(filename) {
217217

218218
function batch(file) {
219219
var accErr = 0,
220-
count = 2,
220+
count = 0,
221221
originalFormatData = formatData,
222222
originalOutput = output;
223223

@@ -246,6 +246,7 @@ function batch(file) {
246246
if (!cmds) {
247247
return;
248248
}
249+
count = cmds.length;
249250
output = function(){};
250251

251252
cmds.forEach(function(cmd, index) {

test/command-line-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ describe('WebPageTest Command Line', function() {
329329
data = JSON.parse(data);
330330
assert.equal(data[0].url, wptServer + 'testStatus.php?test=120816_V2_2');
331331
assert.equal(data[1].url, wptServer + 'jsonResult.php?test=120816_V2_2');
332+
assert.equal(data[2].url, wptServer + 'getgzip.php?test=120816_V2_2&file=1_screen.jpg');
332333
done();
333334
});
334335
});

test/fixtures/batch.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
status 120816_V2_2 -s https://www.example.com:1234/foo/bar/ -d
2-
results 120816_V2_2 -s https://www.example.com:1234/foo/bar/ -d
1+
status 120816_V2_2 -d -s https://www.example.com:1234/foo/bar/
2+
results 120816_V2_2 -d -s https://www.example.com:1234/foo/bar/
3+
screenshot 120816_V2_2 -d -s https://www.example.com:1234/foo/bar/

0 commit comments

Comments
 (0)