-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathprotractor.conf.js
81 lines (64 loc) · 2.11 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* eslint-disable comma-dangle */
var path = require('path');
function getChromeOptions() {
var chromeOptions = {
args: [
'--no-sandbox',
],
};
if (process.env.CHROME_BIN) {
chromeOptions.binary = process.env.CHROME_BIN;
}
if (process.env.TRAVIS) {
chromeOptions.args.push('--headless');
}
return chromeOptions;
}
var config = {
allScriptsTimeout: 34000,
baseUrl: 'http://localhost:9000',
params: {
baseBackendUrl: 'http://localhost:5000/api/',
username: 'admin',
password: 'admin',
},
suites: {
a: path.join(__dirname, '/spec/**/[a-k]*[Ss]pec.js'),
b: path.join(__dirname, '/spec/**/[l-z]*[Ss]pec.js'),
// disable running e2e tests from extensions until testing environment is reconfigured
// to run start client from the main repo with all extensions enabled
// d: path.join(__dirname, '/scripts/extensions/*/dist/spec/*[Ss]pec.js'),
},
framework: 'jasmine2',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 200000,
},
capabilities: {
browserName: 'chrome',
chromeOptions: getChromeOptions(),
},
directConnect: true,
onPrepare: function() {
require('./spec/helpers/setup').setup({fixture_profile: 'app_prepopulate_data'});
// so it can be used without import in tests
// useful when debugging on CI server
browser.screenshot = require('./spec/helpers/utils').screenshot;
var reporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(
new reporters.JUnitXmlReporter({
savePath: 'e2e-test-results',
consolidateAll: true,
})
);
function CustomReporter() {
this.specDone = function(result) {
if (result.failedExpectations.length > 0) {
browser.screenshot(result.fullName.replace(/[^\w]+/g, '-'));
}
};
}
jasmine.getEnv().addReporter(new CustomReporter());
},
};
exports.config = config;