forked from IABTechLab/cmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protractor.conf.js
88 lines (74 loc) · 2.25 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
82
83
84
85
86
87
88
const browserstack = require('browserstack-local');
const availableBrowsers = {
chrome: {
browserName: 'chrome',
chromeOptions: {
args: ['--headless', '--disable-gpu', '--window-size=800,600'],
},
},
firefox: {
browserName: 'firefox',
'moz:firefoxOptions': {
args: ['--headless', '--width=800', '--height=600'],
},
},
safari: {
browserName: 'safari',
},
ie: {
browserName: 'ie',
},
edge: {
browserName: 'ie',
},
};
const browsers = process.env.BROWSERS
? process.env.BROWSERS.split(',')
: ['chrome'];
const baseUrl = process.env.BASE_URL || 'http://localhost:8080';
const config = {
baseUrl,
framework: 'jasmine',
specs: ['spec/**/*.spec.js'],
jasmineNodeOpts: {
print() {},
},
multiCapabilities: browsers
.filter(
browserName => typeof availableBrowsers[browserName] !== 'undefined',
)
.map(browserName => availableBrowsers[browserName]),
onPrepare() {
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
jasmine.getEnv().clearReporters();
jasmine.getEnv().addReporter(
new SpecReporter({
spec: {
displayStacktrace: false,
displaySuccessesSummary: false, // display summary of all successes after execution
displayFailuresSummary: false, // display summary of all failures after execution
displayPendingSummary: false, // display summary of all pending specs after execution
displaySuccessfulSpec: true, // display each successful spec
displayFailedSpec: true, // display each failed spec
displayPendingSpec: true, // display each pending spec
displaySpecDuration: true, // display each spec duration
displaySuiteNumber: true,
},
}),
);
},
};
if (process.env.BROWSERSTACK == 1) {
config.seleniumAddress = 'http://hub-cloud.browserstack.com/wd/hub';
config.commonCapabilities = {
'browserstack.user': process.env.BROWSERSTACK_USER,
'browserstack.key': process.env.BROWSERSTACK_KEY,
// 'browserstack.local': true,
};
config.multiCapabilities.forEach(cap => {
for (let key in config.commonCapabilities) {
cap[key] = cap[key] || config.commonCapabilities[key];
}
});
}
exports.config = config;