forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 1
/
protractor-perf-shared.js
60 lines (54 loc) · 1.41 KB
/
protractor-perf-shared.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
49
50
51
52
53
54
55
56
57
58
59
60
// load traceur runtime as our tests are written in es6
require('traceur/bin/traceur-runtime.js');
var config = exports.config = {
specs: ['dist/cjs/**/*_perf.js'],
params: {
timeBenchmark: {
// size of the sample to take
sampleSize: 10,
targetCoefficientOfVariation: 4,
timeout: 20000,
metrics: ['script', 'render']
}
},
// Disable waiting for Angular as we don't have an integration layer yet...
// TODO(tbosch): Implement a proper debugging API for Ng2.0, remove this here
// and the sleeps in all tests.
onPrepare: function() {
browser.ignoreSynchronization = true;
var _get = browser.get;
var sleepInterval = process.env.TRAVIS ? 5000 : 1000;
browser.get = function() {
browser.sleep(sleepInterval);
return _get.apply(this, arguments);
}
},
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
// TODO: add real mobile devices via a cloud provider that supports appium
if (process.env.TRAVIS) {
config.capabilities = {
name: 'Dartium',
browserName: 'chrome',
chromeOptions: {
'binary': process.env.DARTIUM,
'args': ['--js-flags=--expose-gc']
},
loggingPrefs: {
performance: 'ALL'
}
};
} else {
config.capabilities = {
browserName: 'chrome',
chromeOptions: {
'args': ['--js-flags=--expose-gc']
},
loggingPrefs: {
performance: 'ALL'
}
};
}