Skip to content

Commit 9b27e64

Browse files
committed
added wappalyzerpr to test runs
1 parent 7be9af9 commit 9b27e64

File tree

6 files changed

+38
-5
lines changed

6 files changed

+38
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ _The default WPT server can also be specified via environment variable `WEBPAGET
139139
- **-b, --block** _\<urls\>_: space-delimited list of urls to block (substring match)
140140
- **-Z, --spof** _\<domains\>_: space-delimited list of domains to simulate failure by re-routing to blackhole.webpagetest.org to silently drop all requests
141141
- **-c, --custom** _\<script\>_: execute arbitrary javascript at the end of a test to collect custom metrics
142+
- **-w, --wappalyzerpr** _\<number\>_: set the wappalyzer fork PR number to use for technology detection
142143
- **-a, --authtype** _\<type\>_: type of authentication: 0 = Basic, 1 = SNS [0]
143144
- **-n, --notify** _\<e-mail\>_: e-mail address to notify with the test results
144145
- **-B, --pingback** _\<url\>_: URL to ping when the test is complete (the test ID will be passed as an "id" parameter)
@@ -316,7 +317,7 @@ webpagetest status 121025_PT_N8K -k YOURAPIKEY
316317
#### 4. Get test results
317318

318319
```bash
319-
webpagetest results 121025_PT_N8K -k YOURAPIKEY
320+
webpagetest results 121025_PT_N8K -k YOURAPIKEY
320321
```
321322

322323
```javascript
@@ -517,6 +518,7 @@ wpt.runTest(script, (err, data) => {
517518
- **block**: _String_, space-delimited list of urls to block (substring match)
518519
- **spof**: _String_, space-delimited list of domains to simulate failure by re-routing to blackhole.webpagetest.org to silently drop all requests
519520
- **customMetrics**: _String_, execute arbitrary JavaScript at the end of a test to collect custom metrics
521+
- **wappalyzerpr** _Integer_, set the wappalyzer fork PR number to use for technology detection
520522
- **authenticationType**: _Number_, type of authentication: 0 = Basic, 1 = SNS [0]
521523
- **notifyEmail**: _String_, e-mail address to notify with the test results
522524
- **pingback**: _String_, URL to ping when the test is complete (the test ID will be passed as an "id" parameter)

lib/mapping.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@ var options = {
307307
info: "execute arbitrary JavaScript at the end of a test to collect custom metrics",
308308
},
309309

310+
wappalyzerpr: {
311+
name: "wappalyzerpr",
312+
key: "wpr",
313+
api: "wappalyzerpr",
314+
param: "number",
315+
info: "PR number of the Wappalyzer fork to use in technology detection",
316+
},
317+
310318
// API only settings
311319
authtype: {
312320
name: "authenticationType",
@@ -836,6 +844,13 @@ var options = {
836844
param: "script",
837845
info: "execute arbitrary JavaScript at the end of a test to collect custom metrics",
838846
},
847+
wappalyzerpr: {
848+
name: "wappalyzerpr",
849+
key: "wpr",
850+
api: "wappalyzerpr",
851+
param: "number",
852+
info: "PR number of the Wappalyzer fork to use in technology detection",
853+
},
839854

840855
// API only settings
841856
authtype: {

test/command-line-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,12 @@ describe('WebPageTest Command Line', function() {
102102
'--first ' +
103103
'--timeline ' +
104104
'--netlog ' +
105+
'--wappalyzerpr 1 ' +
105106
'--full'
106107
), function(err, data) {
107108
if (err) return done(err);
108109
data = JSON.parse(data);
109-
assert.equal(data.url, wptServer + 'runtest.php?url=http%3A%2F%2Ftwitter.com%2Fmarcelduran&location=Local_Firefox_Chrome%3AChrome&runs=3&fvonly=1&label=test%20123&timeline=1&netlog=1&pngss=1&f=json');
110+
assert.equal(data.url, wptServer + 'runtest.php?url=http%3A%2F%2Ftwitter.com%2Fmarcelduran&location=Local_Firefox_Chrome%3AChrome&runs=3&fvonly=1&label=test%20123&timeline=1&netlog=1&wappalyzerpr=1&pngss=1&f=json');
110111
done();
111112
});
112113
});

test/edge-cases-test.js

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

88+
it('gets a test with custom wappalyzer rules then returns API url', function (done) {
89+
wpt.runTest('http://foobar.com', {
90+
dryRun: true,
91+
wappalyzerpr: 1,
92+
}, function (err, data) {
93+
if (err) return done(err);
94+
assert.equal(data.url, wptServer + 'runtest.php?url=http%3A%2F%2Ffoobar.com&wappalyzerpr=1&f=json');
95+
done();
96+
});
97+
});
98+
8899
});
89100

90101
describe('WebPageTest localhost helper', function() {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Options:
6060
switches (Chrome only)
6161
--lighthouse perform lighthouse test (Chrome only,
6262
Linux agent only)
63-
-thc, --throttleCPU <number> custom cpu throttling
63+
-thc, --throttleCPU <number> custom cpu throttling
6464
-g, --login <username> username for authenticating tests (http
6565
authentication)
6666
-w, --password <password> password for authenticating tests (http
@@ -78,6 +78,8 @@ Options:
7878
drop all requests
7979
-c, --custom <script> execute arbitrary JavaScript at the end
8080
of a test to collect custom metrics
81+
-wpr, --wappalyzerpr <number> set the wappalyzerPR fork PR number to
82+
use for technology detection
8183
-a, --authtype <type> type of authentication: 0 = Basic, 1 =
8284
SNS [0]
8385
-n, --notify <e-mail> e-mail address to notify with the test

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Options:
6060
switches (Chrome only)
6161
--lighthouse perform lighthouse test (Chrome only,
6262
Linux agent only)
63-
-thc, --throttleCPU <number> custom cpu throttling
63+
-thc, --throttleCPU <number> custom cpu throttling
6464
-g, --login <username> username for authenticating tests (http
6565
authentication)
6666
-w, --password <password> password for authenticating tests (http
@@ -78,6 +78,8 @@ Options:
7878
drop all requests
7979
-c, --custom <script> execute arbitrary JavaScript at the end
8080
of a test to collect custom metrics
81+
-wpr, --wappalyzerpr <number> set the wappalyzerPR fork PR number to
82+
use for technology detection
8183
-a, --authtype <type> type of authentication: 0 = Basic, 1 =
8284
SNS [0]
8385
-n, --notify <e-mail> e-mail address to notify with the test
@@ -88,7 +90,7 @@ Options:
8890
-D, --bwdown <bandwidth> download bandwidth in Kbps (used when
8991
specifying a custom connectivity profile)
9092
-U, --bwup <bandwidth> upload bandwidth in Kbps (used when
91-
specifying a custom connectivity profile)
93+
specifying a custom connectivity profile)
9294
-bw, --browserwidth <pixels> Browser window width (in display pixels)
9395
-bh, --browserheight <pixels> Browser window height (in display pixels)
9496
-vh, --viewportheight <pixels> Viewport Height in css pixels

0 commit comments

Comments
 (0)