-
Notifications
You must be signed in to change notification settings - Fork 1
/
.protractor.conf.js
37 lines (31 loc) · 952 Bytes
/
.protractor.conf.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
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
var screenshotReporter = new HtmlScreenshotReporter({
dest: 'tests/out/e2e/screenshots',
filename: 'my-screenshot-report.html'
});
exports.config = {
capabilities : {
'browserName' : 'chrome',
'chromeOptions' : {
'args': ['--headless', '--disable-gpu']
}
},
framework: 'jasmine',
specs: ['./tests/e2e/index.js'],
// Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve){
screenshotReporter.beforeLaunch(resolve);
});
},
// Assign the test reporter to each running instance
onPrepare: function() {
jasmine.getEnv().addReporter(screenshotReporter);
},
// Close the report after all tests finish
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
screenshotReporter.afterLaunch(resolve.bind(this, exitCode));
});
}
}