-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathprotractor.conf.js
executable file
·60 lines (48 loc) · 1.64 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
'use strict';
var conf = require('./gulpfile.config');
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
var reporter = new HtmlScreenshotReporter({
dest: 'reports/e2e/html'
});
// An example configuration file.
exports.config = {
// The address of a running selenium server.
//seleniumAddress: 'http://localhost:4444/wd/hub',
//seleniumServerJar: deprecated, this should be set on node_modules/protractor/config.json
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': process.env.PROTRACTOR_BROWSER || 'chrome'
},
framework: 'jasmine2',
// Only works with Chrome and Firefox
directConnect: true,
baseUrl: 'http://localhost:3000',
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: [conf.paths.e2e + '/**/*.js'],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
// Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve){
reporter.beforeLaunch(resolve);
});
},
onPrepare: function() {
// Add better console spec reporter
jasmine.getEnv().addReporter(new SpecReporter({}));
// Reporter in html with a screenshot for each test.
jasmine.getEnv().addReporter(reporter);
},
// Close the report after all tests finish
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
reporter.afterLaunch(resolve.bind(this, exitCode));
});
}
};