forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebdriver-perf.js
48 lines (36 loc) · 1010 Bytes
/
webdriver-perf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'use strict';
var grunt = require('grunt');
var tests = grunt.file.expand(__dirname + '/../../perf/tests/*');
var maxTime = 5;
var reactVersions = [
'edge',
'previous'
];
var params = []
.concat('headless=false')
.concat('maxTime=' + maxTime)
.concat(tests
.map(function(path){ return path.split(/tests./i).reverse()[0]; })
.map(encodeURIComponent)
.map(function(filename){ return 'test=' + filename; })
)
.concat(reactVersions
.map(encodeURIComponent)
.map(function(version){ return 'react=' + version; }
)
);
module.exports = require('./webdriver-all')({
url: "http://127.0.0.1:9999/perf/index.html?" + params.join('&'),
isDoneTimeout: 15 * 60 * 1000,
onStart: function(){
grunt.event.on('perf results', function(results){
console.log(results);
});
},
onComplete: function(completedTestKeys){
grunt.verbose.writeln('onComplete ' + JSON.stringify(completedTestKeys));
},
onError: function(error){
grunt.fatal(error);
}
});